ns1

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NS1Config

type NS1Config struct {
	DomainFilter  endpoint.DomainFilter
	ZoneIDFilter  provider.ZoneIDFilter
	NS1Endpoint   string
	NS1IgnoreSSL  bool
	DryRun        bool
	MinTTLSeconds int
}

NS1Config passes cli args to the NS1Provider

type NS1DomainClient

type NS1DomainClient interface {
	CreateRecord(r *dns.Record) (*http.Response, error)
	DeleteRecord(zone string, domain string, t string) (*http.Response, error)
	UpdateRecord(r *dns.Record) (*http.Response, error)
	GetZone(zone string) (*dns.Zone, *http.Response, error)
	ListZones() ([]*dns.Zone, *http.Response, error)
}

NS1DomainClient is a subset of the NS1 API the the provider uses, to ease testing

type NS1DomainService

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

NS1DomainService wraps the API and fulfills the NS1DomainClient interface

func (NS1DomainService) CreateRecord

func (n NS1DomainService) CreateRecord(r *dns.Record) (*http.Response, error)

CreateRecord wraps the Create method of the API's Record service

func (NS1DomainService) DeleteRecord

func (n NS1DomainService) DeleteRecord(zone string, domain string, t string) (*http.Response, error)

DeleteRecord wraps the Delete method of the API's Record service

func (NS1DomainService) GetZone

func (n NS1DomainService) GetZone(zone string) (*dns.Zone, *http.Response, error)

GetZone wraps the Get method of the API's Zones service

func (NS1DomainService) ListZones

func (n NS1DomainService) ListZones() ([]*dns.Zone, *http.Response, error)

ListZones wraps the List method of the API's Zones service

func (NS1DomainService) UpdateRecord

func (n NS1DomainService) UpdateRecord(r *dns.Record) (*http.Response, error)

UpdateRecord wraps the Update method of the API's Record service

type NS1Provider

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

NS1Provider is the NS1 provider

func NewNS1Provider

func NewNS1Provider(config NS1Config) (*NS1Provider, error)

NewNS1Provider creates a new NS1 Provider

func (*NS1Provider) ApplyChanges

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

ApplyChanges applies a given set of changes in a given zone.

func (*NS1Provider) Records

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

Records returns the endpoints this provider knows about

Jump to

Keyboard shortcuts

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