anexia

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterZonesByDomainName added in v0.2.1

func FilterZonesByDomainName(zones []*anxcloudDns.Zone, domainName string) []*anxcloudDns.Zone

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, record *anxcloudDns.Record) error

func (*DNSClient) DeleteRecord

func (c *DNSClient) DeleteRecord(ctx context.Context, record *anxcloudDns.Record) 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)

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)
	DeleteRecord(ctx context.Context, record *anxcloudDns.Record) error
	CreateRecord(ctx context.Context, 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
JackTT - Gopher 🇻🇳