anexia

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCreateDeleteSetsFromChanges

func GetCreateDeleteSetsFromChanges(changes *plan.Changes) ([]*endpoint.Endpoint, []*endpoint.Endpoint)

Types

type Configuration

type Configuration struct {
	APIToken       string `env:"ANEXIA_API_TOKEN,notEmpty"`
	APIEndpointURL string `env:"ANEXIA_API_URL"`
	DryRun         bool   `env:"DRY_RUN" envDefault:"false"`
}

Configuration holds configuration from environmental variables

func Init

func Init() Configuration

Init sets up configuration by reading set environmental variables

type DNSClient

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

func (*DNSClient) CreateRecord

func (c *DNSClient) CreateRecord(ctx context.Context, _ string, record *anxcloudDns.Record) error

func (*DNSClient) DeleteRecord

func (c *DNSClient) DeleteRecord(ctx context.Context, zoneName, recordID string) error

func (*DNSClient) GetRecords

func (c *DNSClient) GetRecords(ctx context.Context) ([]*anxcloudDns.Record, error)

func (*DNSClient) GetRecordsByZoneNameAndName

func (c *DNSClient) GetRecordsByZoneNameAndName(ctx context.Context, zoneName, name string) ([]*anxcloudDns.Record, error)

func (*DNSClient) GetZones

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

func (*DNSClient) GetZonesByDomainName

func (c *DNSClient) GetZonesByDomainName(ctx context.Context, domainName string) ([]*anxcloudDns.Zone, error)

type DNSService

type DNSService interface {
	GetZones(ctx context.Context) ([]*anxcloudDns.Zone, error)
	GetRecords(ctx context.Context) ([]*anxcloudDns.Record, error)
	GetRecordsByZoneNameAndName(ctx context.Context, zoneName, name string) ([]*anxcloudDns.Record, error)
	GetZonesByDomainName(ctx context.Context, domainName string) ([]*anxcloudDns.Zone, error)
	DeleteRecord(ctx context.Context, zoneName, recordID string) error
	CreateRecord(ctx context.Context, zoneName string, record *anxcloudDns.Record) error
}

type Provider

type Provider struct {
	provider.BaseProvider
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(configuration *Configuration, domainFilter endpoint.DomainFilter) (*Provider, error)

NewProvider returns an instance of new provider

func (*Provider) ApplyChanges

func (p *Provider) ApplyChanges(ctx context.Context, changes *plan.Changes) error

func (*Provider) Records

func (p *Provider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)

Jump to

Keyboard shortcuts

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