internal

package
v4.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext added in v4.12.0

func WithContext(ctx context.Context, credential string) context.Context

Types

type AddDNSSettingsAPIResponse

type AddDNSSettingsAPIResponse struct {
	Response AddDNSSettingsResponse `json:"Response" mapstructure:"Response"`
}

type AddDNSSettingsResponse

type AddDNSSettingsResponse struct {
	KasFloodDelay float64 `json:"KasFloodDelay" mapstructure:"KasFloodDelay"`
	ReturnInfo    string  `json:"ReturnInfo" mapstructure:"ReturnInfo"`
	ReturnString  string  `json:"ReturnString" mapstructure:"ReturnString"`
}

type AuthRequest

type AuthRequest struct {
	Login                 string `json:"kas_login,omitempty"`
	AuthData              string `json:"kas_auth_data,omitempty"`
	AuthType              string `json:"kas_auth_type,omitempty"`
	SessionLifetime       int    `json:"session_lifetime,omitempty"`
	SessionUpdateLifetime string `json:"session_update_lifetime,omitempty"`
}

type Authentication added in v4.12.0

type Authentication interface {
	Authentication(ctx context.Context, sessionLifetime int, sessionUpdateLifetime bool) (string, error)
}

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client a KAS server client.

func NewClient

func NewClient(login string) *Client

NewClient creates a new Client.

func (*Client) AddDNSSettings

func (c *Client) AddDNSSettings(ctx context.Context, record DNSRequest) (string, error)

AddDNSSettings Creation of a DNS resource record.

func (*Client) DeleteDNSSettings

func (c *Client) DeleteDNSSettings(ctx context.Context, recordID string) (bool, error)

DeleteDNSSettings Deleting a DNS Resource Record.

func (*Client) GetDNSSettings

func (c *Client) GetDNSSettings(ctx context.Context, zone, recordID string) ([]ReturnInfo, error)

GetDNSSettings Reading out the DNS settings of a zone. - zone: host zone. - recordID: the ID of the resource record (optional).

type DNSRequest

type DNSRequest struct {
	// ZoneHost the zone in question (must be a FQDN).
	ZoneHost string `json:"zone_host"`
	// RecordType the TYPE of the resource record (MX, A, AAAA etc.).
	RecordType string `json:"record_type"`
	// RecordName the NAME of the resource record.
	RecordName string `json:"record_name"`
	// RecordData the DATA of the resource record.
	RecordData string `json:"record_data"`
	// RecordAux the AUX of the resource record.
	RecordAux int `json:"record_aux"`
}

type DeleteDNSSettingsAPIResponse

type DeleteDNSSettingsAPIResponse struct {
	Response DeleteDNSSettingsResponse `json:"Response"`
}

type DeleteDNSSettingsResponse

type DeleteDNSSettingsResponse struct {
	KasFloodDelay float64 `json:"KasFloodDelay"`
	ReturnInfo    bool    `json:"ReturnInfo"`
	ReturnString  string  `json:"ReturnString"`
}

type Fault

type Fault struct {
	Code    string `xml:"faultcode"`
	Message string `xml:"faultstring"`
	Actor   string `xml:"faultactor"`
}

Fault a SOAP fault.

func (Fault) Error

func (f Fault) Error() string

type GetDNSSettingsAPIResponse

type GetDNSSettingsAPIResponse struct {
	Response GetDNSSettingsResponse `json:"Response" mapstructure:"Response"`
}

type GetDNSSettingsResponse

type GetDNSSettingsResponse struct {
	KasFloodDelay float64      `json:"KasFloodDelay" mapstructure:"KasFloodDelay"`
	ReturnInfo    []ReturnInfo `json:"ReturnInfo" mapstructure:"ReturnInfo"`
	ReturnString  string       `json:"ReturnString"`
}

type Identifier added in v4.12.0

type Identifier struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Identifier generates credential tokens.

func NewIdentifier added in v4.12.0

func NewIdentifier(login string, password string) *Identifier

NewIdentifier creates a new Identifier.

func (*Identifier) Authentication added in v4.12.0

func (c *Identifier) Authentication(ctx context.Context, sessionLifetime int, sessionUpdateLifetime bool) (string, error)

Authentication Creates a credential token. - sessionLifetime: Validity of the token in seconds. - sessionUpdateLifetime: with `true` the session is extended with every request.

type Item

type Item struct {
	Text  string  `xml:",chardata" json:"text,omitempty"`
	Type  string  `xml:"type,attr" json:"type,omitempty"`
	Raw   string  `xml:"nil,attr" json:"raw,omitempty"`
	Key   *Item   `xml:"key" json:"key,omitempty"`
	Value *Item   `xml:"value" json:"value,omitempty"`
	Items []*Item `xml:"item" json:"item,omitempty"`
}

Item an item of the KAS SOAP response.

type KasAPIBody

type KasAPIBody struct {
	KasAPIResponse *KasResponse `xml:"KasApiResponse"`
	Fault          *Fault       `xml:"Fault"`
}

type KasAPIResponseEnvelope

type KasAPIResponseEnvelope struct {
	XMLName xml.Name   `xml:"Envelope"`
	Body    KasAPIBody `xml:"Body"`
}

KasAPIResponseEnvelope a KAS envelope of the API response.

type KasAuthBody

type KasAuthBody struct {
	KasAuthResponse *KasResponse `xml:"KasAuthResponse"`
	Fault           *Fault       `xml:"Fault"`
}

type KasAuthEnvelope

type KasAuthEnvelope struct {
	XMLName xml.Name    `xml:"Envelope"`
	Body    KasAuthBody `xml:"Body"`
}

KasAuthEnvelope a KAS envelope of the authentication response.

type KasRequest

type KasRequest struct {
	// Login the relevant KAS login.
	Login string `json:"kas_login,omitempty"`
	// AuthType the authentication type.
	AuthType string `json:"kas_auth_type,omitempty"`
	// AuthData the authentication data.
	AuthData string `json:"kas_auth_data,omitempty"`
	// Action API function.
	Action string `json:"kas_action,omitempty"`
	// RequestParams Parameters to the API function.
	RequestParams any `json:"KasRequestParams,omitempty"`
}

type KasResponse

type KasResponse struct {
	Return *Item `xml:"return"`
}

KasResponse a KAS SOAP response.

type ReturnInfo

type ReturnInfo struct {
	ID         any    `json:"record_id,omitempty" mapstructure:"record_id"`
	Zone       string `json:"record_zone,omitempty" mapstructure:"record_zone"`
	Name       string `json:"record_name,omitempty" mapstructure:"record_name"`
	Type       string `json:"record_type,omitempty" mapstructure:"record_type"`
	Data       string `json:"record_data,omitempty" mapstructure:"record_data"`
	Changeable string `json:"record_changeable,omitempty" mapstructure:"record_changeable"`
	Aux        int    `json:"record_aux,omitempty" mapstructure:"record_aux"`
}

type Trimmer

type Trimmer struct {
	// contains filtered or unexported fields
}

Trimmer trim all XML fields.

func (Trimmer) Token

func (tr Trimmer) Token() (xml.Token, error)

Jump to

Keyboard shortcuts

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