controld

package
v1.3.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidConfigCode = 40402
)

Variables

This section is empty.

Functions

func ParseRawUID added in v1.3.0

func ParseRawUID(rawUID string) (string, string)

ParseRawUID parse the input raw UID, returning real UID and ClientID. The raw UID can have 2 forms:

- <uid> - <uid>/<client_id>

Types

type ResolverConfig

type ResolverConfig struct {
	DOH   string `json:"doh"`
	Ctrld struct {
		CustomConfig     string `json:"custom_config"`
		CustomLastUpdate int64  `json:"custom_last_update"`
	} `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 UtilityErrorResponse

type UtilityErrorResponse struct {
	ErrorField struct {
		Message string `json:"message"`
		Code    int    `json:"code"`
	} `json:"error"`
}

func (UtilityErrorResponse) Error

func (u UtilityErrorResponse) Error() string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL