internal

package
v4.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 12 Imported by: 0

README

There is an official API client but this client is completely broken:

  • the code is generated and the module name is github.com/GIT_USER_ID/GIT_REPO_ID
  • the code contains redeclared constants
  • Even with fixes to the module name and the redeclared constants, the module doesn't compile.

https://github.com/timeweb-cloud/sdk-go/pull/1

So, for now, this API client is unusable.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OAuthStaticAccessToken

func OAuthStaticAccessToken(client *http.Client, accessToken string) *http.Client

Types

type Client

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

Client Timeweb Cloud client.

func NewClient

func NewClient(hc *http.Client) *Client

NewClient creates a Client.

func (*Client) CreateRecord

func (c *Client) CreateRecord(ctx context.Context, zone string, record DNSRecord) (*DNSRecord, error)

CreateRecord creates a DNS record. https://timeweb.cloud/api-docs#tag/Domeny/operation/createDomainDNSRecord

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, zone string, recordID int) error

DeleteRecord deletes a DNS record. https://timeweb.cloud/api-docs#tag/Domeny/operation/deleteDomainDNSRecord

type CreateRecordResponse

type CreateRecordResponse struct {
	DNSRecord *DNSRecord `json:"dns_record,omitempty"`
}

type DNSRecord

type DNSRecord struct {
	ID        int    `json:"id,omitempty"`
	Type      string `json:"type,omitempty"`
	Value     string `json:"value,omitempty"`
	SubDomain string `json:"subdomain,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	StatusCode int    `json:"status_code,omitempty"`
	ErrorCode  string `json:"error_code,omitempty"`
	Message    string `json:"message,omitempty"`
	ResponseID string `json:"response_id,omitempty"`
}

func (ErrorResponse) Error

func (a ErrorResponse) Error() string

Jump to

Keyboard shortcuts

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