Documentation
¶
Index ¶
- Variables
- func ApplyCacheUpdateFilters(u *Update, fs []CacheUpdateFilter) bool
- func CacheUpdateFilterExcludeOwner(owner string) func(u *Update) bool
- func Map[T any](u UpdateSlice, f func(*Update) T) []T
- type CacheUpdateFilter
- type DeleteEntriesList
- type DeleteEntry
- type DeleteEntryImpl
- type DeviationEntry
- func (d *DeviationEntry) CurrentValue() *sdcpb.TypedValue
- func (d *DeviationEntry) ExpectedValue() *sdcpb.TypedValue
- func (d *DeviationEntry) IntentName() string
- func (d *DeviationEntry) Path() *sdcpb.Path
- func (d *DeviationEntry) Reason() DeviationReason
- func (d *DeviationEntry) SetCurrentValue(cv *sdcpb.TypedValue) *DeviationEntry
- func (d *DeviationEntry) SetExpectedValue(ev *sdcpb.TypedValue) *DeviationEntry
- func (d *DeviationEntry) String() string
- type DeviationReason
- type LeafEntry
- type LrefPath
- type LrefPathElem
- type LrefPathElemKeyValue
- type StatType
- type Update
- func (u *Update) DeepCopy() *Update
- func (u *Update) Equal(other *Update) bool
- func (u *Update) Owner() string
- func (u *Update) Path() *sdcpb.Path
- func (u *Update) Priority() int32
- func (u *Update) SetOwner(owner string) *Update
- func (u *Update) SetPriority(prio int32) *Update
- func (u *Update) String() string
- func (u *Update) Timestamp() int64
- func (u *Update) ToSdcpbUpdate() *sdcpb.Update
- func (u *Update) Value() *sdcpb.TypedValue
- func (u *Update) ValueAsBytes() ([]byte, error)
- type UpdateInsertFlags
- func (f *UpdateInsertFlags) Apply(le LeafEntry) *UpdateInsertFlags
- func (f *UpdateInsertFlags) GetDeleteFlag() bool
- func (f *UpdateInsertFlags) GetDeleteOnlyIntendedFlag() bool
- func (f *UpdateInsertFlags) GetExplicitDeleteFlag() bool
- func (f *UpdateInsertFlags) GetNewFlag() bool
- func (f *UpdateInsertFlags) SetDeleteFlag() *UpdateInsertFlags
- func (f *UpdateInsertFlags) SetDeleteOnlyUpdatedFlag() *UpdateInsertFlags
- func (f *UpdateInsertFlags) SetExplicitDeleteFlag() *UpdateInsertFlags
- func (f *UpdateInsertFlags) SetNewFlag() *UpdateInsertFlags
- func (f *UpdateInsertFlags) String() string
- type UpdateSlice
- func (u UpdateSlice) CopyWithNewOwnerAndPrio(owner string, prio int32) UpdateSlice
- func (u UpdateSlice) DeepCopy() UpdateSlice
- func (u UpdateSlice) GetFirstPriorityValue() int32
- func (u UpdateSlice) GetLowestPriorityValue(filters []CacheUpdateFilter) int32
- func (u UpdateSlice) String() string
- func (u UpdateSlice) ToSdcpbPathSet() *sdcpb.PathSet
- type ValidationResultEntry
- type ValidationResultEntryType
- type ValidationResultIntent
- func (v *ValidationResultIntent) AddEntry(x *ValidationResultEntry)
- func (v *ValidationResultIntent) AddError(err error)
- func (v *ValidationResultIntent) AddWarning(warn error)
- func (v *ValidationResultIntent) Errors() []error
- func (v *ValidationResultIntent) ErrorsString() []string
- func (v *ValidationResultIntent) String() string
- func (v *ValidationResultIntent) Warnings() []error
- func (v *ValidationResultIntent) WarningsString() []string
- type ValidationResults
- func (v ValidationResults) AddEntry(e *ValidationResultEntry) error
- func (v ValidationResults) AddIntent(intentName string)
- func (v ValidationResults) ErrorsStr() []string
- func (v ValidationResults) HasErrors() bool
- func (v ValidationResults) HasWarnings() bool
- func (v ValidationResults) JoinErrors() error
- func (v ValidationResults) JoinWarnings() error
- func (v ValidationResults) String() string
- func (v ValidationResults) WarningsStr() []string
- type ValidationStats
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ApplyCacheUpdateFilters ¶
func ApplyCacheUpdateFilters(u *Update, fs []CacheUpdateFilter) bool
ApplyCacheUpdateFilters takes a bunch of CacheUpdateFilters applies them in an AND fashion and returns the result.
func Map ¶
func Map[T any](u UpdateSlice, f func(*Update) T) []T
Types ¶
type CacheUpdateFilter ¶
type DeleteEntriesList ¶
type DeleteEntriesList []DeleteEntry
func (DeleteEntriesList) SdcpbPaths ¶ added in v0.0.64
func (d DeleteEntriesList) SdcpbPaths() sdcpb.Paths
type DeleteEntry ¶
type DeleteEntryImpl ¶
type DeleteEntryImpl struct {
// contains filtered or unexported fields
}
DeleteEntryImpl is a crutch to flag oldbestcases if on a choice, the active case changed
func NewDeleteEntryImpl ¶
func NewDeleteEntryImpl(sdcpbPath *sdcpb.Path) *DeleteEntryImpl
func (*DeleteEntryImpl) SdcpbPath ¶
func (d *DeleteEntryImpl) SdcpbPath() *sdcpb.Path
type DeviationEntry ¶
type DeviationEntry struct {
// contains filtered or unexported fields
}
func NewDeviationEntry ¶
func NewDeviationEntry(intentName string, reason DeviationReason, path *sdcpb.Path) *DeviationEntry
func (*DeviationEntry) CurrentValue ¶
func (d *DeviationEntry) CurrentValue() *sdcpb.TypedValue
func (*DeviationEntry) ExpectedValue ¶
func (d *DeviationEntry) ExpectedValue() *sdcpb.TypedValue
func (*DeviationEntry) IntentName ¶
func (d *DeviationEntry) IntentName() string
func (*DeviationEntry) Path ¶
func (d *DeviationEntry) Path() *sdcpb.Path
func (*DeviationEntry) Reason ¶
func (d *DeviationEntry) Reason() DeviationReason
func (*DeviationEntry) SetCurrentValue ¶
func (d *DeviationEntry) SetCurrentValue(cv *sdcpb.TypedValue) *DeviationEntry
func (*DeviationEntry) SetExpectedValue ¶
func (d *DeviationEntry) SetExpectedValue(ev *sdcpb.TypedValue) *DeviationEntry
func (*DeviationEntry) String ¶ added in v0.0.58
func (d *DeviationEntry) String() string
type DeviationReason ¶
type DeviationReason int
const ( DeviationReasonUndefined DeviationReason = iota DeviationReasonUnhandled DeviationReasonNotApplied DeviationReasonOverruled DeviationReasonIntentExists )
type LeafEntry ¶
type LeafEntry interface { MarkDelete(onlyIntended bool) MarkExpliciteDelete() MarkNew() }
type LrefPath ¶ added in v0.0.58
type LrefPath []*LrefPathElem
LrefPath for the leafref resolution we need to distinguish between already resolved values and not yet resolved xpath statements this is a struct that provides this information
func NewLrefPath ¶ added in v0.0.58
func (LrefPath) ToSdcpbPathElem ¶ added in v0.0.58
type LrefPathElem ¶ added in v0.0.58
type LrefPathElem struct { Name string Keys map[string]*LrefPathElemKeyValue }
func (*LrefPathElem) KeysToMap ¶ added in v0.0.58
func (l *LrefPathElem) KeysToMap() map[string]string
type LrefPathElemKeyValue ¶ added in v0.0.58
type Update ¶
type Update struct {
// contains filtered or unexported fields
}
func (*Update) Equal ¶
EqualSkipPath checks the equality of two updates. It however skips comparing paths and timestamps. This is a shortcut for performace, for cases in which it is already clear that the path is definately equal.
func (*Update) SetPriority ¶
func (*Update) ToSdcpbUpdate ¶ added in v0.0.64
func (*Update) Value ¶
func (u *Update) Value() *sdcpb.TypedValue
func (*Update) ValueAsBytes ¶
type UpdateInsertFlags ¶
type UpdateInsertFlags struct {
// contains filtered or unexported fields
}
func NewUpdateInsertFlags ¶
func NewUpdateInsertFlags() *UpdateInsertFlags
NewUpdateInsertFlags returns a new *UpdateInsertFlags instance with all values set to false, so not new, and not marked for deletion
func (*UpdateInsertFlags) Apply ¶
func (f *UpdateInsertFlags) Apply(le LeafEntry) *UpdateInsertFlags
func (*UpdateInsertFlags) GetDeleteFlag ¶
func (f *UpdateInsertFlags) GetDeleteFlag() bool
func (*UpdateInsertFlags) GetDeleteOnlyIntendedFlag ¶
func (f *UpdateInsertFlags) GetDeleteOnlyIntendedFlag() bool
func (*UpdateInsertFlags) GetExplicitDeleteFlag ¶ added in v0.0.63
func (f *UpdateInsertFlags) GetExplicitDeleteFlag() bool
func (*UpdateInsertFlags) GetNewFlag ¶
func (f *UpdateInsertFlags) GetNewFlag() bool
func (*UpdateInsertFlags) SetDeleteFlag ¶
func (f *UpdateInsertFlags) SetDeleteFlag() *UpdateInsertFlags
func (*UpdateInsertFlags) SetDeleteOnlyUpdatedFlag ¶
func (f *UpdateInsertFlags) SetDeleteOnlyUpdatedFlag() *UpdateInsertFlags
func (*UpdateInsertFlags) SetExplicitDeleteFlag ¶ added in v0.0.63
func (f *UpdateInsertFlags) SetExplicitDeleteFlag() *UpdateInsertFlags
func (*UpdateInsertFlags) SetNewFlag ¶
func (f *UpdateInsertFlags) SetNewFlag() *UpdateInsertFlags
func (*UpdateInsertFlags) String ¶ added in v0.0.63
func (f *UpdateInsertFlags) String() string
type UpdateSlice ¶
type UpdateSlice []*Update
UpdateSlice A slice of *Update, that defines additional helper functions.
func ExpandAndConvertIntent ¶
func ExpandAndConvertIntent(ctx context.Context, scb utils.SchemaClientBound, intentName string, priority int32, upds []*sdcpb.Update, ts int64) (UpdateSlice, error)
ExpandAndConvertIntent takes a slice of Updates ([]*sdcpb.Update) and converts it into a tree.UpdateSlice, that contains *treetypes.Updates.
func (UpdateSlice) CopyWithNewOwnerAndPrio ¶
func (u UpdateSlice) CopyWithNewOwnerAndPrio(owner string, prio int32) UpdateSlice
func (UpdateSlice) DeepCopy ¶
func (u UpdateSlice) DeepCopy() UpdateSlice
func (UpdateSlice) GetFirstPriorityValue ¶
func (u UpdateSlice) GetFirstPriorityValue() int32
GetFirstPriorityValue returns the priority of the first element or math.MaxInt32 if len() is zero
func (UpdateSlice) GetLowestPriorityValue ¶
func (u UpdateSlice) GetLowestPriorityValue(filters []CacheUpdateFilter) int32
GetHighesPriorityValue returns the highes priority value of all the containing Updates
func (UpdateSlice) String ¶
func (u UpdateSlice) String() string
func (UpdateSlice) ToSdcpbPathSet ¶ added in v0.0.64
func (u UpdateSlice) ToSdcpbPathSet() *sdcpb.PathSet
type ValidationResultEntry ¶
type ValidationResultEntry struct {
// contains filtered or unexported fields
}
func NewValidationResultEntry ¶
func NewValidationResultEntry(intentName string, message error, typ ValidationResultEntryType) *ValidationResultEntry
func (*ValidationResultEntry) String ¶ added in v0.0.58
func (v *ValidationResultEntry) String() string
type ValidationResultEntryType ¶
type ValidationResultEntryType int8
const ( ValidationResultEntryTypeError ValidationResultEntryType = iota ValidationResultEntryTypeWarning )
func (ValidationResultEntryType) String ¶ added in v0.0.58
func (v ValidationResultEntryType) String() string
type ValidationResultIntent ¶
type ValidationResultIntent struct {
// contains filtered or unexported fields
}
func NewValidationResultIntent ¶
func NewValidationResultIntent(intentName string) *ValidationResultIntent
func (*ValidationResultIntent) AddEntry ¶
func (v *ValidationResultIntent) AddEntry(x *ValidationResultEntry)
func (*ValidationResultIntent) AddError ¶
func (v *ValidationResultIntent) AddError(err error)
func (*ValidationResultIntent) AddWarning ¶
func (v *ValidationResultIntent) AddWarning(warn error)
func (*ValidationResultIntent) Errors ¶
func (v *ValidationResultIntent) Errors() []error
func (*ValidationResultIntent) ErrorsString ¶
func (v *ValidationResultIntent) ErrorsString() []string
func (*ValidationResultIntent) String ¶
func (v *ValidationResultIntent) String() string
func (*ValidationResultIntent) Warnings ¶
func (v *ValidationResultIntent) Warnings() []error
func (*ValidationResultIntent) WarningsString ¶
func (v *ValidationResultIntent) WarningsString() []string
type ValidationResults ¶
type ValidationResults map[string]*ValidationResultIntent
ValidationResults is map[string]*ValidationResultIntent so consider iterating via range
func (ValidationResults) AddEntry ¶
func (v ValidationResults) AddEntry(e *ValidationResultEntry) error
func (ValidationResults) AddIntent ¶
func (v ValidationResults) AddIntent(intentName string)
func (ValidationResults) ErrorsStr ¶
func (v ValidationResults) ErrorsStr() []string
func (ValidationResults) HasErrors ¶
func (v ValidationResults) HasErrors() bool
func (ValidationResults) HasWarnings ¶
func (v ValidationResults) HasWarnings() bool
func (ValidationResults) JoinErrors ¶
func (v ValidationResults) JoinErrors() error
func (ValidationResults) JoinWarnings ¶
func (v ValidationResults) JoinWarnings() error
func (ValidationResults) String ¶
func (v ValidationResults) String() string
func (ValidationResults) WarningsStr ¶
func (v ValidationResults) WarningsStr() []string
type ValidationStats ¶ added in v0.0.64
func NewValidationStats ¶ added in v0.0.64
func NewValidationStats() *ValidationStats
func (*ValidationStats) Add ¶ added in v0.0.64
func (v *ValidationStats) Add(t StatType, i uint32)
func (*ValidationStats) GetCounter ¶ added in v0.0.64
func (v *ValidationStats) GetCounter() map[StatType]uint32
GetCounter returns a snapshot of the counters as a plain map
func (*ValidationStats) String ¶ added in v0.0.64
func (v *ValidationStats) String() string
String returns a string representation of all counters