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() *TargetStatus
Close() error
}
func New ¶
func New(ctx context.Context, name string, cfg *config.SBI, schemaClient schemaClient.SchemaClientBound, opts ...grpc.DialOption) (Target, error)
type TargetConnectionStatus ¶ added in v0.0.54
type TargetConnectionStatus string
const ( TargetStatusConnected TargetConnectionStatus = "connected" TargetStatusNotConnected TargetConnectionStatus = "not connected" )
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 TargetStatus ¶ added in v0.0.54
type TargetStatus struct {
Status TargetConnectionStatus
Details string
}
func NewTargetStatus ¶ added in v0.0.54
func NewTargetStatus(status TargetConnectionStatus) *TargetStatus
func (*TargetStatus) IsConnected ¶ added in v0.0.54
func (ts *TargetStatus) IsConnected() bool
Click to show internal directories.
Click to hide internal directories.