target

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncUpdate

type SyncUpdate struct {
	// identifies the store this updates needs to be written to if Sync.Validate == false
	Store string
	// The received update
	Update *sdcpb.Notification
	// if true indicates the start of cache pruning
	Start bool
	// if true and start is true indicates first sync iteration,
	// it overrides any ongoing pruning in the cache.
	Force bool
	// if true indicates the end of a sync iteration.
	// triggers the pruning on the cache side.
	End bool
}

type Target

type Target interface {
	Get(ctx context.Context, req *sdcpb.GetDataRequest) (*sdcpb.GetDataResponse, error)
	Set(ctx context.Context, source TargetSource) (*sdcpb.SetDataResponse, error)
	Sync(ctx context.Context, syncConfig *config.Sync, syncCh chan *SyncUpdate)
	Status() string
	Close() error
}

func New

func New(ctx context.Context, name string, cfg *config.SBI, schemaClient schemaClient.SchemaClientBound, opts ...grpc.DialOption) (Target, error)

type TargetSource added in v0.0.44

type TargetSource interface {
	// ToJson returns the Tree contained structure as JSON
	// use e.g. json.MarshalIndent() on the returned struct
	ToJson(onlyNewOrUpdated bool) (any, error)
	// ToJsonIETF returns the Tree contained structure as JSON_IETF
	// use e.g. json.MarshalIndent() on the returned struct
	ToJsonIETF(onlyNewOrUpdated bool) (any, error)
	ToXML(onlyNewOrUpdated bool, honorNamespace bool, operationWithNamespace bool, useOperationRemove bool) (*etree.Document, error)
	ToProtoUpdates(ctx context.Context, onlyNewOrUpdated bool) ([]*sdcpb.Update, error)
	ToProtoDeletes(ctx context.Context) ([]*sdcpb.Path, error)
}

type TargetUpdate added in v0.0.39

type TargetUpdate interface {
	GetUpdate() *cache.Update
	GetTreeEntry() tree.Entry
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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