provider

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	R_CREATE = "create"
	R_UPDATE = "update"
	R_DELETE = "delete"
)
View Source
const (
	OPT_IDENTIFIER                 = "identifier"
	OPT_CLASS                      = source.OPT_CLASS
	OPT_DRYRUN                     = "dry-run"
	OPT_TTL                        = "ttl"
	OPT_CACHE_TTL                  = "cache-ttl"
	OPT_CACHE_DIR                  = "cache-dir"
	OPT_SETUP                      = dns.OPT_SETUP
	OPT_DNSDELAY                   = "dns-delay"
	OPT_RESCHEDULEDELAY            = "reschedule-delay"
	OPT_DISABLE_ZONE_STATE_CACHING = "disable-zone-state-caching"

	OPT_PROVIDERTYPES = "provider-types"

	OPT_RATELIMITER_ENABLED = "ratelimiter.enabled"
	OPT_RATELIMITER_QPS     = "ratelimiter.qps"
	OPT_RATELIMITER_BURST   = "ratelimiter.burst"

	CMD_HOSTEDZONE_PREFIX = "hostedzone:"
	CMD_STATISTIC         = "statistic"
)
View Source
const (
	M_LISTZONES  = "list_zones"
	M_PLISTZONES = "list_zones_pages"

	M_LISTRECORDS  = "list_records"
	M_PLISTRECORDS = "list_records_pages"

	M_UPDATERECORDS = "update_records"
	M_PUPDATEREORDS = "update_records_pages"

	M_CREATERECORDS = "create_records"
	M_DELETERECORDS = "delete_records"

	M_CACHED_GETZONES     = "cached_getzones"
	M_CACHED_GETZONESTATE = "cached_getzonestate"
)
View Source
const CONTROLLER_GROUP_DNS_CONTROLLERS = dns.CONTROLLER_GROUP_DNS_CONTROLLERS
View Source
const FACTORY_OPTIONS = "factory"
View Source
const KEY_STATE = "dns-state"
View Source
const MSG_PRESERVED = "errorneous entry preserved in provider"
View Source
const PROVIDER_CLUSTER = "provider"
View Source
const SYNC_ENTRIES = "entries"
View Source
const TARGET_CLUSTER = source.TARGET_CLUSTER
View Source
const TempSuffix = ".~.tmp"
View Source
const ZoneCachePrefix = "zc-"

Variables

View Source
var GenericFactoryOptionDefaults = GenericFactoryOptions{
	RateLimiterOptionDefaults,
}
View Source
var RateLimiterOptionDefaults = RateLimiterOptions{
	Enabled: true,
	QPS:     10,
	Burst:   20,
}

Functions

func AddRecord

func AddRecord(targetsets dns.RecordSets, ty string, host string, ttl int64)

func AlwaysRateLimiter added in v0.7.12

func AlwaysRateLimiter() flowcontrol.RateLimiter

func CreateFactoryOptionSource added in v0.7.12

func CreateFactoryOptionSource(factory DNSHandlerFactory, prefix string) config.OptionSource

func DNSController

func DNSController(name string, factory DNSHandlerFactory) controller.Configuration

func DNSReconcilerType

func DNSReconcilerType(factory DNSHandlerFactory) controller.ReconcilerType

func FactoryOptionSourceCreator added in v0.7.12

func FactoryOptionSourceCreator(factory DNSHandlerFactory) extension.OptionSourceCreator

func HandlerStringMapper added in v0.7.12

func HandlerStringMapper(name string) func(s string) string

func Match added in v0.8.1

func Match(zone DNSHostedZone, dnsname string) int

func NewDNSState

func NewDNSState(ctx Context, ownerresc resources.Interface, classes *controller.Classes, config Config) *state

func Provider

func Provider(p DNSProvider) string

func StatusMessage

func StatusMessage(s string) *string

func StatusMessagef

func StatusMessagef(msgfmt string, args ...interface{}) *string

Types

type AccountCache

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

func NewAccountCache

func NewAccountCache(ttl time.Duration, dir string, opts *FactoryOptions) *AccountCache

func (*AccountCache) Get

func (this *AccountCache) Get(logger logger.LogContext, provider *dnsutils.DNSProviderObject, props utils.Properties, state *state) (*DNSAccount, error)

func (*AccountCache) Hash

func (this *AccountCache) Hash(props utils.Properties, ptype string, extension *runtime.RawExtension) string

func (*AccountCache) Release

func (this *AccountCache) Release(logger logger.LogContext, a *DNSAccount, name resources.ObjectName)

type ChangeGroup

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

type ChangeModel

type ChangeModel struct {
	logger.LogContext
	// contains filtered or unexported fields
}

func NewChangeModel

func NewChangeModel(logger logger.LogContext, owners utils.StringSet, req *zoneReconciliation, config Config) *ChangeModel

func (*ChangeModel) AddTargets

func (this *ChangeModel) AddTargets(set *dns.DNSSet, base *dns.DNSSet, provider DNSProvider, targets ...Target) *dns.DNSSet

func (*ChangeModel) Apply

func (this *ChangeModel) Apply(name string, createdAt time.Time, done DoneHandler, targets ...Target) ChangeResult

func (*ChangeModel) Check

func (this *ChangeModel) Check(name string, createdAt time.Time, done DoneHandler, targets ...Target) ChangeResult

func (*ChangeModel) Cleanup

func (this *ChangeModel) Cleanup(logger logger.LogContext) bool

func (*ChangeModel) Delete

func (this *ChangeModel) Delete(name string, createdAt time.Time, done DoneHandler) ChangeResult

func (*ChangeModel) Domain

func (this *ChangeModel) Domain() string

func (*ChangeModel) Exec

func (this *ChangeModel) Exec(apply bool, delete bool, name string, createdAt time.Time, done DoneHandler, targets ...Target) ChangeResult

func (*ChangeModel) IsFailed added in v0.8.2

func (this *ChangeModel) IsFailed(dnsName string) bool

func (*ChangeModel) IsForeign

func (this *ChangeModel) IsForeign(set *dns.DNSSet) bool

func (*ChangeModel) IsStale

func (this *ChangeModel) IsStale(dns string) *Entry

func (*ChangeModel) Owns

func (this *ChangeModel) Owns(set *dns.DNSSet) bool

func (*ChangeModel) Setup

func (this *ChangeModel) Setup() error

func (*ChangeModel) Update

func (this *ChangeModel) Update(logger logger.LogContext) error

func (*ChangeModel) ZoneId

func (this *ChangeModel) ZoneId() string

type ChangeRequest

type ChangeRequest struct {
	Action   string
	Type     string
	Addition *dns.DNSSet
	Deletion *dns.DNSSet
	Done     DoneHandler
}

func NewChangeRequest

func NewChangeRequest(action string, rtype string, del, add *dns.DNSSet, done DoneHandler) *ChangeRequest

type ChangeRequests

type ChangeRequests []*ChangeRequest

type ChangeResult

type ChangeResult struct {
	Modified bool
	Retry    bool
	Error    error
}

type CompoundFactory

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

func NewDNSHandlerCompoundFactory

func NewDNSHandlerCompoundFactory(name string) *CompoundFactory

func (*CompoundFactory) Add

func (this *CompoundFactory) Add(f DNSHandlerFactory, finalizer ...string) error

func (*CompoundFactory) Create

func (this *CompoundFactory) Create(typecode string, cfg *DNSHandlerConfig) (DNSHandler, error)

func (*CompoundFactory) CreateOptionSource added in v0.7.12

func (this *CompoundFactory) CreateOptionSource() (config.OptionSource, *GenericFactoryOptions)

func (*CompoundFactory) Finalizers added in v0.7.12

func (this *CompoundFactory) Finalizers() utils.StringSet

func (*CompoundFactory) IsResponsibleFor

func (this *CompoundFactory) IsResponsibleFor(object *dnsutils.DNSProviderObject) bool

func (*CompoundFactory) Name

func (this *CompoundFactory) Name() string

func (*CompoundFactory) SupportZoneStateCache

func (this *CompoundFactory) SupportZoneStateCache(typecode string) (bool, error)

func (*CompoundFactory) TypeCodes

func (this *CompoundFactory) TypeCodes() utils.StringSet

type Config

type Config struct {
	TTL              int64
	CacheTTL         time.Duration
	CacheDir         string
	RescheduleDelay  time.Duration
	Ident            string
	Dryrun           bool
	ZoneStateCaching bool
	Delay            time.Duration
	Enabled          utils.StringSet
	Options          *FactoryOptions
	Factory          DNSHandlerFactory
}

func NewConfigForController

func NewConfigForController(c controller.Interface, factory DNSHandlerFactory) (*Config, error)

type Context

type Context interface {
	logger.LogContext

	GetContext() context.Context

	IsReady() bool
	GetByExample(runtime.Object) (resources.Interface, error)

	GetStringOption(name string) (string, error)
	GetIntOption(name string) (int, error)

	Synchronize(log logger.LogContext, name string, initiator resources.Object) (bool, error)

	Enqueue(obj resources.Object) error
	EnqueueCommand(cmd string) error
	EnqueueKey(key resources.ClusterObjectKey) error

	SetFinalizer(resources.Object) error
	RemoveFinalizer(resources.Object) error
	HasFinalizer(resources.Object) bool

	GetSecretPropertiesByRef(src resources.ResourcesSource, ref *corev1.SecretReference) (utils.Properties, *resources.SecretObject, error)
	GetPoolPeriod(name string) *time.Duration
}

func NewDefaultContext

func NewDefaultContext(controller controller.Interface) Context

type DNSAccount

type DNSAccount struct {
	*dnsutils.RateLimiter
	// contains filtered or unexported fields
}

func NewDNSAccount added in v0.7.9

func NewDNSAccount(config utils.Properties, handler DNSHandler, hash string) *DNSAccount

func (*DNSAccount) AddGenericRequests added in v0.8.4

func (this *DNSAccount) AddGenericRequests(requestType string, n int)

func (*DNSAccount) AddZoneRequests added in v0.8.4

func (this *DNSAccount) AddZoneRequests(zoneID, requestType string, n int)

func (*DNSAccount) ExecuteRequests

func (this *DNSAccount) ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, reqs []*ChangeRequest) error

func (*DNSAccount) GetZoneState

func (this *DNSAccount) GetZoneState(zone DNSHostedZone) (DNSZoneState, error)

func (*DNSAccount) GetZones

func (this *DNSAccount) GetZones() (DNSHostedZones, error)

func (*DNSAccount) Hash

func (this *DNSAccount) Hash() string

func (*DNSAccount) MapTarget

func (this *DNSAccount) MapTarget(t Target) Target

func (*DNSAccount) ProviderType

func (this *DNSAccount) ProviderType() string

func (*DNSAccount) Release

func (this *DNSAccount) Release()

func (*DNSAccount) ReportZoneStateConflict

func (this *DNSAccount) ReportZoneStateConflict(zone DNSHostedZone, err error) bool

type DNSHandler

type DNSHandler interface {
	ProviderType() string
	GetZones() (DNSHostedZones, error)
	GetZoneState(DNSHostedZone) (DNSZoneState, error)
	ReportZoneStateConflict(zone DNSHostedZone, err error) bool
	ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, reqs []*ChangeRequest) error
	MapTarget(t Target) Target
	Release()
}

type DNSHandlerConfig

type DNSHandlerConfig struct {
	Logger      logger.LogContext
	Properties  utils.Properties
	Config      *runtime.RawExtension
	DryRun      bool
	Context     context.Context
	CacheConfig ZoneCacheConfig
	Options     *FactoryOptions
	Metrics     Metrics
	RateLimiter flowcontrol.RateLimiter
}

func (*DNSHandlerConfig) FillDefaultedBoolProperty added in v0.7.21

func (c *DNSHandlerConfig) FillDefaultedBoolProperty(target **bool, def bool, prop string, alt ...string) error

func (*DNSHandlerConfig) FillDefaultedIntProperty added in v0.7.7

func (c *DNSHandlerConfig) FillDefaultedIntProperty(target **int, def int, prop string, alt ...string) error

func (*DNSHandlerConfig) FillDefaultedProperty added in v0.7.14

func (c *DNSHandlerConfig) FillDefaultedProperty(target **string, def string, prop string, alt ...string) error

func (*DNSHandlerConfig) FillRequiredIntProperty added in v0.7.7

func (c *DNSHandlerConfig) FillRequiredIntProperty(target **int, prop string, alt ...string) error

func (*DNSHandlerConfig) FillRequiredProperty added in v0.7.7

func (c *DNSHandlerConfig) FillRequiredProperty(target **string, prop string, alt ...string) error

func (*DNSHandlerConfig) GetDefaultedBoolProperty added in v0.7.21

func (c *DNSHandlerConfig) GetDefaultedBoolProperty(key string, def bool, altKeys ...string) (bool, error)

func (*DNSHandlerConfig) GetDefaultedIntProperty added in v0.7.7

func (c *DNSHandlerConfig) GetDefaultedIntProperty(key string, def int, altKeys ...string) (int, error)

func (*DNSHandlerConfig) GetDefaultedProperty added in v0.7.7

func (c *DNSHandlerConfig) GetDefaultedProperty(key string, def string, altKeys ...string) string

func (*DNSHandlerConfig) GetProperty

func (c *DNSHandlerConfig) GetProperty(key string, altKeys ...string) string

func (*DNSHandlerConfig) GetRequiredBoolProperty added in v0.7.21

func (c *DNSHandlerConfig) GetRequiredBoolProperty(key string, altKeys ...string) (bool, error)

func (*DNSHandlerConfig) GetRequiredIntProperty added in v0.7.7

func (c *DNSHandlerConfig) GetRequiredIntProperty(key string, altKeys ...string) (int, error)

func (*DNSHandlerConfig) GetRequiredProperty

func (c *DNSHandlerConfig) GetRequiredProperty(key string, altKeys ...string) (string, error)

type DNSHandlerCreatorFunction

type DNSHandlerCreatorFunction func(config *DNSHandlerConfig) (DNSHandler, error)

type DNSHandlerFactory

type DNSHandlerFactory interface {
	Name() string
	TypeCodes() utils.StringSet
	Create(typecode string, config *DNSHandlerConfig) (DNSHandler, error)
	IsResponsibleFor(object *dnsutils.DNSProviderObject) bool
	SupportZoneStateCache(typecode string) (bool, error)
}

type DNSHandlerOptionSource added in v0.7.12

type DNSHandlerOptionSource interface {
	CreateOptionSource() (local config.OptionSource, defaults *GenericFactoryOptions)
}

type DNSHostedZone

type DNSHostedZone interface {
	ProviderType() string
	Key() string
	Id() string
	Domain() string
	ForwardedDomains() []string
	Match(dnsname string) int
	IsPrivate() bool
}

func CopyDNSHostedZone

func CopyDNSHostedZone(zone DNSHostedZone, forwardedDomains []string) DNSHostedZone

func NewDNSHostedZone

func NewDNSHostedZone(ptype string, id, domain, key string, forwarded []string, isPrivate bool) DNSHostedZone

type DNSHostedZones

type DNSHostedZones []DNSHostedZone

type DNSNames

type DNSNames map[string]*Entry

type DNSProvider

type DNSProvider interface {
	ObjectName() resources.ObjectName
	Object() resources.Object
	TypeCode() string

	DefaultTTL() int64

	GetZones() DNSHostedZones
	IncludesZone(zoneID string) bool

	GetZoneState(zone DNSHostedZone) (DNSZoneState, error)
	ExecuteRequests(logger logger.LogContext, zone DNSHostedZone, state DNSZoneState, requests []*ChangeRequest) error

	Match(dns string) int
	MatchZone(dns string) int
	IsValid() bool

	AccountHash() string
	MapTarget(t Target) Target

	// ReportZoneStateConflict is used to report a conflict because of stale data.
	// It returns true if zone data will be updated and a retry may resolve the conflict
	ReportZoneStateConflict(zone DNSHostedZone, err error) bool
}

type DNSProviders

type DNSProviders map[resources.ObjectName]DNSProvider

func (DNSProviders) LookupFor

func (this DNSProviders) LookupFor(dns string) DNSProvider

type DNSZoneState

type DNSZoneState interface {
	GetDNSSets() dns.DNSSets
}

func NewDNSZoneState

func NewDNSZoneState(sets dns.DNSSets) DNSZoneState

type DefaultContext

type DefaultContext struct {
	logger.LogContext
	// contains filtered or unexported fields
}

func (*DefaultContext) Enqueue

func (this *DefaultContext) Enqueue(obj resources.Object) error

func (*DefaultContext) EnqueueCommand

func (this *DefaultContext) EnqueueCommand(cmd string) error

func (*DefaultContext) EnqueueKey

func (this *DefaultContext) EnqueueKey(key resources.ClusterObjectKey) error

func (*DefaultContext) GetByExample

func (this *DefaultContext) GetByExample(obj runtime.Object) (resources.Interface, error)

func (*DefaultContext) GetContext

func (this *DefaultContext) GetContext() context.Context

func (*DefaultContext) GetIntOption

func (this *DefaultContext) GetIntOption(name string) (int, error)

func (*DefaultContext) GetPoolPeriod

func (this *DefaultContext) GetPoolPeriod(name string) *time.Duration

func (*DefaultContext) GetSecretPropertiesByRef

func (*DefaultContext) GetStringOption added in v0.7.12

func (this *DefaultContext) GetStringOption(name string) (string, error)

func (*DefaultContext) HasFinalizer

func (this *DefaultContext) HasFinalizer(obj resources.Object) bool

func (*DefaultContext) IsReady

func (this *DefaultContext) IsReady() bool

func (*DefaultContext) RemoveFinalizer

func (this *DefaultContext) RemoveFinalizer(obj resources.Object) error

func (*DefaultContext) SetFinalizer

func (this *DefaultContext) SetFinalizer(obj resources.Object) error

func (*DefaultContext) Synchronize added in v0.7.12

func (this *DefaultContext) Synchronize(log logger.LogContext, name string, obj resources.Object) (bool, error)

type DefaultDNSHandler

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

func NewDefaultDNSHandler

func NewDefaultDNSHandler(providerType string) DefaultDNSHandler

func (*DefaultDNSHandler) MapTarget

func (this *DefaultDNSHandler) MapTarget(t Target) Target

func (*DefaultDNSHandler) ProviderType

func (this *DefaultDNSHandler) ProviderType() string

type DefaultDNSHostedZone

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

func (*DefaultDNSHostedZone) Domain

func (this *DefaultDNSHostedZone) Domain() string

func (*DefaultDNSHostedZone) ForwardedDomains

func (this *DefaultDNSHostedZone) ForwardedDomains() []string

func (*DefaultDNSHostedZone) Id

func (this *DefaultDNSHostedZone) Id() string

func (*DefaultDNSHostedZone) IsPrivate

func (this *DefaultDNSHostedZone) IsPrivate() bool

func (*DefaultDNSHostedZone) Key

func (this *DefaultDNSHostedZone) Key() string

func (*DefaultDNSHostedZone) Match added in v0.8.1

func (this *DefaultDNSHostedZone) Match(dnsname string) int

func (*DefaultDNSHostedZone) ProviderType

func (this *DefaultDNSHostedZone) ProviderType() string

type DefaultDNSZoneState

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

func (*DefaultDNSZoneState) Clone added in v0.7.14

func (this *DefaultDNSZoneState) Clone() DNSZoneState

func (*DefaultDNSZoneState) GetDNSSets

func (this *DefaultDNSZoneState) GetDNSSets() dns.DNSSets

type DoneHandler

type DoneHandler interface {
	SetInvalid(err error)
	Failed(err error)
	Succeeded()
}

func NewStatusUpdate

func NewStatusUpdate(logger logger.LogContext, e *Entry, f FinalizerHandler) DoneHandler

type DumpDNSHostedZone

type DumpDNSHostedZone struct {
	ProviderType     string
	Key              string
	Id               string
	Domain           string
	ForwardedDomains []string
}

type Entries

type Entries map[resources.ObjectName]*Entry

func (Entries) AddActiveZoneTo added in v0.7.18

func (this Entries) AddActiveZoneTo(zoneid string, list *EntryList)

func (Entries) AddEntry

func (this Entries) AddEntry(entry *Entry) *Entry

func (Entries) AddResponsibleTo added in v0.7.12

func (this Entries) AddResponsibleTo(list *EntryList)

func (Entries) Delete

func (this Entries) Delete(e *Entry)

type Entry

type Entry struct {
	*EntryVersion
	// contains filtered or unexported fields
}

func NewEntry

func NewEntry(v *EntryVersion, state *state) *Entry

func (*Entry) Before

func (this *Entry) Before(e *Entry) bool

func (*Entry) CreatedAt

func (this *Entry) CreatedAt() time.Time

func (*Entry) IsActive

func (this *Entry) IsActive() bool

func (*Entry) IsModified

func (this *Entry) IsModified() bool

func (*Entry) RemoveFinalizer added in v0.7.12

func (this *Entry) RemoveFinalizer() error

func (*Entry) Trigger

func (this *Entry) Trigger(logger logger.LogContext)

func (*Entry) Update

func (this *Entry) Update(logger logger.LogContext, new *EntryVersion) *Entry

type EntryList

type EntryList []*Entry

func (EntryList) Len

func (this EntryList) Len() int

func (EntryList) Less

func (this EntryList) Less(i, j int) bool

func (EntryList) Lock

func (this EntryList) Lock()

func (EntryList) Sort

func (this EntryList) Sort()

func (EntryList) Swap

func (this EntryList) Swap(i, j int)

func (EntryList) Unlock

func (this EntryList) Unlock()

func (EntryList) UpdateStatistic added in v0.7.12

func (this EntryList) UpdateStatistic(statistic *statistic.EntryStatistic)

type EntryPremise

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

func (*EntryPremise) Match added in v0.7.12

func (this *EntryPremise) Match(p *EntryPremise) bool

func (*EntryPremise) NotifyChange

func (this *EntryPremise) NotifyChange(p *EntryPremise) string

type EntryVersion

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

func NewEntryVersion

func NewEntryVersion(object *dnsutils.DNSEntryObject, old *Entry) *EntryVersion

func (*EntryVersion) ClusterKey

func (this *EntryVersion) ClusterKey() resources.ClusterObjectKey

func (*EntryVersion) DNSName

func (this *EntryVersion) DNSName() string

func (*EntryVersion) Description

func (this *EntryVersion) Description() string

func (*EntryVersion) Interval

func (this *EntryVersion) Interval() int64

func (*EntryVersion) IsDeleting

func (this *EntryVersion) IsDeleting() bool

func (*EntryVersion) IsResponsible added in v0.7.7

func (this *EntryVersion) IsResponsible() bool

func (*EntryVersion) IsValid

func (this *EntryVersion) IsValid() bool

func (*EntryVersion) KeepRecords added in v0.8.3

func (this *EntryVersion) KeepRecords() bool

func (*EntryVersion) Message

func (this *EntryVersion) Message() string

func (*EntryVersion) Object

func (this *EntryVersion) Object() *dnsutils.DNSEntryObject

func (*EntryVersion) ObjectName

func (this *EntryVersion) ObjectName() resources.ObjectName

func (*EntryVersion) OwnerId

func (this *EntryVersion) OwnerId() string

func (*EntryVersion) ProviderName added in v0.7.12

func (this *EntryVersion) ProviderName() resources.ObjectName

func (*EntryVersion) ProviderType added in v0.7.7

func (this *EntryVersion) ProviderType() string

func (*EntryVersion) RequiresUpdateFor

func (this *EntryVersion) RequiresUpdateFor(e *EntryVersion) (reasons []string)

func (*EntryVersion) Setup

func (this *EntryVersion) Setup(logger logger.LogContext, state *state, p *EntryPremise, op string, err error, config Config, old *Entry) reconcile.Status

func (*EntryVersion) State

func (this *EntryVersion) State() string

func (*EntryVersion) TTL

func (this *EntryVersion) TTL() int64

func (*EntryVersion) Targets

func (this *EntryVersion) Targets() Targets

func (*EntryVersion) UpdateStatus

func (this *EntryVersion) UpdateStatus(logger logger.LogContext, state string, msg string) (bool, error)

func (*EntryVersion) ZoneId

func (this *EntryVersion) ZoneId() string

type Factory

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

func NewDNSHandlerFactory

func NewDNSHandlerFactory(typecode string, create DNSHandlerCreatorFunction, disableZoneStateCache ...bool) *Factory

func (*Factory) Create

func (this *Factory) Create(typecode string, config *DNSHandlerConfig) (DNSHandler, error)

func (*Factory) CreateOptionSource added in v0.7.12

func (this *Factory) CreateOptionSource() (config.OptionSource, *GenericFactoryOptions)

func (*Factory) IsResponsibleFor

func (this *Factory) IsResponsibleFor(object *dnsutils.DNSProviderObject) bool

func (*Factory) Name

func (this *Factory) Name() string

func (*Factory) SetGenericFactoryOptionDefaults added in v0.7.12

func (this *Factory) SetGenericFactoryOptionDefaults(defaults ...GenericFactoryOptions) *Factory

func (*Factory) SetOptionSourceByExample added in v0.7.12

func (this *Factory) SetOptionSourceByExample(proto config.OptionSource, defaults ...GenericFactoryOptions) *Factory

func (*Factory) SetOptionSourceCreator added in v0.7.12

func (this *Factory) SetOptionSourceCreator(creator extension.OptionSourceCreator, defaults ...GenericFactoryOptions) *Factory

func (*Factory) SupportZoneStateCache

func (this *Factory) SupportZoneStateCache(typecode string) (bool, error)

func (*Factory) TypeCodes

func (this *Factory) TypeCodes() utils.StringSet

type FactoryOptions added in v0.7.12

type FactoryOptions struct {
	// type specific options
	Options config.OptionSource
	// generic options for all factory types
	GenericFactoryOptions
}

FactoryOptions is a set of generic options and type specific options related to factories that are provided for all provider types but in a provider specific manner. The provide specif options are defined by an option source optionally offered by the provider factory. It is handled by the compound factory, also, to provide dedicated option sets for hosted sub factories.

func GetFactoryOptions added in v0.7.12

func GetFactoryOptions(src config.OptionSource) *FactoryOptions

func (*FactoryOptions) AddOptionsToSet added in v0.7.12

func (this *FactoryOptions) AddOptionsToSet(set config.OptionSet)

func (*FactoryOptions) Evaluate added in v0.7.12

func (this *FactoryOptions) Evaluate() error

type FinalizerHandler

type FinalizerHandler interface {
	SetFinalizer(name resources.Object) error
	RemoveFinalizer(name resources.Object) error
}

type Finalizers added in v0.7.12

type Finalizers interface {
	Finalizers() utils.StringSet
}

type ForwardedDomainsHandlerData

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

func NewForwardedDomainsHandlerData

func NewForwardedDomainsHandlerData() *ForwardedDomainsHandlerData

func (*ForwardedDomainsHandlerData) DeleteZone

func (hd *ForwardedDomainsHandlerData) DeleteZone(zoneID string)

func (*ForwardedDomainsHandlerData) GetForwardedDomains

func (hd *ForwardedDomainsHandlerData) GetForwardedDomains(zoneid string) []string

func (*ForwardedDomainsHandlerData) Marshal

func (*ForwardedDomainsHandlerData) SetForwardedDomains

func (hd *ForwardedDomainsHandlerData) SetForwardedDomains(zoneid string, value []string)

func (*ForwardedDomainsHandlerData) Unmarshal

func (hd *ForwardedDomainsHandlerData) Unmarshal(zoneID string, data *PersistentHandlerData) error

type FullDump

type FullDump struct {
	InMemory map[string]*ZoneDump
}

type GenericFactoryOptions added in v0.7.12

type GenericFactoryOptions struct {
	RateLimiterOptions
}

func (*GenericFactoryOptions) AddOptionsToSet added in v0.7.12

func (this *GenericFactoryOptions) AddOptionsToSet(set config.OptionSet)

func (GenericFactoryOptions) SetRateLimiterOptions added in v0.7.12

func (this GenericFactoryOptions) SetRateLimiterOptions(o RateLimiterOptions) GenericFactoryOptions

type HandlerData

type HandlerData interface {
	Marshal(zoneID string) (*PersistentHandlerData, error)
	Unmarshal(zoneID string, data *PersistentHandlerData) error
	DeleteZone(zoneID string)
}

type InMemory

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

func NewInMemory

func NewInMemory() *InMemory

func (*InMemory) AddZone

func (m *InMemory) AddZone(zone DNSHostedZone) bool

func (*InMemory) Apply

func (m *InMemory) Apply(zoneID string, request *ChangeRequest, metrics Metrics) error

func (*InMemory) BuildFullDump

func (m *InMemory) BuildFullDump() *FullDump

func (*InMemory) CloneZoneState

func (m *InMemory) CloneZoneState(zone DNSHostedZone) (DNSZoneState, error)

func (*InMemory) DeleteZone

func (m *InMemory) DeleteZone(zone DNSHostedZone)

func (*InMemory) FindHostedZone

func (m *InMemory) FindHostedZone(zoneid string) DNSHostedZone

func (*InMemory) GetZones

func (m *InMemory) GetZones() DNSHostedZones

func (*InMemory) SetZone

func (m *InMemory) SetZone(zone DNSHostedZone, zoneState DNSZoneState)

type Metrics

type Metrics interface {
	AddGenericRequests(request_type string, n int)
	AddZoneRequests(zoneID, request_type string, n int)
}

type NullMetrics

type NullMetrics struct{}

func (*NullMetrics) AddGenericRequests added in v0.8.4

func (m *NullMetrics) AddGenericRequests(request_type string, n int)

func (*NullMetrics) AddZoneRequests added in v0.8.4

func (m *NullMetrics) AddZoneRequests(zon, request_type string, n int)

type OwnerCache

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

func NewOwnerCache

func NewOwnerCache(config *Config) *OwnerCache

func (*OwnerCache) DeleteOwner

func (this *OwnerCache) DeleteOwner(key resources.ObjectKey) (changeset utils.StringSet, activeset utils.StringSet)

func (*OwnerCache) GetIds

func (this *OwnerCache) GetIds() utils.StringSet

func (*OwnerCache) IsResponsibleFor

func (this *OwnerCache) IsResponsibleFor(id string) bool

func (*OwnerCache) IsResponsiblePendingFor added in v0.7.21

func (this *OwnerCache) IsResponsiblePendingFor(id string) bool

func (*OwnerCache) SetPending added in v0.7.21

func (this *OwnerCache) SetPending(id string)

func (*OwnerCache) UpdateCountsWith added in v0.7.12

func (this *OwnerCache) UpdateCountsWith(statistic statistic.OwnerStatistic, types utils.StringSet) OwnerCounts

func (*OwnerCache) UpdateOwner

func (this *OwnerCache) UpdateOwner(owner *dnsutils.DNSOwnerObject) (changeset utils.StringSet, activeset utils.StringSet)

type OwnerCounts added in v0.7.12

type OwnerCounts map[OwnerName]ProviderTypeCounts

type OwnerIDInfo added in v0.7.12

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

type OwnerIDInfos added in v0.7.12

type OwnerIDInfos map[string]OwnerIDInfo

func (OwnerIDInfos) Contains added in v0.7.12

func (this OwnerIDInfos) Contains(id string) bool

func (OwnerIDInfos) KeySet added in v0.7.12

func (this OwnerIDInfos) KeySet() utils.StringSet

type OwnerName added in v0.7.17

type OwnerName string

type OwnerObjectInfo added in v0.7.12

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

type OwnerObjectInfos added in v0.7.12

type OwnerObjectInfos map[OwnerName]OwnerObjectInfo

type PersistentHandlerData

type PersistentHandlerData struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Value   *runtime.RawExtension
}

type PersistentZone

type PersistentZone struct {
	ProviderType     string   `json:"providerType"`
	Key              string   `json:"key"`
	Id               string   `json:"id"`
	Domain           string   `json:"domain"`
	ForwardedDomains []string `json:"forwardedDomains"`
	IsPrivate        bool     `json:"isPrivate"`
}

func NewPersistentZone

func NewPersistentZone(zone DNSHostedZone) *PersistentZone

func (*PersistentZone) ToDNSHostedZone

func (z *PersistentZone) ToDNSHostedZone() DNSHostedZone

type PersistentZoneState

type PersistentZoneState struct {
	Version     string                 `json:"version"`
	Valid       time.Time              `json:"valid"`
	Zone        PersistentZone         `json:"zone"`
	DNSSets     dns.DNSSets            `json:"dnssets,omitempty"`
	HandlerData *PersistentHandlerData `json:"handlerData,omitempty"`
}

type ProviderTypeCounts added in v0.7.12

type ProviderTypeCounts map[string]int

type RateLimiterConfig added in v0.7.12

type RateLimiterConfig struct {
	QPS   float32
	Burst int
}

func (*RateLimiterConfig) NewRateLimiter added in v0.7.12

func (c *RateLimiterConfig) NewRateLimiter() (flowcontrol.RateLimiter, error)

func (*RateLimiterConfig) String added in v0.7.12

func (c *RateLimiterConfig) String() string

type RateLimiterOptions added in v0.7.12

type RateLimiterOptions struct {
	Enabled bool
	QPS     int
	Burst   int
}

func (*RateLimiterOptions) AddOptionsToSet added in v0.7.12

func (this *RateLimiterOptions) AddOptionsToSet(set config.OptionSet)

func (*RateLimiterOptions) GetRateLimiterConfig added in v0.7.12

func (c *RateLimiterOptions) GetRateLimiterConfig() *RateLimiterConfig

func (RateLimiterOptions) SetBurst added in v0.7.12

func (c RateLimiterOptions) SetBurst(burst int) RateLimiterOptions

func (RateLimiterOptions) SetEnabled added in v0.7.12

func (c RateLimiterOptions) SetEnabled(enabled bool) RateLimiterOptions

func (RateLimiterOptions) SetQPS added in v0.7.12

type References added in v0.7.12

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

func NewReferenceCache added in v0.7.12

func NewReferenceCache() *References

func (*References) AddRef added in v0.7.12

func (*References) DelRef added in v0.7.12

func (this *References) DelRef(holder resources.ClusterObjectKey)

func (*References) NotifyHolder added in v0.7.12

func (this *References) NotifyHolder(ctx Context, ref resources.ClusterObjectKey)

type StatusUpdate

type StatusUpdate struct {
	*Entry
	// contains filtered or unexported fields
}

func (*StatusUpdate) Failed

func (this *StatusUpdate) Failed(err error)

func (*StatusUpdate) SetInvalid

func (this *StatusUpdate) SetInvalid(err error)

func (*StatusUpdate) Succeeded

func (this *StatusUpdate) Succeeded()

type Target

type Target interface {
	GetHostName() string
	GetRecordType() string
	GetEntry() *EntryVersion
	Description() string
}

func NewTarget

func NewTarget(ty string, ta string, entry *EntryVersion) Target

func NewTargetFromEntryVersion

func NewTargetFromEntryVersion(name string, entry *EntryVersion) (Target, error)

func NewText

func NewText(t string, entry *EntryVersion) Target

type Targets

type Targets []Target

func (Targets) DifferFrom

func (this Targets) DifferFrom(targets Targets) bool

func (Targets) Has

func (this Targets) Has(target Target) bool

type ZoneCache

type ZoneCache interface {
	GetZones() (DNSHostedZones, error)
	GetZoneState(zone DNSHostedZone) (DNSZoneState, error)
	ApplyRequests(logctx logger.LogContext, err error, zone DNSHostedZone, reqs []*ChangeRequest)
	GetHandlerData() HandlerData
	Release()
	ReportZoneStateConflict(zone DNSHostedZone, err error) bool
}

func NewZoneCache

func NewZoneCache(config ZoneCacheConfig, metrics Metrics, handlerData HandlerData,
	zonesUpdater ZoneCacheZoneUpdater, stateUpdater ZoneCacheStateUpdater) (ZoneCache, error)

type ZoneCacheConfig

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

func (*ZoneCacheConfig) CopyWithDisabledZoneStateCache

func (c *ZoneCacheConfig) CopyWithDisabledZoneStateCache() *ZoneCacheConfig

type ZoneCacheStateUpdater

type ZoneCacheStateUpdater func(zone DNSHostedZone, cache ZoneCache) (DNSZoneState, error)

type ZoneCacheZoneUpdater

type ZoneCacheZoneUpdater func(cache ZoneCache) (DNSHostedZones, error)

type ZoneDump

type ZoneDump struct {
	HostedZone DumpDNSHostedZone
	DNSSets    dns.DNSSets
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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