container

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 9

Documentation

Overview

Container

|__Reconciler
|__Reconciler
|__Reconciler

The container is a collection of data model reconcilers. Each reconciler is responsible for ensuring that changes made to the external data source are reflected in the DB. The goal is for the data model to be eventually consistent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

A container manages a collection of `Reconciler`.

func New

func New() *Container

Build a new container.

func (*Container) Add

func (c *Container) Add(reconciler Reconciler) (err error)

Add a reconciler.

func (*Container) Delete

func (c *Container) Delete(owner meta.Object) (p Reconciler, found bool)

Delete the reconciler.

func (*Container) Get

func (c *Container) Get(owner meta.Object) (Reconciler, bool)

Get a reconciler by (CR) object.

func (*Container) List

func (c *Container) List() []Reconciler

List all reconcilers.

func (*Container) Replace

func (c *Container) Replace(reconciler Reconciler) (p Reconciler, found bool, err error)

Replace a reconciler.

type Key

Reconciler key.

type Reconciler

type Reconciler interface {
	// The name.
	Name() string
	// The resource that owns the reconciler.
	Owner() meta.Object
	// Start the reconciler.
	// Expected to do basic validation, start a
	// goroutine and return quickly.
	Start() error
	// Shutdown the reconciler.
	// Expected to disconnect, destroy created resources
	// and return quickly.
	Shutdown()
	// The reconciler has achieved parity.
	HasParity() bool
	// Get the associated DB.
	DB() model.DB
	// Test connection with credentials.
	Test() error
	// Reset
	Reset()
}

Data reconciler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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