tracker

package
v0.0.0-...-e1628ab Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultKeyFunc = func(obj interface{}) string {
		return obj.(schema.Object).GetID()
	}

	DefaultChanSize = 100
)

Functions

This section is empty.

Types

type Event

type Event struct {
	Type   schema.MutationType
	Object interface{}
}

type Factory

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

func NewFactory

func NewFactory(keyFunc KeyFunc, watchSize int) *Factory

func (*Factory) EverouteCluster

func (f *Factory) EverouteCluster() *Tracker

func (*Factory) Host

func (f *Factory) Host() *Tracker

func (*Factory) IsolationPolicy

func (f *Factory) IsolationPolicy() *Tracker

func (*Factory) Label

func (f *Factory) Label() *Tracker

func (*Factory) ResetAll

func (f *Factory) ResetAll()

func (*Factory) SecurityGroup

func (f *Factory) SecurityGroup() *Tracker

func (*Factory) SecurityPolicy

func (f *Factory) SecurityPolicy() *Tracker

func (*Factory) Service

func (f *Factory) Service() *Tracker

func (*Factory) SystemEndpoints

func (f *Factory) SystemEndpoints() *Tracker

func (*Factory) Task

func (f *Factory) Task() *Tracker

func (*Factory) TrackerFor

func (f *Factory) TrackerFor(obj interface{}, keyFunc KeyFunc, watchSize int) *Tracker

func (*Factory) User

func (f *Factory) User() *Tracker

func (*Factory) VM

func (f *Factory) VM() *Tracker

type KeyFunc

type KeyFunc func(obj interface{}) string

type Tracker

type Tracker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Tracker keeps track of objects. It's used to mock resource server.

func New

func New(keyFunc KeyFunc, watchChanSize int) *Tracker

func (*Tracker) Create

func (w *Tracker) Create(obj interface{}) error

func (*Tracker) CreateOrUpdate

func (w *Tracker) CreateOrUpdate(obj interface{})

func (*Tracker) Delete

func (w *Tracker) Delete(key string) error

func (*Tracker) Get

func (w *Tracker) Get(key string) (interface{}, bool)

func (*Tracker) List

func (w *Tracker) List() []interface{}

func (*Tracker) Reset

func (w *Tracker) Reset()

Reset delete all resources

func (*Tracker) Update

func (w *Tracker) Update(obj interface{}) error

func (*Tracker) Watch

func (w *Tracker) Watch() (eventCh <-chan *Event, stopWatch func())

Jump to

Keyboard shortcuts

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