Help us shape the future of Go! Take the 2026 Go Developer Survey

datastore

package
v0.0.73 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDatastoreLocked   = errors.New("datastore is locked, other action is ongoing")
	ErrContextDone       = errors.New("context is closed (done)")
	ErrValidation        = errors.New("validation error")
	ErrNoIntentsProvided = errors.New("no intents provided")
)
View Source
var ErrIntentNotFound = errors.New("intent not found")

Functions

This section is empty.

Types

type Datastore

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

func New

New creates a new datastore, its schema server client and initializes the SBI target func New(c *config.DatastoreConfig, schemaServer *config.RemoteSchemaServer) *Datastore {

func (*Datastore) ApplyToRunning added in v0.0.67

func (d *Datastore) ApplyToRunning(ctx context.Context, deletes []*sdcpb.Path, importer importer.ImportConfigAdapter) error

func (*Datastore) BlameConfig added in v0.0.60

func (d *Datastore) BlameConfig(ctx context.Context, includeDefaults bool) (*sdcpb.BlameTreeElement, error)

func (*Datastore) Config

func (d *Datastore) Config() *config.DatastoreConfig

func (*Datastore) ConnectionState

func (d *Datastore) ConnectionState() *targettypes.TargetStatus

func (*Datastore) Delete added in v0.0.56

func (d *Datastore) Delete(ctx context.Context) error

func (*Datastore) DeviationMgr

func (d *Datastore) DeviationMgr(ctx context.Context, c *config.DeviationConfig)

func (*Datastore) GetIntent

func (d *Datastore) GetIntent(ctx context.Context, intentName string) (GetIntentResponse, error)

func (*Datastore) IntentsList added in v0.0.56

func (d *Datastore) IntentsList(ctx context.Context) ([]string, error)

func (*Datastore) LoadAllButRunningIntents added in v0.0.56

func (d *Datastore) LoadAllButRunningIntents(ctx context.Context, root *tree.RootEntry) ([]string, error)

func (*Datastore) Name

func (d *Datastore) Name() string

func (*Datastore) NewEmptyTree added in v0.0.67

func (d *Datastore) NewEmptyTree(ctx context.Context) (*tree.RootEntry, error)

func (*Datastore) Schema

func (d *Datastore) Schema() *config.SchemaConfig

func (*Datastore) SdcpbTransactionIntentToInternalTI added in v0.0.54

func (d *Datastore) SdcpbTransactionIntentToInternalTI(ctx context.Context, req *sdcpb.TransactionIntent) (*types.TransactionIntent, error)

SdcpbTransactionIntentToInternalTI converts sdcpb.TransactionIntent to types.TransactionIntent

func (*Datastore) SendDeviations added in v0.0.56

func (d *Datastore) SendDeviations(ctx context.Context, ch <-chan *treetypes.DeviationEntry, deviationClients map[string]sdcpb.DataServer_WatchDeviationsServer)

func (*Datastore) Stop

func (d *Datastore) Stop(ctx context.Context) error

func (*Datastore) StopDeviationsWatch

func (d *Datastore) StopDeviationsWatch(stream sdcpb.DataServer_WatchDeviationsServer)

func (*Datastore) TransactionCancel added in v0.0.54

func (d *Datastore) TransactionCancel(ctx context.Context, transactionId string) error

func (*Datastore) TransactionConfirm added in v0.0.54

func (d *Datastore) TransactionConfirm(ctx context.Context, transactionId string) error

func (*Datastore) TransactionSet added in v0.0.54

func (d *Datastore) TransactionSet(ctx context.Context, transactionId string, transactionIntents []*types.TransactionIntent, replaceIntent *types.TransactionIntent, transactionTimeout time.Duration, dryRun bool) (*sdcpb.TransactionSetResponse, error)

func (*Datastore) WatchDeviations

type DatastoreRollbackAdapter added in v0.0.54

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

DatastoreRollbackAdapter implements the types.RollbackInterface and encapsulates the Datastore.

func NewDatastoreRollbackAdapter added in v0.0.54

func NewDatastoreRollbackAdapter(d *Datastore) *DatastoreRollbackAdapter

NewDatastoreRollbackAdapter constructor for the DatastoreRollbackAdapter.

func (*DatastoreRollbackAdapter) TransactionRollback added in v0.0.54

func (dra *DatastoreRollbackAdapter) TransactionRollback(ctx context.Context, transaction *types.Transaction, dryRun bool) (*sdcpb.TransactionSetResponse, error)

TransactionRollback is adapted to the datastore.lowlevelTransactionSet() function

type DeviationEntry added in v0.0.56

type DeviationEntry interface {
	IntentName() string
	Reason() treetypes.DeviationReason
	Path() *sdcpb.Path
	CurrentValue() *sdcpb.TypedValue
	ExpectedValue() *sdcpb.TypedValue
}

type DeviationsStats added in v0.0.68

type DeviationsStats map[string]map[treetypes.DeviationReason]int

DeviationsStats intent name -> reason -> count

func (DeviationsStats) Add added in v0.0.68

func (d DeviationsStats) Add(deviation *treetypes.DeviationEntry)

func (DeviationsStats) LogValue added in v0.0.68

func (d DeviationsStats) LogValue() map[string]map[string]int

type GetIntentResponse added in v0.0.56

type GetIntentResponse interface {
	GetIntentName() string
	GetPriority() int32
	IsOrphan() bool
	IsNonRevertive() bool
	GetExplicitDeletes() []*sdcpb.Path
	// ToJson returns the Tree contained structure as JSON
	// use e.g. json.MarshalIndent() on the returned struct
	ToJson(ctx context.Context) (any, error)
	// ToJsonIETF returns the Tree contained structure as JSON_IETF
	// use e.g. json.MarshalIndent() on the returned struct
	ToJsonIETF(ctx context.Context) (any, error)
	ToXML(ctx context.Context) (*etree.Document, error)
	ToProtoUpdates(ctx context.Context) ([]*sdcpb.Update, error)
	ToXPath(ctx context.Context) (*sdcpb.PathValues, error)
}

Directories

Path Synopsis
clients

Jump to

Keyboard shortcuts

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