reconcile

package
Version: v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackoffResetCallback

type BackoffResetCallback func(key interface{})

type BackoffStartCallback

type BackoffStartCallback func(key interface{}, err error)

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) Delete

func (r *Cache) Delete(key interface{})

func (*Cache) Freeze

func (r *Cache) Freeze(key interface{}, freeze bool)

Freeze object with key in old cache

func (*Cache) Get

func (r *Cache) Get(key interface{}) (old, latest interface{})

func (*Cache) Update

func (r *Cache) Update(key interface{}, old, latest interface{})

type CompareObjectHandleFunc

type CompareObjectHandleFunc func(oldObj, newObj interface{}) *Result

type Core

type Core struct {
	*Cache
	// contains filtered or unexported fields
}

func NewCore

func NewCore(ctx context.Context, resolvedOpts *Options) *Core

func (*Core) CancelSchedule

func (c *Core) CancelSchedule(job queue.Job) bool

func (*Core) Reconcile

func (c *Core) Reconcile(stop <-chan struct{})

Reconcile jobs until stop released

func (*Core) Schedule

func (c *Core) Schedule(job queue.Job, delay time.Duration) error

func (*Core) Start

func (c *Core) Start() error

Start handling of delayed jobs

type HandleFuncs

type HandleFuncs struct {
	OnAdded    SingleObjectHandleFunc
	OnUpdated  CompareObjectHandleFunc
	OnDeleting SingleObjectHandleFunc
	OnDeleted  SingleObjectHandleFunc
}

func (*HandleFuncs) ResolveNil

func (h *HandleFuncs) ResolveNil() *HandleFuncs

type Interface

type Interface interface {
	Start() error
	ReconcileUntil(stop <-chan struct{})
	Schedule(job queue.Job, delay time.Duration) error
	CancelSchedule(job queue.Job) bool
}

type Options

type Options struct {
	Logger          log.Interface
	BackoffStrategy *backoff.Strategy
	Workers         int
	RequireCache    bool
	Handlers        HandleFuncs
	OnBackoffStart  BackoffStartCallback
	OnBackoffReset  BackoffResetCallback
}

func (Options) ResolveNil

func (o Options) ResolveNil() *Options

type Result

type Result struct {
	NextAction    queue.JobAction
	ScheduleAfter time.Duration
	Err           error
}

type SingleObjectHandleFunc

type SingleObjectHandleFunc func(obj interface{}) *Result

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto