internal

package
v4.20.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client the HyperOne client.

func NewClient

func NewClient(apiEndpoint, locationID string, passport *Passport) (*Client, error)

NewClient Creates a new HyperOne client.

func (*Client) CreateRecord

func (c *Client) CreateRecord(ctx context.Context, zoneID, recordsetID, recordContent string) (*Record, error)

CreateRecord creates a record. https://api.hyperone.com/v2/docs#operation/dns_project_zone_recordset_record_create

func (*Client) CreateRecordset

func (c *Client) CreateRecordset(ctx context.Context, zoneID, recordType, name, recordValue string, ttl int) (*Recordset, error)

CreateRecordset creates recordset and record with given value within one request. https://api.hyperone.com/v2/docs#operation/dns_project_zone_recordset_create

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, zoneID, recordsetID, recordID string) error

DeleteRecord deletes a record. https://api.hyperone.com/v2/docs#operation/dns_project_zone_recordset_record_delete

func (*Client) DeleteRecordset

func (c *Client) DeleteRecordset(ctx context.Context, zoneID string, recordsetID string) error

DeleteRecordset deletes a recordset. https://api.hyperone.com/v2/docs#operation/dns_project_zone_recordset_delete

func (*Client) FindRecordset

func (c *Client) FindRecordset(ctx context.Context, zoneID, recordType, name string) (*Recordset, error)

FindRecordset looks for recordset with given recordType and name and returns it. In case if recordset is not found returns nil. https://api.hyperone.com/v2/docs#operation/dns_project_zone_recordset_list

func (*Client) FindZone

func (c *Client) FindZone(ctx context.Context, name string) (*Zone, error)

FindZone looks for DNS Zone and returns nil if it does not exist.

func (*Client) GetRecords

func (c *Client) GetRecords(ctx context.Context, zoneID string, recordsetID string) ([]Record, error)

GetRecords gets all records within specified recordset. https://api.hyperone.com/v2/docs#operation/dns_project_zone_recordset_record_list

func (*Client) GetZones

func (c *Client) GetZones(ctx context.Context) ([]Zone, error)

GetZones gets all user's zones. https://api.hyperone.com/v2/docs#operation/dns_project_zone_list

type Passport

type Passport struct {
	SubjectID     string `json:"subject_id"`
	CertificateID string `json:"certificate_id"`
	Issuer        string `json:"issuer"`
	PrivateKey    string `json:"private_key"`
	PublicKey     string `json:"public_key"`
}

func LoadPassportFile

func LoadPassportFile(location string) (*Passport, error)

func (*Passport) ExtractProjectID

func (passport *Passport) ExtractProjectID() (string, error)

type Payload

type Payload struct {
	IssuedAt int64  `json:"iat"`
	Expiry   int64  `json:"exp"`
	Audience string `json:"aud"`
	Issuer   string `json:"iss"`
	Subject  string `json:"sub"`
}

type Record

type Record struct {
	ID      string `json:"id,omitempty"`
	Content string `json:"content"`
	Enabled bool   `json:"enabled,omitempty"`
}

type Recordset

type Recordset struct {
	RecordType string  `json:"type"`
	Name       string  `json:"name"`
	TTL        int     `json:"ttl,omitempty"`
	ID         string  `json:"id,omitempty"`
	Record     *Record `json:"record,omitempty"`
}

type TokenSigner

type TokenSigner struct {
	PrivateKey string
	KeyID      string
	Audience   string
	Issuer     string
	Subject    string
}

func (*TokenSigner) GetJWT

func (input *TokenSigner) GetJWT() (string, error)

type Zone

type Zone struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	DNSName string `json:"dnsName"`
	FQDN    string `json:"fqdn"`
	URI     string `json:"uri"`
}

Jump to

Keyboard shortcuts

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