cpanel

package
v4.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse[T any] struct {
	Metadata Metadata `json:"metadata,omitempty"`
	Data     T        `json:"data,omitempty"`

	Status   int      `json:"status,omitempty"`
	Messages []string `json:"messages,omitempty"`
	Warnings []string `json:"warnings,omitempty"`
	Errors   []string `json:"errors,omitempty"`
}

type Client

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

func NewClient

func NewClient(baseURL string, username string, token string) (*Client, error)

func (Client) AddRecord

func (c Client) AddRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error)

AddRecord adds a new record.

add='{"dname":"example", "ttl":14400, "record_type":"TXT", "data":["string1", "string2"]}'

func (Client) DeleteRecord

func (c Client) DeleteRecord(ctx context.Context, serial uint32, domain string, lineIndex int) (*shared.ZoneSerial, error)

DeleteRecord deletes an existing record.

remove=22

func (Client) EditRecord

func (c Client) EditRecord(ctx context.Context, serial uint32, domain string, record shared.Record) (*shared.ZoneSerial, error)

EditRecord edits an existing record.

edit='{"line_index": 9, "dname":"example", "ttl":14400, "record_type":"TXT", "data":["string1", "string2"]}'

func (Client) FetchZoneInformation

func (c Client) FetchZoneInformation(ctx context.Context, domain string) ([]shared.ZoneRecord, error)

FetchZoneInformation fetches zone information. https://api.docs.cpanel.net/openapi/cpanel/operation/dns-parse_zone/

type Metadata

type Metadata struct {
	Transformed int `json:"transformed,omitempty"`
}

Jump to

Keyboard shortcuts

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