internal

package
v4.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Errors []ErrorItem `json:"errors"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

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

Client the API client for Variomedia.

func NewClient

func NewClient(apiToken string) *Client

NewClient creates a new Client.

func (Client) CreateDNSRecord

func (c Client) CreateDNSRecord(ctx context.Context, record DNSRecord) (*CreateDNSRecordResponse, error)

CreateDNSRecord creates a new DNS entry. https://api.variomedia.de/docs/dns-records.html#erstellen

func (Client) DeleteDNSRecord

func (c Client) DeleteDNSRecord(ctx context.Context, id string) (*DeleteRecordResponse, error)

DeleteDNSRecord deletes a DNS record. https://api.variomedia.de/docs/dns-records.html#l%C3%B6schen

func (Client) GetJob

func (c Client) GetJob(ctx context.Context, id string) (*GetJobResponse, error)

GetJob returns a single job based on its ID. https://api.variomedia.de/docs/job-queue.html

type CreateDNSRecordRequest

type CreateDNSRecordRequest struct {
	Data Data `json:"data"`
}

type CreateDNSRecordResponse

type CreateDNSRecordResponse struct {
	Data struct {
		Type       string `json:"type"`
		ID         string `json:"id"`
		Attributes struct {
			Status string `json:"status"`
		} `json:"attributes"`
		Links struct {
			QueueJob  string `json:"queue-job"`
			DNSRecord string `json:"dns-record"`
		} `json:"links"`
	} `json:"data"`
}

type DNSRecord

type DNSRecord struct {
	RecordType string `json:"record_type,omitempty"`
	Name       string `json:"name,omitempty"`
	Domain     string `json:"domain,omitempty"`
	Data       string `json:"data,omitempty"`
	TTL        int    `json:"ttl,omitempty"`
}

type Data

type Data struct {
	Type       string    `json:"type"`
	Attributes DNSRecord `json:"attributes"`
}

type DeleteRecordResponse

type DeleteRecordResponse struct {
	Data struct {
		ID         string `json:"id"`
		Type       string `json:"type"`
		Attributes struct {
			JobType string `json:"job_type"`
			Status  string `json:"status"`
		} `json:"attributes"`
		Links struct {
			Self   string `json:"self"`
			Object string `json:"object"`
		} `json:"links"`
	} `json:"data"`
}

type ErrorItem

type ErrorItem struct {
	Status string `json:"status,omitempty"`
	Title  string `json:"title,omitempty"`
	ID     string `json:"id,omitempty"`
}

type GetJobResponse

type GetJobResponse struct {
	Data struct {
		ID         string `json:"id"`
		Type       string `json:"type"`
		Attributes struct {
			JobType string `json:"job_type"`
			Status  string `json:"status"`
		} `json:"attributes"`
		Links struct {
			Self   string `json:"self"`
			Object string `json:"object"`
		} `json:"links"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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