Documentation ¶
Index ¶
- Constants
- type APIResponse
- type Client
- func (c *Client) CreateAuthenticatedContext(ctx context.Context) (context.Context, error)
- func (c *Client) CreateRecord(ctx context.Context, zoneID string, record Record) (*Record, error)
- func (c *Client) DeleteRecord(ctx context.Context, zoneID, name, recordType string) error
- func (c *Client) GetRecords(ctx context.Context, zoneID string) ([]Record, error)
- func (c *Client) GetZones(ctx context.Context, parentID string) ([]Zone, error)
- type Record
- type Token
- type Zone
Constants ¶
View Source
const ( APIBaseURL = "https://console.cloud.ru/api/clouddns/v1" AuthBaseURL = "https://auth.iam.cloud.ru/auth/system/openid/token" )
Default API endpoints.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse[T any] struct { Items []T `json:"items"` }
type Client ¶
type Client struct { APIEndpoint *url.URL AuthEndpoint *url.URL HTTPClient *http.Client // contains filtered or unexported fields }
Client the Cloud.ru API client.
func (*Client) CreateAuthenticatedContext ¶
func (*Client) CreateRecord ¶
func (*Client) DeleteRecord ¶
func (*Client) GetRecords ¶
type Token ¶
type Token struct { // The bearer token for use in API requests AccessToken string `json:"access_token"` TokenID string `json:"id_token"` TokenType string `json:"token_type"` // Number in seconds before the expiration ExpiresIn int `json:"expires_in"` NotBeforePolicy int `json:"not-before-policy"` Scope string `json:"scope"` Deadline time.Time `json:"-"` }
type Zone ¶
type Zone struct { ID string `json:"id,omitempty"` ParentID string `json:"parent_id,omitempty"` Name string `json:"name,omitempty"` Valid bool `json:"valid,omitempty"` ValidationText string `json:"validationText,omitempty"` Delegated bool `json:"delegated,omitempty"` LastCheck time.Time `json:"lastCheck,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
Click to show internal directories.
Click to hide internal directories.