types

package
v0.0.72 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConnected = errors.New("not connected")

ErrNotConnected indicates the southbound interface (device connection) of a datastore is not established

Functions

This section is empty.

Types

type RunningStore

type RunningStore interface {
	ApplyToRunning(ctx context.Context, deletes []*sdcpb.Path, importer importer.ImportConfigAdapter) error
	NewEmptyTree(ctx context.Context) (*tree.RootEntry, error)
}

type SyncResult

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

func NewSyncResult

func NewSyncResult() *SyncResult

func (*SyncResult) AddDeletes

func (r *SyncResult) AddDeletes(d ...*sdcpb.Path)

type TargetSource

type TargetSource interface {
	// ToJson returns the Tree contained structure as JSON
	// use e.g. json.MarshalIndent() on the returned struct
	ToJson(ctx context.Context, onlyNewOrUpdated bool) (any, error)
	// ToJsonIETF returns the Tree contained structure as JSON_IETF
	// use e.g. json.MarshalIndent() on the returned struct
	ToJsonIETF(ctx context.Context, onlyNewOrUpdated bool) (any, error)
	ToXML(ctx context.Context, 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)
	ContainsChanges(ctx context.Context) (bool, error)
}

type TargetStatus

type TargetStatus struct {
	Status  sdcpb.TargetStatus
	Details string
}

TargetStatus is the southbound connection state of a target. The zero value is sdcpb.TargetStatus_UNKNOWN

func NewTargetStatus

func NewTargetStatus(status sdcpb.TargetStatus) *TargetStatus

func (*TargetStatus) Err added in v0.0.72

func (ts *TargetStatus) Err() error

Err reports the connection state as an error, so callers can propagate it and match it with errors.Is. It returns nil when the target is connected. This is the single place where a connection state turns into ErrNotConnected, keeping the Details a target collected attached to the error.

func (*TargetStatus) IsConnected

func (ts *TargetStatus) IsConnected() bool

Jump to

Keyboard shortcuts

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