Documentation
¶
Index ¶
Constants ¶
View Source
const (
InvalidConfigCode = 40402
)
Variables ¶
This section is empty.
Functions ¶
func ParseRawUID ¶ added in v1.3.0
ParseRawUID parse the input raw UID, returning real UID and ClientID. The raw UID can have 2 forms:
- <uid> - <uid>/<client_id>
func SendLogs ¶ added in v1.4.0
func SendLogs(lr *LogsRequest, cdDev bool) error
SendLogs sends runtime log to ControlD API.
Types ¶
type ErrorResponse ¶ added in v1.4.0
type ErrorResponse struct {
ErrorField struct {
Message string `json:"message"`
Code int `json:"code"`
} `json:"error"`
}
func (ErrorResponse) Error ¶ added in v1.4.0
func (u ErrorResponse) Error() string
type LogsRequest ¶ added in v1.4.0
type LogsRequest struct {
UID string `json:"uid"`
Data io.ReadCloser `json:"-"`
}
LogsRequest contains request data for sending runtime logs to API.
type ResolverConfig ¶
type ResolverConfig struct {
DOH string `json:"doh"`
Ctrld struct {
CustomConfig string `json:"custom_config"`
CustomLastUpdate int64 `json:"custom_last_update"`
VersionTarget string `json:"version_target"`
} `json:"ctrld"`
Exclude []string `json:"exclude"`
UID string `json:"uid"`
DeactivationPin *int64 `json:"deactivation_pin,omitempty"`
}
ResolverConfig represents Control D resolver data.
func FetchResolverConfig ¶
func FetchResolverConfig(rawUID, version string, cdDev bool) (*ResolverConfig, error)
FetchResolverConfig fetch Control D config for given uid.
func FetchResolverUID ¶ added in v1.3.0
func FetchResolverUID(req *UtilityOrgRequest, version string, cdDev bool) (*ResolverConfig, error)
FetchResolverUID fetch resolver uid from provision token.
func UpdateCustomLastFailed ¶ added in v1.3.8
func UpdateCustomLastFailed(rawUID, version string, cdDev, lastUpdatedFailed bool) (*ResolverConfig, error)
UpdateCustomLastFailed calls API to mark custom config is bad.
type UtilityOrgRequest ¶ added in v1.3.10
type UtilityOrgRequest struct {
ProvToken string `json:"prov_token"`
Hostname string `json:"hostname"`
}
UtilityOrgRequest contains request data for calling Org API.
Click to show internal directories.
Click to hide internal directories.