package
2.5.1+incompatible
Repository: https://github.com/lxlee1102/vpp-agent.git
Documentation: pkg.go.dev
# Functions
ErrInvalidMetadataType is returned to scheduler by auto-generated descriptor adapter when value metadata does not match expected type.
ErrInvalidValueType is returned to scheduler by auto-generated descriptor adapter when value does not match expected type.
IsNonBlockingTxn returns true if transaction context is configured for non-blocking Commit.
IsResync returns true if the transaction context is configured to trigger resync.
IsWithDescription returns true if the transaction context is configured to include transaction description.
IsWithRetry returns true if transaction context is configured to allow retry, including the option parameters, or nil if retry is not enabled.
IsWithRevert returns true if the transaction context is configured to revert transaction if any of its operations fails.
IsWithSimulation returns true if transaction context is configured to enable pre-execution simulation.
NewInvalidValueError is a constructor for invalid-value error.
NewTransactionError is a constructor for transaction error.
NewVerificationError is constructor for a verification error.
WithDescription prepares context for transaction that will have description provided.
WithoutBlocking prepares context for transaction that should be scheduled for execution without blocking the caller of the Commit() method.
WithResync prepares context for transaction that, based on the resync type, will trigger resync between the configuration states of NB, the agent and SB.
WithRetry prepares context for transaction for which the scheduler will retry any (retriable) failed operations after given <period>.
WithRetryDefault is a specialization of WithRetry, where retry parameters are set to default values.
WithRetryMaxCount is a specialization of WithRetry, where <period> and <expBackoff> are set to default values and the maximum number of retries can be customized.
WithRevert prepares context for transaction that will be reverted if any of its operations fails.
WithSimulation enables simulation of txn operations, which is triggered before execution to obtain the sequence of intended operations without actually calling any CRUD operations and assuming no failures.
# Constants
CachedView means to obtain the kvscheduler's current view of SB.
DownstreamResync resynchronizes the agent with SB.
ExpectedToExist marks verification error returned when configured (non-nil) value is not found by the refresh.
ExpectedToNotExist marks verification error returned when removed (nil) value is found by the refresh to still exist.
FromNB marks value created via NB transaction.
FromSB marks value not managed by NB - i.e.
FullResync resynchronizes the agent with both SB and NB.
NBTransaction is transaction from northbound.
NBView means to look at the key-value space from NB point of view, i.e.
NotEquivalent marks verification error returned when applied value is not equivalent with the refreshed value.
NotResync is the default value for ResyncType, used when resync is actually not enabled.
RetryFailedOps is a transaction re-trying failed operations from previous northbound transaction.
SBNotification is notification from southbound.
SBView means to look directly into SB via Retrieve methods of descriptors to learn the real and up-to-date state of the system.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UnknownOrigin is given to a retrieved value when it cannot be determined if the value was previously created by NB or not.
UpstreamResync resynchronizes the agent with NB.
ValueState_CONFIGURED marks value defined by NB and successfully configured.
ValueState_DISCOVERED marks NB value that was found (=retrieved) by refresh but not actually configured by the agent in this run.
ValueState_FAILED marks (NB) value for which the last executed operation returned an error.
ValueState_INVALID represents (NB) value that will not be configured because it has a logically invalid content as declared by the Validate method of the associated descriptor.
ValueState_MISSING is assigned to NB value that was configured but refresh found it to be missing.
ValueState_NONEXISTENT is assigned to value that was deleted or has never existed.
ValueState_OBTAINED marks value not managed by NB, instead created automatically or externally in SB.
ValueState_PENDING represents (NB) value that cannot be configured yet due to missing dependencies.
ValueState_REMOVED is assigned to NB value after it was removed or when it is being re-created.
ValueState_RETRYING marks unsucessfully applied (NB) value, for which, however, one or more attempts to fix the error by repeating the last operation are planned, and only if all the retries fail, the value will then transit to the FAILED state.
ValueState_UNIMPLEMENTED marks value received from NB that cannot be configured because there is no registered descriptor associated with it.
# Variables
DefaultRetryBackoff enables exponential back-off for retry delay.
DefaultRetryMaxCount limits the number of retries to 3 attempts at maximum.
DefaultRetryPeriod delays first retry by one second.
ErrClosedScheduler is returned when scheduler is closed during transaction execution.
ErrCombinedDownstreamResyncWithChange is returned when transaction combines downstream-resync with data changes.
ErrDescriptorExists is returned when the same descriptor is registered more than once.
ErrEscapedNetNs is returned when a descriptor changes the Linux network namespace but forgets to revert the change back before returning from the operation back to the scheduler.
ErrRevertNotSupportedWithResync is returned when transaction combines resync with revert.
ErrTxnQueueFull is returned when the queue of pending transactions is full.
ErrTxnWaitCanceled is returned when waiting for result of blocking transaction is canceled.
ErrUnimplementedCreate is returned when NB transaction attempts to Create value for which there is a descriptor, but Create operation is not implemented.
ErrUnimplementedDelete is returned when NB transaction attempts to Delete value for which there is a descriptor, but Delete operation is not implemented.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
AnyOfDependency defines a set of keys from which at least one must reference a created object for the dependency to be considered satisfied.
No description provided by the author
Dependency references another kv pair that must exist before the associated value can be created.
InvalidValueError can be used by descriptor for the Validate method to return validation error together with a list of invalid fields for further clarification.
KeyValuePair groups key with value.
KeyWithError stores error for a key whose value failed to get updated.
KVDescriptor teaches KVScheduler how to CRUD values under keys matched by KeySelector().
KVWithMetadata encapsulates key-value pair with metadata and the origin mark.
RecordedKVPair is used to record key-value pair.
RecordedTxn is used to record executed transaction.
RecordedTxnOp is used to record executed/planned transaction operation.
RetryOpt represents the *retry* transaction option.
TransactionError implements Error interface, wrapping all errors encountered during the processing of a single transaction.
No description provided by the author
VerificationError is returned by the scheduler for a transaction when an applied value does not match with the refreshed value.
# Interfaces
KVScheduler synchronizes the *desired* system state described by northbound (NB) components via transactions with the *actual* state of the southbound (SB).
Metadata are extra information carried alongside non-derived (base) value that descriptor may use for runtime attributes, secondary lookups, etc.
Txn represent a single transaction.
ValueProvider provides key/value data from different sources in system (NB, SB, KVProvider cache of SB).
# Type aliases
KeySelector is used to filter keys.
MetadataMapFactory can be used by descriptor to define a custom map associating value labels with value metadata, potentially extending the basic in-memory implementation (memNamedMapping) with secondary indexes, type-safe watch, etc.
RecordedTxnOps is a list of recorded executed/planned transaction operations.
RecordedTxns is a list of recorded transactions.
ResyncType is one of: Upstream, Downstream, Full.
No description provided by the author
TxnType differentiates between NB transaction, retry of failed operations and SB notification.
ValueOrigin is one of: FromNB, FromSB, UnknownOrigin.
No description provided by the author
No description provided by the author
View chooses from which point of view to look at the key-value space when retrieving values.