internal

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: MIT Imports: 8 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 struct {
	Result string `json:"result"`

	Answer *Answer `json:"answer,omitempty"`

	ErrorCode string `json:"error_code,omitempty"`
	ErrorText string `json:"error_text,omitempty"`
}

APIResponse is the representation of an API response.

func (APIResponse) Error

func (a APIResponse) Error() string

func (APIResponse) HasError

func (a APIResponse) HasError() error

HasError returns an error is the response contains an error.

type AddTxtRequest

type AddTxtRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`

	Domains           []Domain `json:"domains,omitempty"`
	SubDomain         string   `json:"subdomain,omitempty"`
	Text              string   `json:"text,omitempty"`
	OutputContentType string   `json:"output_content_type,omitempty"`
}

AddTxtRequest is the representation of the payload of a request to add a TXT record.

type Answer

type Answer struct {
	Domains []DomainResponse `json:"domains,omitempty"`
}

Answer is the representation of an API response answer.

type Client

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

Client the reg.ru client.

func NewClient

func NewClient(username, password string) *Client

NewClient Creates a reg.ru client.

func (Client) AddTXTRecord

func (c Client) AddTXTRecord(ctx context.Context, domain, subDomain, content string) error

AddTXTRecord adds a TXT record. https://www.reg.ru/support/help/api2#zone_add_txt

func (Client) RemoveTxtRecord

func (c Client) RemoveTxtRecord(ctx context.Context, domain, subDomain, content string) error

RemoveTxtRecord removes a TXT record. https://www.reg.ru/support/help/api2#zone_remove_record

type Domain

type Domain struct {
	DName string `json:"dname"`
}

Domain is the representation of a Domain.

type DomainResponse

type DomainResponse struct {
	Result string `json:"result"`

	DName string `json:"dname"`

	ErrorCode string `json:"error_code,omitempty"`
	ErrorText string `json:"error_text,omitempty"`
}

DomainResponse is the representation of an API response answer domain.

func (DomainResponse) Error

func (d DomainResponse) Error() string

type RemoveRecordRequest

type RemoveRecordRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`

	Domains           []Domain `json:"domains,omitempty"`
	SubDomain         string   `json:"subdomain,omitempty"`
	Content           string   `json:"content,omitempty"`
	RecordType        string   `json:"record_type,omitempty"`
	OutputContentType string   `json:"output_content_type,omitempty"`
}

RemoveRecordRequest is the representation of the payload of a request to remove a record.

Jump to

Keyboard shortcuts

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