# README
ddns
import "github.com/SuperBuker/terraform-provider-dns-he-net/client/ddns"
*Notice:* This module is mostly oriented to validate the DDNS credentials. This is mostly a "hack" to validate the current DDNS status.
The functionalities related to update DDNS records are just for testing purposes. No support or enhancement will be provided for this module.
For more information about the API, please refer to: https://dns.he.net/docs.html
*About the API rate limit:* The API enfoces a rate limit based on the requested domain, thus it's only safe to fail one or two times the authentication against the same domain.
This forces us to randomise the domains used during testing.
Index
- Constants
- func CheckAuth(ctx context.Context, hostname, password string) (bool, error)
- func UpdateIP(ctx context.Context, hostname, password, myip string) (bool, error)
- func UpdateTXT(ctx context.Context, hostname, password, txt string) (bool, error)
- func processResponse(msg string) (bool, error)
- type Client
- func New(cli *resty.Client) Client
- func (c Client) CheckAuth(ctx context.Context, hostname, password string) (bool, error)
- func (c Client) UpdateIP(ctx context.Context, hostname, password, myip string) (bool, error)
- func (c Client) UpdateTXT(ctx context.Context, hostname, password, txt string) (bool, error)
- func (c Client) update(ctx context.Context, form map[string]string) (string, error)
- type ErrAPI
- type ErrAbuse
- type ErrAuthFailed
- type ErrDDNS
- type ErrField
- type ErrUnknown
Constants
const (
endpoint = "https://dyn.dns.he.net/nic/update"
)
func CheckAuth
func CheckAuth(ctx context.Context, hostname, password string) (bool, error)
func UpdateIP
func UpdateIP(ctx context.Context, hostname, password, myip string) (bool, error)
func UpdateTXT
func UpdateTXT(ctx context.Context, hostname, password, txt string) (bool, error)
func processResponse
func processResponse(msg string) (bool, error)
type Client
type Client struct {
client *resty.Client
}
func New
func New(cli *resty.Client) Client
func (Client) CheckAuth
func (c Client) CheckAuth(ctx context.Context, hostname, password string) (bool, error)
func (Client) UpdateIP
func (c Client) UpdateIP(ctx context.Context, hostname, password, myip string) (bool, error)
func (Client) UpdateTXT
func (c Client) UpdateTXT(ctx context.Context, hostname, password, txt string) (bool, error)
func (Client) update
func (c Client) update(ctx context.Context, form map[string]string) (string, error)
type ErrAPI
ErrAPI is an error that is returned when the http client returns an error.
type ErrAPI struct {
error error
}
func (*ErrAPI) Error
func (e *ErrAPI) Error() string
func (*ErrAPI) Unwrap
func (e *ErrAPI) Unwrap() []error
type ErrAbuse
ErrAbuse is an error that is returned when too many requests were performed.
type ErrAbuse struct {
}
func (*ErrAbuse) Error
func (e *ErrAbuse) Error() string
func (*ErrAbuse) Unwrap
func (e *ErrAbuse) Unwrap() []error
type ErrAuthFailed
ErrAuthFailed is an error that is returned when authentication fails.
type ErrAuthFailed struct{}
func (*ErrAuthFailed) Error
func (e *ErrAuthFailed) Error() string
func (*ErrAuthFailed) Unwrap
func (e *ErrAuthFailed) Unwrap() []error
type ErrDDNS
ErrDDNS error is returned when interation against the DDNS endpoint fails.
type ErrDDNS struct {
error string
}
func (*ErrDDNS) Error
func (e *ErrDDNS) Error() string
func (*ErrDDNS) Unwrap
func (e *ErrDDNS) Unwrap() []error
type ErrField
ErrField an error that is returned when the request is malformed.
type ErrField struct {
error string
}
func (*ErrField) Error
func (e *ErrField) Error() string
func (*ErrField) Unwrap
func (e *ErrField) Unwrap() []error
func (*ErrField) field
func (e *ErrField) field() (field string, ok bool)
type ErrUnknown
ErrUnknown is an error that is returned when the error cause is unknown.
type ErrUnknown struct {
error string
}
func (*ErrUnknown) Error
func (e *ErrUnknown) Error() string
func (*ErrUnknown) Unwrap
func (e *ErrUnknown) Unwrap() []error
Generated by gomarkdoc