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

datastore

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 23 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)")
	ErrValidationError   = 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) 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() *target.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)

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, excludeDeviations bool) ([]string, error)

func (*Datastore) Name

func (d *Datastore) Name() string

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(ch <-chan *treetypes.DeviationEntry, deviationClients map[string]sdcpb.DataServer_WatchDeviationsServer)

func (*Datastore) Stop

func (d *Datastore) Stop() error

func (*Datastore) StopDeviationsWatch

func (d *Datastore) StopDeviationsWatch(peer string)

func (*Datastore) Sync

func (d *Datastore) Sync(ctx context.Context)

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 GetIntentResponse added in v0.0.56

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

Directories

Path Synopsis
clients

Jump to

Keyboard shortcuts

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