internal

package
v4.31.0-extended.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 14 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 {
	Status   string            `json:"status"`
	ErrorMsg string            `json:"error"`
	Code     int               `json:"code"`
	Context  map[string]string `json:"context"`
}

func (*APIError) Error

func (a *APIError) Error() string

type Auth

type Auth struct {
	Successful bool `json:"successful"`
}

type Client

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

Client the Gravity API client.

func NewClient

func NewClient(serverURL, username, password string) (*Client, error)

NewClient creates a new Client.

func (*Client) CreateDNSRecord

func (c *Client) CreateDNSRecord(ctx context.Context, zone string, record Record) error

func (*Client) DeleteDNSRecord

func (c *Client) DeleteDNSRecord(ctx context.Context, zone string, record Record) error

func (*Client) GetDNSZones

func (c *Client) GetDNSZones(ctx context.Context, name string) ([]Zone, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context) (*Auth, error)

func (*Client) Me

func (c *Client) Me(ctx context.Context) (*UserInfo, error)

type HandlerConfig

type HandlerConfig struct {
	Type     string   `json:"type"`
	CacheTTL int      `json:"cache_ttl,omitempty"`
	To       []string `json:"to,omitempty"`
}

type Login

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

type Permission

type Permission struct {
	Methods []string `json:"methods"`
	Path    string   `json:"path"`
}

type Record

type Record struct {
	Data         string `json:"data,omitempty"`
	Fqdn         string `json:"fqdn,omitempty"`
	Hostname     string `json:"hostname,omitempty"`
	MxPreference int    `json:"mxPreference,omitempty"`
	SrvPort      int    `json:"srvPort,omitempty"`
	SrvPriority  int    `json:"srvPriority,omitempty"`
	SrvWeight    int    `json:"srvWeight,omitempty"`
	Type         string `json:"type,omitempty"`
	UID          string `json:"uid,omitempty"`
}

type UserInfo

type UserInfo struct {
	Username      string       `json:"username"`
	Authenticated bool         `json:"authenticated"`
	Permissions   []Permission `json:"permissions"`
}

type Zone

type Zone struct {
	Name           string          `json:"name"`
	HandlerConfigs []HandlerConfig `json:"handlerConfigs"`
	DefaultTTL     int             `json:"defaultTTL"`
	Authoritative  bool            `json:"authoritative"`
	Hook           string          `json:"hook"`
	RecordCount    int             `json:"recordCount"`
}

type Zones

type Zones struct {
	Zones []Zone `json:"zones"`
}

Jump to

Keyboard shortcuts

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