Documentation
¶
Index ¶
- Variables
- func NewTransactionError(err error, recoverable bool) error
- type Collector
- func (r *Collector) GetUpdateChan() chan struct{}
- func (r *Collector) IsRunning() bool
- func (r *Collector) SetPort(port uint)
- func (r *Collector) Start(ctx context.Context, req *sdcpb.CreateDataStoreRequest) error
- func (r *Collector) StartSubscription(ctx context.Context)
- func (r *Collector) Stop(ctx context.Context)
- func (r *Collector) StopSubscription(ctx context.Context)
- type Context
- func (r *Context) Cancel(ctx context.Context, key storebackend.Key, transactionID string) error
- func (r *Context) Confirm(ctx context.Context, key storebackend.Key, transactionID string) error
- func (r *Context) CreateDS(ctx context.Context, datastoreReq *sdcpb.CreateDataStoreRequest) error
- func (r *Context) DeleteDS(ctx context.Context) error
- func (r *Context) DeleteIntent(ctx context.Context, key storebackend.Key, config *config.Config, dryRun bool) (string, error)
- func (r *Context) DeleteSubscription(ctx context.Context, sub *invv1alpha1.Subscription) error
- func (r *Context) GetAddress() string
- func (r *Context) GetBlameConfig(ctx context.Context, key storebackend.Key) (*config.ConfigBlame, error)
- func (r *Context) GetCache() cache.Cache
- func (r *Context) GetDSClient() dsclient.Client
- func (r *Context) GetData(ctx context.Context, key storebackend.Key) (*config.RunningConfig, error)
- func (r *Context) GetDataStore(ctx context.Context, in *sdcpb.GetDataStoreRequest, opts ...grpc.CallOption) (*sdcpb.GetDataStoreResponse, error)
- func (r *Context) GetPrombLabels() []prompb.Label
- func (r *Context) GetSchema() *config.ConfigStatusLastKnownGoodSchema
- func (r *Context) IsConfigRecovered(ctx context.Context) bool
- func (r *Context) IsReady() bool
- func (r *Context) RecoverIntents(ctx context.Context, key storebackend.Key, configs []*config.Config) (string, error)
- func (r *Context) SetIntent(ctx context.Context, key storebackend.Key, config *config.Config, dryRun bool) (string, error)
- func (r *Context) SetIntents(ctx context.Context, key storebackend.Key, transactionID string, ...) (string, error)
- func (r *Context) SetNotReady(ctx context.Context)
- func (r *Context) SetReady(ctx context.Context)
- func (r *Context) SetRecoveredConfigs(ctx context.Context)
- func (r *Context) TransactionSet(ctx context.Context, req *sdcpb.TransactionSetRequest) (string, error)
- func (r *Context) UpsertSubscription(ctx context.Context, sub *invv1alpha1.Subscription) error
- type DeviationWatcher
- type LookupError
- type MockContext
- type Path
- type PathSubscriptions
- type Subscription
- type Subscriptions
- type TargetHandler
- type TransactionError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLookup = errors.New("target lookup error")
Functions ¶
func NewTransactionError ¶ added in v0.0.47
NewTransactionError creates a new TransactionError
Types ¶
type Collector ¶ added in v0.0.44
type Collector struct {
// contains filtered or unexported fields
}
func NewCollector ¶ added in v0.0.44
func NewCollector(targetKey storebackend.Key, subscriptions *Subscriptions) *Collector
func (*Collector) GetUpdateChan ¶ added in v0.0.44
func (r *Collector) GetUpdateChan() chan struct{}
func (*Collector) StartSubscription ¶ added in v0.0.44
func (*Collector) StopSubscription ¶ added in v0.0.44
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) DeleteIntent ¶
func (*Context) DeleteSubscription ¶ added in v0.0.44
func (r *Context) DeleteSubscription(ctx context.Context, sub *invv1alpha1.Subscription) error
func (*Context) GetAddress ¶
func (*Context) GetBlameConfig ¶ added in v0.0.52
func (r *Context) GetBlameConfig(ctx context.Context, key storebackend.Key) (*config.ConfigBlame, error)
func (*Context) GetDSClient ¶ added in v0.0.50
func (*Context) GetData ¶
func (r *Context) GetData(ctx context.Context, key storebackend.Key) (*config.RunningConfig, error)
func (*Context) GetDataStore ¶
func (r *Context) GetDataStore(ctx context.Context, in *sdcpb.GetDataStoreRequest, opts ...grpc.CallOption) (*sdcpb.GetDataStoreResponse, error)
func (*Context) GetPrombLabels ¶ added in v0.0.44
func (*Context) GetSchema ¶
func (r *Context) GetSchema() *config.ConfigStatusLastKnownGoodSchema
func (*Context) IsConfigRecovered ¶ added in v0.0.50
func (*Context) RecoverIntents ¶ added in v0.0.47
func (*Context) SetIntents ¶ added in v0.0.47
func (*Context) SetNotReady ¶ added in v0.0.43
func (*Context) SetRecoveredConfigs ¶ added in v0.0.50
func (*Context) TransactionSet ¶ added in v0.0.47
func (*Context) UpsertSubscription ¶ added in v0.0.44
func (r *Context) UpsertSubscription(ctx context.Context, sub *invv1alpha1.Subscription) error
type DeviationWatcher ¶
type DeviationWatcher struct {
// contains filtered or unexported fields
}
func NewDeviationWatcher ¶
func NewDeviationWatcher(targetKey storebackend.Key, client client.Client, dsclient dsclient.Client) *DeviationWatcher
func (*DeviationWatcher) Start ¶
func (r *DeviationWatcher) Start(ctx context.Context)
func (*DeviationWatcher) Stop ¶
func (r *DeviationWatcher) Stop(ctx context.Context)
type LookupError ¶ added in v0.0.28
var TargetLookupErr *LookupError
func (*LookupError) Error ¶ added in v0.0.50
func (e *LookupError) Error() string
func (*LookupError) Unwrap ¶ added in v0.0.50
func (e *LookupError) Unwrap() error
type MockContext ¶ added in v0.0.47
type PathSubscriptions ¶ added in v0.0.44
type PathSubscriptions struct { Current *Subscription // AllSubscriptions list all the subscriptions that are in the system, the key is name of the subscription CR AllSubscriptions map[string]*Subscription }
type Subscription ¶ added in v0.0.44
type Subscriptions ¶ added in v0.0.44
type Subscriptions struct {
Paths store.Storer[*PathSubscriptions]
}
func NewSubscriptions ¶ added in v0.0.44
func NewSubscriptions() *Subscriptions
func (*Subscriptions) AddSubscription ¶ added in v0.0.44
func (r *Subscriptions) AddSubscription(subscription *invv1alpha1.Subscription) error
Add or update a subscription
func (*Subscriptions) DelSubscription ¶ added in v0.0.44
func (r *Subscriptions) DelSubscription(subscription *invv1alpha1.Subscription) error
func (*Subscriptions) GetPaths ¶ added in v0.0.44
func (r *Subscriptions) GetPaths() map[invv1alpha1.Encoding][]Path
func (*Subscriptions) HasSubscriptions ¶ added in v0.0.44
func (r *Subscriptions) HasSubscriptions() bool
type TargetHandler ¶ added in v0.0.27
type TargetHandler interface { GetTargetContext(ctx context.Context, targetKey types.NamespacedName) (*invv1alpha1.Target, *Context, error) SetIntent(ctx context.Context, targetKey types.NamespacedName, config *config.Config, dryRun bool) (*config.ConfigStatusLastKnownGoodSchema, string, error) DeleteIntent(ctx context.Context, targetKey types.NamespacedName, config *config.Config, dryRun bool) (string, error) GetData(ctx context.Context, targetKey types.NamespacedName) (*config.RunningConfig, error) RecoverIntents(ctx context.Context, targetKey types.NamespacedName, configs []*config.Config) (*config.ConfigStatusLastKnownGoodSchema, string, error) SetIntents(ctx context.Context, targetKey types.NamespacedName, transactionID string, configs, deleteConfigs []*config.Config, dryRun bool) (*config.ConfigStatusLastKnownGoodSchema, string, error) Confirm(ctx context.Context, targetKey types.NamespacedName, transactionID string) error Cancel(ctx context.Context, targetKey types.NamespacedName, transactionID string) error GetBlameConfig(ctx context.Context, targetKey types.NamespacedName) (*config.ConfigBlame, error) }
func NewMockTargetHandler ¶ added in v0.0.47
func NewMockTargetHandler(targetStore storebackend.Storer[*MockContext]) TargetHandler
func NewTargetHandler ¶ added in v0.0.27
func NewTargetHandler(client client.Client, targetStore storebackend.Storer[*Context]) TargetHandler
type TransactionError ¶ added in v0.0.47
TransactionError represents an error with recoverability classification
func (*TransactionError) Error ¶ added in v0.0.47
func (e *TransactionError) Error() string
Click to show internal directories.
Click to hide internal directories.