controller

package
v0.0.0-...-50c2eee Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Source endpoint.Source
	// Registry is the caching and 'owner enhancing' wrapper around provider, but
	// can also be a raw provider.
	Registry endpoint.Provider
	// The policy that defines which changes to DNS records are allowed
	Policy plan.Policy
	// The interval between individual synchronizations
	Interval time.Duration
	// The DomainFilter defines which DNS records to keep or exclude
	DomainFilter endpoint.DomainFilter

	// MangedRecordTypes are DNS record types that will be considered for management.
	ManagedRecordTypes []string
	// ExcludeRecordTypes are DNS record types that will be excluded from management.
	ExcludeRecordTypes []string
	// MinEventSyncInterval is used as window for batching events
	MinEventSyncInterval time.Duration

	// Owner is the ID of the the sync. Replaces the registry owner.
	Owner string
	// contains filtered or unexported fields
}

Controller is responsible for orchestrating the different components. It works in the following way: * Ask the DNS provider for current list of endpoints. * Ask the Source for the desired list of endpoints. * Take both lists and calculate a Plan to move current towards desired state. * Tell the DNS provider to apply the changes calculated by the Plan.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

Run runs RunOnce in a loop with a delay until context is canceled

func (*Controller) RunOnce

func (c *Controller) RunOnce(ctx context.Context) error

RunOnce runs a single iteration of a reconciliation loop.

func (*Controller) ScheduleRunOnce

func (c *Controller) ScheduleRunOnce(now time.Time)

ScheduleRunOnce makes sure execution happens at most once per interval.

func (*Controller) ShouldRunOnce

func (c *Controller) ShouldRunOnce(now time.Time) bool

Jump to

Keyboard shortcuts

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