Documentation ¶
Index ¶
- Variables
- type InMemoryClient
- func (c *InMemoryClient) ApplyChanges(ctx context.Context, zoneID string, changes *plan.Changes) error
- func (c *InMemoryClient) CreateZone(zone string) error
- func (c *InMemoryClient) DeleteZone(zone string) error
- func (c *InMemoryClient) GetZone(zone string) (Zone, error)
- func (c *InMemoryClient) Records(zone string) ([]*endpoint.Endpoint, error)
- func (c *InMemoryClient) Zones() map[string]string
- type InMemoryOption
- type InMemoryProvider
- func (im *InMemoryProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error
- func (im *InMemoryProvider) CreateZone(newZone string) error
- func (im *InMemoryProvider) DeleteZone(zone string) error
- func (im *InMemoryProvider) GetZone(zone string) (Zone, error)
- func (im *InMemoryProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)
- func (im *InMemoryProvider) Zones() map[string]string
- type Zone
Constants ¶
This section is empty.
Variables ¶
var ( // ErrZoneAlreadyExists error returned when Zone cannot be created when it already exists ErrZoneAlreadyExists = errors.New("specified Zone already exists") // ErrZoneNotFound error returned when specified Zone does not exists ErrZoneNotFound = errors.New("specified Zone not found") // ErrRecordAlreadyExists when create request is sent but record already exists ErrRecordAlreadyExists = errors.New("record already exists") // ErrRecordNotFound when update/delete request is sent but record not found ErrRecordNotFound = errors.New("record not found") // ErrDuplicateRecordFound when record is repeated in create/update/delete ErrDuplicateRecordFound = errors.New("invalid batch request") )
Functions ¶
This section is empty.
Types ¶
type InMemoryClient ¶
func NewInMemoryClient ¶
func NewInMemoryClient() *InMemoryClient
func (*InMemoryClient) ApplyChanges ¶
func (*InMemoryClient) CreateZone ¶
func (c *InMemoryClient) CreateZone(zone string) error
func (*InMemoryClient) DeleteZone ¶
func (c *InMemoryClient) DeleteZone(zone string) error
func (*InMemoryClient) GetZone ¶ added in v0.3.0
func (c *InMemoryClient) GetZone(zone string) (Zone, error)
func (*InMemoryClient) Records ¶
func (c *InMemoryClient) Records(zone string) ([]*endpoint.Endpoint, error)
func (*InMemoryClient) Zones ¶
func (c *InMemoryClient) Zones() map[string]string
type InMemoryOption ¶
type InMemoryOption func(*InMemoryProvider)
InMemoryOption allows to extend in-memory provider
func InMemoryInitZones ¶
func InMemoryInitZones(zones []string) InMemoryOption
InMemoryInitZones pre-seeds the InMemoryProvider with given zones
func InMemoryWithClient ¶
func InMemoryWithClient(memoryClient *InMemoryClient) InMemoryOption
InMemoryWithClient modifies the client which the provider will use
func InMemoryWithDomain ¶
func InMemoryWithDomain(domainFilter endpoint.DomainFilter) InMemoryOption
InMemoryWithDomain modifies the domain on which dns zones are filtered
func InMemoryWithLogging ¶
func InMemoryWithLogging() InMemoryOption
InMemoryWithLogging injects logging when ApplyChanges is called
type InMemoryProvider ¶
type InMemoryProvider struct { provider.BaseProvider OnApplyChanges func(ctx context.Context, changes *plan.Changes) OnRecords func() // contains filtered or unexported fields }
InMemoryProvider - dns provider only used for testing purposes initialized as dns provider with no records
func NewInMemoryProvider ¶
func NewInMemoryProvider(ctx context.Context, opts ...InMemoryOption) *InMemoryProvider
NewInMemoryProvider returns InMemoryProvider DNS provider interface implementation
func (*InMemoryProvider) ApplyChanges ¶
ApplyChanges simply modifies records in memory error checking occurs before any modifications are made, i.e. batch processing create record - record should not exist update/delete record - record should exist create/update/delete lists should not have overlapping records
func (*InMemoryProvider) CreateZone ¶
func (im *InMemoryProvider) CreateZone(newZone string) error
CreateZone adds new Zone if not present
func (*InMemoryProvider) DeleteZone ¶
func (im *InMemoryProvider) DeleteZone(zone string) error
DeleteZone deletes a Zone if present
func (*InMemoryProvider) GetZone ¶ added in v0.3.0
func (im *InMemoryProvider) GetZone(zone string) (Zone, error)
GetZone gets a Zone if present
func (*InMemoryProvider) Zones ¶
func (im *InMemoryProvider) Zones() map[string]string
Zones returns filtered zones as specified by domain