internal

package
v4.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIdentityURL = "https://identity.api.rackspacecloud.com/v2.0/tokens"

DefaultIdentityURL represents the Identity API endpoint to call.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyCredentials

type APIKeyCredentials struct {
	Username string `json:"username"`
	APIKey   string `json:"apiKey"`
}

APIKeyCredentials api structure.

type Access

type Access struct {
	Token          Token            `json:"token"`
	ServiceCatalog []ServiceCatalog `json:"serviceCatalog"`
	User           User             `json:"user"`
}

Access api structure.

type Auth

type Auth struct {
	APIKeyCredentials `json:"RAX-KSKEY:apiKeyCredentials"`
}

Auth api structure.

type AuthData

type AuthData struct {
	Auth `json:"auth"`
}

AuthData api structure.

type Client

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

func NewClient

func NewClient(endpoint string, token string) (*Client, error)

func (*Client) AddRecord

func (c *Client) AddRecord(ctx context.Context, zoneID string, record Record) error

AddRecord Adds one record to a specified domain. https://docs.rackspace.com/docs/cloud-dns/v1/api-reference/records#add-records

func (*Client) DeleteRecord

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

DeleteRecord Deletes a record from the domain. https://docs.rackspace.com/docs/cloud-dns/v1/api-reference/records#delete-records

func (*Client) FindTxtRecord

func (c *Client) FindTxtRecord(ctx context.Context, fqdn string, zoneID string) (*Record, error)

FindTxtRecord searches a DNS zone for a TXT record with a specific name.

func (*Client) GetHostedZoneID

func (c *Client) GetHostedZoneID(ctx context.Context, fqdn string) (string, error)

GetHostedZoneID performs a lookup to get the DNS zone which needs modifying for a given FQDN.

type Endpoint

type Endpoint struct {
	PublicURL   string `json:"publicURL"`
	Region      string `json:"region,omitempty"`
	TenantID    string `json:"tenantId"`
	InternalURL string `json:"internalURL,omitempty"`
}

Endpoint api structure.

type HostedZone

type HostedZone struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

HostedZone api structure.

type Identifier

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

func NewIdentifier

func NewIdentifier(httpClient *http.Client, baseURL string) *Identifier

NewIdentifier creates a new Identifier.

func (*Identifier) Login

func (a *Identifier) Login(ctx context.Context, apiUser, apiKey string) (*Identity, error)

Login sends an authentication request. https://docs.rackspace.com/docs/cloud-dns/v1/getting-started/authenticate

type Identity

type Identity struct {
	Access Access `json:"access"`
}

Identity api structure.

type Record

type Record struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Data string `json:"data"`
	TTL  int    `json:"ttl,omitempty"`
	ID   string `json:"id,omitempty"`
}

Record represents a Rackspace DNS record.

type Records

type Records struct {
	TotalEntries int      `json:"totalEntries,omitempty"`
	Records      []Record `json:"records,omitempty"`
}

Records is the list of records sent/received from the DNS API.

type Role

type Role struct {
	Description string `json:"description"`
	ID          string `json:"id"`
	Name        string `json:"name"`
	TenantID    string `json:"tenantId,omitempty"`
}

type ServiceCatalog

type ServiceCatalog struct {
	Name      string     `json:"name"`
	Type      string     `json:"type"`
	Endpoints []Endpoint `json:"endpoints"`
}

ServiceCatalog service catalog.

type Tenant

type Tenant struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Token

type Token struct {
	ID                     string   `json:"id"`
	Expires                string   `json:"expires"`
	Tenant                 Tenant   `json:"tenant"`
	RAXAUTHAuthenticatedBy []string `json:"RAX-AUTH:authenticatedBy"`
}

Token api structure.

type User

type User struct {
	ID                   string `json:"id"`
	Roles                []Role `json:"roles"`
	Name                 string `json:"name"`
	RAXAUTHDefaultRegion string `json:"RAX-AUTH:defaultRegion"`
}

type ZoneSearchResponse

type ZoneSearchResponse struct {
	TotalEntries int          `json:"totalEntries"`
	HostedZones  []HostedZone `json:"domains"`
}

ZoneSearchResponse represents the response when querying Rackspace DNS zones.

Jump to

Keyboard shortcuts

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