service_access

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type QueryWatcher

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

QueryWatcher is a low-level, stateless watcher. Initial updates are sent in chunks. Once snapshot is complete, further changes are incremental - unless Reset flag is set, in which case another snapshot is received.

func NewQueryWatcher

func NewQueryWatcher(id int, client service_client.ServiceServiceClient,
	params *QueryWatcherParams, evtsChan chan *QueryWatcherEvent) *QueryWatcher

func (*QueryWatcher) Run

func (qw *QueryWatcher) Run(ctx context.Context) error

type QueryWatcherEvent

type QueryWatcherEvent struct {
	Identifier   int
	Changes      []*service.ServiceChange
	Reset        bool
	LostSync     bool
	InSync       bool
	SnapshotSize int64
	CheckSize    bool
}

type QueryWatcherParams

type QueryWatcherParams struct {
	Filter    *service.Filter
	View      view.View
	FieldMask *service.Service_FieldMask
	OrderBy   *service.OrderBy
	Cursor    *service.PagerCursor
	ChunkSize int
	PageSize  int
	WatchType watch_type.WatchType

	RecoveryDeadline time.Duration
	RetryTimeout     time.Duration
}

type Watcher

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

Watcher is higher level stateful watcher with dynamic + multi filter support.

func NewWatcher

func NewWatcher(client service_client.ServiceServiceClient, config *WatcherConfig, filters ...*WatcherFilterParams) *Watcher

func (*Watcher) Events

func (pw *Watcher) Events() <-chan WatcherEvent

func (*Watcher) GetFilters

func (pw *Watcher) GetFilters() []*WatcherFilterParams

func (*Watcher) GetIFilters added in v0.4.16

func (pw *Watcher) GetIFilters() []gotenaccess.WatcherFilterParams

func (*Watcher) IEvents added in v0.4.16

func (pw *Watcher) IEvents() <-chan gotenaccess.WatcherEvent

func (*Watcher) InSync

func (pw *Watcher) InSync() bool

func (*Watcher) ResetFilters

func (pw *Watcher) ResetFilters(ctx context.Context, filters ...*WatcherFilterParams) error

func (*Watcher) ResetIFilters added in v0.4.16

func (pw *Watcher) ResetIFilters(ctx context.Context, filters ...gotenaccess.WatcherFilterParams) error

func (*Watcher) Run

func (pw *Watcher) Run(ctx context.Context) error

type WatcherConfig

type WatcherConfig struct {
	*gotenaccess.WatcherConfigBase

	// common params that must be shared across queries
	WatchType watch_type.WatchType
	View      view.View
	FieldMask *service.Service_FieldMask
	OrderBy   *service.OrderBy
	ChunkSize int
}

type WatcherEvent

type WatcherEvent struct {
	gotenaccess.WatcherEventBase
	Changes []*WatcherEventChange
}

func (*WatcherEvent) AppendChange

func (e *WatcherEvent) AppendChange(change *WatcherEventChange)

func (*WatcherEvent) AppendRawChange

func (e *WatcherEvent) AppendRawChange(change gotenaccess.WatcherEventChange)

func (*WatcherEvent) GetAt

func (e *WatcherEvent) GetAt(index int) *WatcherEventChange

func (*WatcherEvent) GetRawAt

func (e *WatcherEvent) GetRawAt(index int) gotenaccess.WatcherEventChange

func (*WatcherEvent) Length

func (e *WatcherEvent) Length() int

func (*WatcherEvent) Merge

func (e *WatcherEvent) Merge(src *WatcherEvent)

Merge makes a shallow merge of two events

type WatcherEventChange

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

func NewAddWatcherEventChange

func NewAddWatcherEventChange(resource *service.Service) *WatcherEventChange

func NewDeleteWatcherEventChange

func NewDeleteWatcherEventChange(deleted *service.Service) *WatcherEventChange

func NewModifyWatcherEventChange

func NewModifyWatcherEventChange(current, previous *service.Service) *WatcherEventChange

func (*WatcherEventChange) GetAdded

func (c *WatcherEventChange) GetAdded() *service.Service

func (*WatcherEventChange) GetCurrent

func (c *WatcherEventChange) GetCurrent() *service.Service

func (*WatcherEventChange) GetDeleted

func (c *WatcherEventChange) GetDeleted() *service.Service

func (*WatcherEventChange) GetName

func (c *WatcherEventChange) GetName() *service.Name

func (*WatcherEventChange) GetPrevious

func (c *WatcherEventChange) GetPrevious() *service.Service

func (*WatcherEventChange) GetRawAdded

func (c *WatcherEventChange) GetRawAdded() gotenresource.Resource

func (*WatcherEventChange) GetRawCurrent

func (c *WatcherEventChange) GetRawCurrent() gotenresource.Resource

func (*WatcherEventChange) GetRawDeleted

func (c *WatcherEventChange) GetRawDeleted() gotenresource.Resource

func (*WatcherEventChange) GetRawName

func (c *WatcherEventChange) GetRawName() gotenresource.Name

func (*WatcherEventChange) GetRawPrevious

func (c *WatcherEventChange) GetRawPrevious() gotenresource.Resource

func (*WatcherEventChange) IsAdd

func (c *WatcherEventChange) IsAdd() bool

func (*WatcherEventChange) IsDelete

func (c *WatcherEventChange) IsDelete() bool

func (*WatcherEventChange) IsModify

func (c *WatcherEventChange) IsModify() bool

type WatcherFilterParams

type WatcherFilterParams struct {
	Filter *service.Filter
}

func (*WatcherFilterParams) GetIFilter added in v0.4.16

func (p *WatcherFilterParams) GetIFilter() gotenresource.Filter

func (*WatcherFilterParams) GetIParentRef added in v0.4.16

func (p *WatcherFilterParams) GetIParentRef() gotenresource.Reference

func (*WatcherFilterParams) String

func (p *WatcherFilterParams) String() string

Jump to

Keyboard shortcuts

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