client

package
v0.0.0-...-b7d42a2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ARecord

type ARecord struct {
	// Name is the record name.
	Name string

	// Address is the IPv4 address of the A record.
	Address string

	//TTL is the Time To Live property of the A record
	TTL int64

	//Label is the metadata label that needs to be added with the A record.
	Label string
}

ARecord is a DNS A record.

type Config

type Config struct {
	// Environment describes the Azure environment: ChinaCloud,
	// USGovernmentCloud, PublicCloud, or AzureStackCloud.  If empty,
	// AzureStackCloud is assumed.
	Environment azure.Environment
	// SubscriptionID is the subscription id for the Azure identity.
	SubscriptionID string
	// ClientID is an Azure application client id.
	ClientID string
	// ClientSecret is an Azure application client secret.  It is required
	// if Azure workload identity is not used.
	ClientSecret string
	// FederatedTokenFile is the path to a file containing a workload
	// identity token.  If FederatedTokenFile is specified and
	// AzureWorkloadIdentityEnabled is true, then Azure workload identity is
	// used instead of using a client secret.
	FederatedTokenFile string
	// TenantID is the Azure tenant ID.
	TenantID string
	// AzureWorkloadIdentityEnabled indicates whether the
	// "AzureWorkloadIdentity" feature gate is enabled.
	AzureWorkloadIdentityEnabled bool
}

type DNSClient

type DNSClient interface {
	Put(ctx context.Context, zone Zone, arec ARecord, metadata map[string]*string) error
	Delete(ctx context.Context, zone Zone, arec ARecord) error
}

func New

func New(config Config, userAgentExtension string) (DNSClient, error)

New returns an authenticated DNSClient

type FakeDNSClient

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

func NewFake

func NewFake(config Config) (*FakeDNSClient, error)

func (*FakeDNSClient) Delete

func (c *FakeDNSClient) Delete(ctx context.Context, zone Zone, arec ARecord) error

func (*FakeDNSClient) Put

func (c *FakeDNSClient) Put(ctx context.Context, zone Zone, arec ARecord, metadata map[string]*string) error

func (*FakeDNSClient) RecordedCall

func (c *FakeDNSClient) RecordedCall(rg, zone, rel string) (string, bool)

type Zone

type Zone struct {
	SubscriptionID string
	ResourceGroup  string
	Provider       string
	Name           string
}

func ParseZone

func ParseZone(id string) (*Zone, error)

Jump to

Keyboard shortcuts

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