informer

package
v0.0.3-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Entities  *EntityCache
	Features  *FeatureCache
	Groups    *GroupCache
	Revisions *RevisionCache
}

func NewCache

func NewCache(
	entities types.EntityList,
	features types.FeatureList,
	groups types.GroupList,
	revisions types.RevisionList) *Cache

type EntityCache

type EntityCache struct {
	types.EntityList
}

func (*EntityCache) List

func (c *EntityCache) List() types.EntityList

type FeatureCache

type FeatureCache struct {
	types.FeatureList
}

func (*FeatureCache) Enrich

func (c *FeatureCache) Enrich(groupCache *GroupCache)

func (*FeatureCache) List

type GroupCache

type GroupCache struct {
	types.GroupList
}

func (*GroupCache) Enrich

func (c *GroupCache) Enrich(entityCache *EntityCache)

func (*GroupCache) List

func (c *GroupCache) List(entityID *int) types.GroupList

type Informer

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

func New

func New(listInterval time.Duration, lister func() (*Cache, error)) (*Informer, error)

func (*Informer) Cache

func (f *Informer) Cache() *Cache

func (*Informer) Close

func (f *Informer) Close() error

func (*Informer) GetEntity

func (f *Informer) GetEntity(ctx context.Context, id int) (*types.Entity, error)

Get

func (*Informer) GetEntityByName

func (f *Informer) GetEntityByName(ctx context.Context, name string) (*types.Entity, error)

func (*Informer) GetFeature

func (f *Informer) GetFeature(ctx context.Context, id int) (*types.Feature, error)

func (*Informer) GetFeatureByName

func (f *Informer) GetFeatureByName(ctx context.Context, name string) (*types.Feature, error)

func (*Informer) GetGroup added in v0.0.3

func (f *Informer) GetGroup(ctx context.Context, id int) (*types.Group, error)

func (*Informer) GetGroupByName added in v0.0.3

func (f *Informer) GetGroupByName(ctx context.Context, name string) (*types.Group, error)

func (*Informer) GetRevision

func (f *Informer) GetRevision(ctx context.Context, id int) (*types.Revision, error)

func (*Informer) GetRevisionBy

func (f *Informer) GetRevisionBy(ctx context.Context, groupID int, revision int64) (*types.Revision, error)

func (*Informer) ListEntity

func (f *Informer) ListEntity(ctx context.Context) types.EntityList

List

func (*Informer) ListFeature

func (f *Informer) ListFeature(ctx context.Context, opt metadata.ListFeatureOpt) types.FeatureList

func (*Informer) ListGroup added in v0.0.3

func (f *Informer) ListGroup(ctx context.Context, entityID *int) types.GroupList

func (*Informer) ListRevision

func (f *Informer) ListRevision(ctx context.Context, groupID *int) types.RevisionList

func (*Informer) Refresh

func (f *Informer) Refresh() error

type RevisionCache

type RevisionCache struct {
	types.RevisionList
}

func (*RevisionCache) Enrich

func (c *RevisionCache) Enrich(groupCache *GroupCache)

func (*RevisionCache) List

func (c *RevisionCache) List(groupID *int) types.RevisionList

Jump to

Keyboard shortcuts

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