Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetVersion ¶
func SetVersion(v string)
SetVersion sets the version shown by --version. Release builds pass it in via -ldflags; `go install pkg@vX.Y.Z` builds fall back to the module version.
Types ¶
type AuthStatus ¶
type AuthStatus struct {
Authenticated bool `json:"authenticated"`
TokenSource string `json:"token_source,omitempty"`
TokenPath string `json:"token_path"`
ConfigPath string `json:"config_path"`
AccountID string `json:"account_id,omitempty"`
AccountName string `json:"account_name,omitempty"`
// TokenType is "user" or "account" ("" if unknown without --verify).
TokenType string `json:"token_type,omitempty"`
// Verified/TokenStatus are only set with --verify.
Verified *bool `json:"verified,omitempty"`
TokenStatus string `json:"token_status,omitempty"`
}
AuthStatus is what `auth status --json` prints. It never includes the token.
type AutoRenewStatus ¶
type AutoRenewStatus struct {
Domain string `json:"domain"`
State string `json:"state,omitempty"`
AutoRenew bool `json:"auto_renew"`
ExpiresAt string `json:"expires_at,omitempty"`
Changed *bool `json:"changed,omitempty"`
// Pending is set when Cloudflare accepted the change but is still applying it.
Pending bool `json:"pending,omitempty"`
}
AutoRenewStatus is the result of an auto-renew query or change.
type LoginResult ¶
type LoginResult struct {
Authenticated bool `json:"authenticated"`
TokenID string `json:"token_id"`
TokenStatus string `json:"token_status"`
TokenType string `json:"token_type"`
AccountID string `json:"account_id"`
AccountName string `json:"account_name"`
TokenPath string `json:"token_path"`
ConfigPath string `json:"config_path"`
}
LoginResult is what `auth login --json` prints. It never includes the token.
type Record ¶
type Record struct {
ID string `json:"id"`
Zone string `json:"zone"`
Type string `json:"type"`
Name string `json:"name"`
Content string `json:"content"`
TTL int64 `json:"ttl"` // 1 = automatic
Proxied bool `json:"proxied"`
Proxiable bool `json:"proxiable"`
Priority *int64 `json:"priority,omitempty"`
Comment string `json:"comment,omitempty"`
CreatedOn string `json:"created_on,omitempty"`
ModifiedOn string `json:"modified_on,omitempty"`
}
Record is cfctl's stable JSON shape for a DNS record.
type Whoami ¶
type Whoami struct {
Token struct {
ID string `json:"id"`
Status string `json:"status"`
Type string `json:"type"` // "user" or "account"
ExpiresOn string `json:"expires_on,omitempty"`
} `json:"token"`
Account struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
} `json:"account"`
// User is only filled in if the token has User Details: Read.
User *struct {
ID string `json:"id"`
Email string `json:"email"`
} `json:"user,omitempty"`
}
Whoami is the identity behind the current token.