Documentation
¶
Index ¶
- Variables
- type Datastore
- func (d *Datastore) BlameConfig(ctx context.Context, includeDefaults bool) (*sdcpb.BlameTreeElement, error)
- func (d *Datastore) Config() *config.DatastoreConfig
- func (d *Datastore) ConnectionState() *target.TargetStatus
- func (d *Datastore) Delete(ctx context.Context) error
- func (d *Datastore) DeviationMgr(ctx context.Context)
- func (d *Datastore) GetIntent(ctx context.Context, intentName string) (GetIntentResponse, error)
- func (d *Datastore) IntentsList(ctx context.Context) ([]string, error)
- func (d *Datastore) LoadAllButRunningIntents(ctx context.Context, root *tree.RootEntry, excludeDeviations bool) ([]string, error)
- func (d *Datastore) Name() string
- func (d *Datastore) Schema() *config.SchemaConfig
- func (d *Datastore) SdcpbTransactionIntentToInternalTI(ctx context.Context, req *sdcpb.TransactionIntent) (*types.TransactionIntent, error)
- func (d *Datastore) SendDeviations(ch <-chan *treetypes.DeviationEntry, ...)
- func (d *Datastore) Stop() error
- func (d *Datastore) StopDeviationsWatch(peer string)
- func (d *Datastore) Sync(ctx context.Context)
- func (d *Datastore) TransactionCancel(ctx context.Context, transactionId string) error
- func (d *Datastore) TransactionConfirm(ctx context.Context, transactionId string) error
- func (d *Datastore) TransactionSet(ctx context.Context, transactionId string, ...) (*sdcpb.TransactionSetResponse, error)
- func (d *Datastore) WatchDeviations(req *sdcpb.WatchDeviationRequest, ...) error
- type DatastoreRollbackAdapter
- type DeviationEntry
- type GetIntentResponse
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 ¶
func New(ctx context.Context, c *config.DatastoreConfig, sc schema.Client, cc cache.Client, opts ...grpc.DialOption) (*Datastore, error)
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 (*Datastore) Config ¶
func (d *Datastore) Config() *config.DatastoreConfig
func (*Datastore) ConnectionState ¶
func (d *Datastore) ConnectionState() *target.TargetStatus
func (*Datastore) DeviationMgr ¶
func (*Datastore) IntentsList ¶ added in v0.0.56
func (*Datastore) LoadAllButRunningIntents ¶ added in v0.0.56
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) StopDeviationsWatch ¶
func (*Datastore) TransactionCancel ¶ added in v0.0.54
func (*Datastore) TransactionConfirm ¶ added in v0.0.54
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 ¶
func (d *Datastore) WatchDeviations(req *sdcpb.WatchDeviationRequest, stream sdcpb.DataServer_WatchDeviationsServer) error
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)
}
Click to show internal directories.
Click to hide internal directories.