Documentation
¶
Index ¶
- func GetPublicIPv4() (string, error)
- func GetPublicIPv6() (string, error)
- func HasIPv6Support() bool
- func Run(c Client, interval time.Duration)
- func ValidIPv4(ip string) bool
- func ValidIPv6(ip string) bool
- type Client
- type ClientData
- func (d *ClientData) AddDomain(domain string)
- func (d *ClientData) CheckData() error
- func (d *ClientData) Domains() []string
- func (d *ClientData) IPv4() string
- func (d *ClientData) IPv6() string
- func (d *ClientData) Proxy() bool
- func (d *ClientData) SetDomains(domains []string)
- func (d *ClientData) SetIPv4(val string) error
- func (d *ClientData) SetIPv6(val string) error
- func (d *ClientData) SetProxy(proxy bool)
- type ErrHttpRequestFailed
- type ErrInvalidIP
- type ErrMissingEndpoint
- type ErrMissingToken
- type ErrNoDomain
- type ErrNoIP
- type ErrOperationFailed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { Data() *ClientData Update() error }
type ClientData ¶
type ClientData struct {
// contains filtered or unexported fields
}
ClientData is a struct that contains data needed for all Clients
func NewClientData ¶
func NewClientData(proxy bool) *ClientData
func (*ClientData) AddDomain ¶
func (d *ClientData) AddDomain(domain string)
Add a domain to the list of domains
func (*ClientData) CheckData ¶
func (d *ClientData) CheckData() error
Checks if data contains at least one IP and one domain Returns error otherwise
func (*ClientData) Domains ¶
func (d *ClientData) Domains() []string
func (*ClientData) IPv4 ¶
func (d *ClientData) IPv4() string
func (*ClientData) IPv6 ¶
func (d *ClientData) IPv6() string
func (*ClientData) Proxy ¶
func (d *ClientData) Proxy() bool
func (*ClientData) SetDomains ¶
func (d *ClientData) SetDomains(domains []string)
Set domains to update, overrides previous domains
func (*ClientData) SetIPv4 ¶
func (d *ClientData) SetIPv4(val string) error
Set IPv4 Address to use for creating entries Returns an error if string is neither empty nor a valid IP Address
func (*ClientData) SetIPv6 ¶
func (d *ClientData) SetIPv6(val string) error
Set IPv6 Address to use for creating entries Returns an error if string is neither empty nor a valid IP Address
type ErrHttpRequestFailed ¶
Shows the actual status code, as well as the response body. Shows the error instead if it can't read the response body.
func NewErrHttpRequestFailed ¶
func NewErrHttpRequestFailed(status int, resBody io.ReadCloser) *ErrHttpRequestFailed
func (*ErrHttpRequestFailed) Error ¶
func (e *ErrHttpRequestFailed) Error() string
type ErrInvalidIP ¶
type ErrInvalidIP struct {
IP string
}
func (*ErrInvalidIP) Error ¶
func (e *ErrInvalidIP) Error() string
type ErrMissingEndpoint ¶
type ErrMissingEndpoint struct{}
func (ErrMissingEndpoint) Error ¶
func (e ErrMissingEndpoint) Error() string
type ErrMissingToken ¶
type ErrMissingToken struct{}
func (ErrMissingToken) Error ¶
func (e ErrMissingToken) Error() string
type ErrNoDomain ¶
type ErrNoDomain struct{}
func (ErrNoDomain) Error ¶
func (e ErrNoDomain) Error() string
type ErrOperationFailed ¶
type ErrOperationFailed struct {
Result string
}
Outputs the response received from cloudflare
func NewErrOperationFailed ¶
func NewErrOperationFailed(res io.ReadCloser) *ErrOperationFailed
func (*ErrOperationFailed) Error ¶
func (e *ErrOperationFailed) Error() string
Click to show internal directories.
Click to hide internal directories.