Documentation ¶
Index ¶
- func NewClient(c Config, hc *http.Client) (*cloudflare.API, error)
- func ToBool(in interface{}) *bool
- func ToNumber(in interface{}) *int64
- func ToOptionalString(in interface{}) *string
- func ToString(in interface{}) *string
- func ToStringSlice(in interface{}) []string
- type AuthByAPIKey
- type AuthByAPIToken
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToBool ¶
func ToBool(in interface{}) *bool
ToBool converts an interface from the Cloudflare API into a bool pointer, if it contains an existing bool or bool pointer.
func ToNumber ¶
func ToNumber(in interface{}) *int64
ToNumber converts an interface from the Cloudflare API into an int64 pointer, if it contains an existing int, int64 or float64 value.
func ToOptionalString ¶
func ToOptionalString(in interface{}) *string
ToOptionalString converts an interface from the Cloudflare API into a string pointer, if it contains an existing string or string pointer. If the existing string is empty (""), it returns nil.
func ToString ¶
func ToString(in interface{}) *string
ToString converts an interface from the Cloudflare API into a string pointer, if it contains an existing string.
func ToStringSlice ¶
func ToStringSlice(in interface{}) []string
ToStringSlice converts an interface from the Cloudflare API into a string slice.
Types ¶
type AuthByAPIKey ¶
type AuthByAPIKey struct { Key *string `json:"apiKey,omitempty"` Email *string `json:"email,omitempty"` }
AuthByAPIKey represents the details required to authenticate with the cloudflare API using a users' global API Key and Email address.
type AuthByAPIToken ¶
type AuthByAPIToken struct {
Token *string `json:"token,omitempty"`
}
AuthByAPIToken represents the details required to authenticate with the cloudflare API using an API token.
type Config ¶
type Config struct { *AuthByAPIKey `json:",inline"` *AuthByAPIToken `json:",inline"` }
Config represents the API configuration required to create a new client.
func UseProviderConfig ¶
UseProviderConfig produces a config that can be used to authenticate with Cloudflare.