Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultValueExists(schema *sdcpb.SchemaElem) bool
- func DefaultValueRetrieve(ctx context.Context, schema *sdcpb.SchemaElem, path *sdcpb.Path) (*types.Update, error)
- func FilterDeleted(l *LeafEntry) bool
- func FilterDeletedNotExplicitDelete(l *LeafEntry) bool
- func FilterNew(l *LeafEntry) bool
- func FilterNonDeleted(l *LeafEntry) bool
- func FilterNonDeletedButNewOrUpdated(l *LeafEntry) bool
- func FilterUpdated(l *LeafEntry) bool
- func HighestPrecedenceFilterAll(le *LeafEntry) bool
- func HighestPrecedenceFilterWithoutDeleted(le *LeafEntry) bool
- func HighestPrecedenceFilterWithoutNew(le *LeafEntry) bool
- func LeafEntriesToUpdates(l []*LeafEntry) []*types.Update
- func NewEntry(ctx context.Context, parent Entry, pathElemName string, tc *TreeContext) (*sharedEntryAttributes, error)
- func Unfiltered(l *LeafEntry) bool
- type BlameConfigProcessor
- type BlameConfigProcessorConfig
- type BlameConfigTask
- type Collector
- type DeletePathPrio
- type DeletePathSet
- func (dp *DeletePathSet) Add(intentName string, prio int32, pathset *sdcpb.PathSet)
- func (dp *DeletePathSet) DeepCopy() *DeletePathSet
- func (dp *DeletePathSet) GetByIntentName(intentName string) *sdcpb.PathSet
- func (dp *DeletePathSet) Items() iter.Seq[*DeletePathPrio]
- func (dp *DeletePathSet) RemoveIntentDeletes(intentName string) *sdcpb.PathSet
- type DescendMethod
- type Entry
- type EntryMap
- type EntrySlice
- type ExplicitDeleteProcessor
- type ExplicitDeleteProcessorStat
- type ExplicitDeleteProcessorStatCollection
- type ExplicitDeleteTaskParameters
- type HighestPrecedenceFilter
- type ImportConfigProcessor
- type ImportConfigProcessorParams
- type LeafEntry
- func (l *LeafEntry) Compare(other *LeafEntry) int
- func (l *LeafEntry) DeepCopy(parentEntry Entry) *LeafEntry
- func (l *LeafEntry) DropDeleteFlag() *LeafEntry
- func (l *LeafEntry) Equal(other *LeafEntry) bool
- func (l *LeafEntry) GetDeleteFlag() bool
- func (l *LeafEntry) GetDeleteOnlyIntendedFlag() bool
- func (l *LeafEntry) GetEntry() Entry
- func (l *LeafEntry) GetExplicitDeleteFlag() bool
- func (l *LeafEntry) GetNewFlag() bool
- func (l *LeafEntry) GetUpdate() *types.Update
- func (l *LeafEntry) GetUpdateFlag() bool
- func (l *LeafEntry) MarkDelete(onlyIntended bool)
- func (l *LeafEntry) MarkExpliciteDelete()
- func (l *LeafEntry) MarkNew()
- func (l *LeafEntry) MarkUpdate(u *types.Update)
- func (l *LeafEntry) NonRevertive() bool
- func (l *LeafEntry) RemoveDeleteFlag() *LeafEntry
- func (l *LeafEntry) String() string
- type LeafEntryFilter
- type LeafVariantEntries
- type LeafVariantEntry
- type LeafVariantSlice
- func (lvs LeafVariantSlice) Equal(otherLvs LeafVariantSlice) (bool, error)
- func (lvs LeafVariantSlice) String() string
- func (lvs LeafVariantSlice) ToPathAndUpdateSlice() []*types.PathAndUpdate
- func (lvs LeafVariantSlice) ToSdcpbUpdateSlice() []*sdcpb.Update
- func (lvs LeafVariantSlice) ToUpdateSlice() types.UpdateSlice
- type LeafVariants
- func (lv *LeafVariants) Add(le *LeafEntry)
- func (lv *LeafVariants) AddExplicitDeleteEntry(intentName string, priority int32) *LeafEntry
- func (lv *LeafVariants) AddWithStats(le *LeafEntry, stats *types.ImportStats)
- func (lv *LeafVariants) DeepCopy(tc *TreeContext, parent Entry) *LeafVariants
- func (lv *LeafVariants) DeleteByOwner(owner string) *LeafEntry
- func (lv *LeafVariants) GetByOwner(owner string) *LeafEntry
- func (lv *LeafVariants) GetDeviations(ctx context.Context, ch chan<- *types.DeviationEntry, isActiveCase bool)
- func (lv *LeafVariants) GetHighestPrecedence(onlyNewOrUpdated bool, includeDefaults bool, includeExplicitDelete bool) *LeafEntry
- func (lv *LeafVariants) GetHighestPrecedenceValue(filter HighestPrecedenceFilter) int32
- func (lv *LeafVariants) GetRunning() *LeafEntry
- func (lv *LeafVariants) Items() iter.Seq[*LeafEntry]
- func (lv *LeafVariants) Length() int
- func (lv *LeafVariants) MarkOwnerForDeletion(owner string, onlyIntended bool) *LeafEntry
- func (lv *LeafVariants) RemoveDeletedByOwner(owner string) *LeafEntry
- func (lv *LeafVariants) ResetFlags(deleteFlag bool, newFlag bool, updatedFlag bool) int
- type MarkOwnerDeleteProcessor
- type OwnerDeleteMarkerTaskConfig
- type RemoveDeletedProcessor
- type RemoveDeletedProcessorParameters
- type ResetFlagsProcessor
- type ResetFlagsProcessorParameters
- func (r *ResetFlagsProcessorParameters) GetAdjustedFlagsCount() int64
- func (r *ResetFlagsProcessorParameters) SetDeleteFlag() *ResetFlagsProcessorParameters
- func (r *ResetFlagsProcessorParameters) SetNewFlag() *ResetFlagsProcessorParameters
- func (r *ResetFlagsProcessorParameters) SetUpdateFlag() *ResetFlagsProcessorParameters
- type RootEntry
- func (s RootEntry) AddChild(ctx context.Context, e Entry) error
- func (s RootEntry) AddUpdateRecursive(ctx context.Context, path *sdcpb.Path, u *types.Update, ...) (Entry, error)
- func (r *RootEntry) AddUpdatesRecursive(ctx context.Context, us []*types.PathAndUpdate, flags *types.UpdateInsertFlags) error
- func (s RootEntry) BreadthSearch(ctx context.Context, sdcpbPath *sdcpb.Path) ([]Entry, error)
- func (s RootEntry) CanDeleteBranch(keepDefault bool) bool
- func (r *RootEntry) DeepCopy(ctx context.Context) (*RootEntry, error)
- func (s RootEntry) DeleteBranch(ctx context.Context, path *sdcpb.Path, owner string) error
- func (r *RootEntry) DeleteBranchPaths(ctx context.Context, deletes types.DeleteEntriesList, intentName string) error
- func (s RootEntry) DeleteCanDeleteChilds(keepDefault bool)
- func (s RootEntry) FilterChilds(keys map[string]string) ([]Entry, error)
- func (r *RootEntry) FinishInsertionPhase(ctx context.Context) error
- func (r *RootEntry) GetAncestorSchema() (*sdcpb.SchemaElem, int)
- func (s RootEntry) GetByOwner(owner string, result []*LeafEntry) LeafVariantSlice
- func (s RootEntry) GetChild(name string) (Entry, bool)
- func (s RootEntry) GetChilds(d types.DescendMethod) EntryMap
- func (r *RootEntry) GetDeletes(aggregatePaths bool) (types.DeleteEntriesList, error)
- func (r *RootEntry) GetDeletesForOwner(owner string) sdcpb.Paths
- func (r *RootEntry) GetDeviations(ctx context.Context, ch chan<- *types.DeviationEntry)
- func (s RootEntry) GetFirstAncestorWithSchema() (Entry, int)
- func (r *RootEntry) GetHighestPrecedence(onlyNewOrUpdated bool) LeafVariantSlice
- func (s RootEntry) GetLeafVariantEntries() LeafVariantEntries
- func (s RootEntry) GetLevel() int
- func (s RootEntry) GetListChilds() ([]Entry, error)
- func (s RootEntry) GetParent() Entry
- func (s RootEntry) GetRoot() Entry
- func (s RootEntry) GetRootBasedEntryChain() []Entry
- func (s RootEntry) GetSchema() *sdcpb.SchemaElem
- func (s RootEntry) GetSchemaKeys() []string
- func (s RootEntry) GetTreeContext() *TreeContext
- func (r *RootEntry) GetUpdatesForOwner(owner string) types.UpdateSlice
- func (s RootEntry) HoldsLeafvariants() bool
- func (r *RootEntry) ImportConfig(ctx context.Context, basePath *sdcpb.Path, ...) (*types.ImportStats, error)
- func (s RootEntry) IsRoot() bool
- func (s RootEntry) NavigateLeafRef(ctx context.Context) ([]Entry, error)
- func (s RootEntry) NavigateSdcpbPath(ctx context.Context, path *sdcpb.Path) (Entry, error)
- func (s RootEntry) PathName() string
- func (s RootEntry) RemainsToExist() bool
- func (s RootEntry) SdcpbPath() *sdcpb.Path
- func (r *RootEntry) SetNonRevertiveIntent(intentName string, nonRevertive bool)
- func (r *RootEntry) String() string
- func (s RootEntry) StringIndent(result []string) []string
- func (s RootEntry) ToJson(onlyNewOrUpdated bool) (any, error)
- func (s RootEntry) ToJsonIETF(onlyNewOrUpdated bool) (any, error)
- func (r *RootEntry) ToProtoDeletes(ctx context.Context) ([]*sdcpb.Path, error)
- func (r *RootEntry) ToProtoUpdates(ctx context.Context, onlyNewOrUpdated bool) ([]*sdcpb.Update, error)
- func (s RootEntry) ToXML(...) (*etree.Document, error)
- func (r *RootEntry) TreeExport(owner string, priority int32) (*tree_persist.Intent, error)
- func (r *RootEntry) Validate(ctx context.Context, vCfg *config.Validation, ...) (types.ValidationResults, *types.ValidationStats)
- func (s RootEntry) ValidateLevel(ctx context.Context, resultChan chan<- *types.ValidationResultEntry, ...)
- type RootTreeImport
- type TreeContext
- func (t *TreeContext) AddExplicitDeletes(intentName string, priority int32, pathset *sdcpb.PathSet)
- func (t *TreeContext) AddNonRevertiveInfo(intent string, nonRevertive bool)
- func (t *TreeContext) GetPoolFactory() pool.VirtualPoolFactory
- func (t *TreeContext) IsNonRevertiveIntent(intent string) bool
- func (t *TreeContext) RemoveExplicitDeletes(intentName string) *sdcpb.PathSet
- type ValidateProcessor
- type ValidateProcessorParameters
Constants ¶
Variables ¶
var (
ErrorIntentNotPresent = fmt.Errorf("intent not present")
)
var (
ValidationError = errors.New("validation error")
)
Functions ¶
func DefaultValueExists ¶ added in v0.0.56
func DefaultValueExists(schema *sdcpb.SchemaElem) bool
func DefaultValueRetrieve ¶ added in v0.0.56
func FilterDeleted ¶
FilterDeleted Accepts all Entries that are marked as deleted
func FilterDeletedNotExplicitDelete ¶ added in v0.0.63
func FilterNonDeleted ¶
FilterNonDeleted Accepts all Entries that are not marked as deleted
func FilterNonDeletedButNewOrUpdated ¶
FilterNonDeletedButNewOrUpdated Accepts all Entries that are New or Updated and not Deleted.
func FilterUpdated ¶
FilterUpdated Accepts all entries that are updates
func HighestPrecedenceFilterAll ¶ added in v0.0.56
func HighestPrecedenceFilterWithoutDeleted ¶ added in v0.0.56
func HighestPrecedenceFilterWithoutNew ¶ added in v0.0.56
func LeafEntriesToUpdates ¶ added in v0.0.56
LeafEntriesToCacheUpdates
func NewEntry ¶ added in v0.0.67
func NewEntry(ctx context.Context, parent Entry, pathElemName string, tc *TreeContext) (*sharedEntryAttributes, error)
NewEntry constructor for Entries
func Unfiltered ¶
Unfiltered accepts all entries without any filtering
Types ¶
type BlameConfigProcessor ¶ added in v0.0.67
type BlameConfigProcessor struct {
// contains filtered or unexported fields
}
func NewBlameConfigProcessor ¶ added in v0.0.67
func NewBlameConfigProcessor(config *BlameConfigProcessorConfig) *BlameConfigProcessor
func (*BlameConfigProcessor) Run ¶ added in v0.0.67
func (p *BlameConfigProcessor) Run(ctx context.Context, e Entry, pool pool.VirtualPoolI) (*sdcpb.BlameTreeElement, error)
Run processes the entry tree starting from e, building a blame tree showing which owner (intent) is responsible for each configuration value. The pool parameter should be VirtualFailFast to stop on first error. Returns the blame tree structure and any error encountered.
type BlameConfigProcessorConfig ¶ added in v0.0.67
type BlameConfigProcessorConfig struct {
// contains filtered or unexported fields
}
func NewBlameConfigProcessorConfig ¶ added in v0.0.67
func NewBlameConfigProcessorConfig(includeDefaults bool) *BlameConfigProcessorConfig
type BlameConfigTask ¶ added in v0.0.67
type BlameConfigTask struct {
// contains filtered or unexported fields
}
func NewBlameConfigTask ¶ added in v0.0.67
func NewBlameConfigTask(e Entry, c *BlameConfigProcessorConfig) *BlameConfigTask
type Collector ¶ added in v0.0.67
type Collector[T any] struct { // contains filtered or unexported fields }
Collector is a concurrent-safe, append-only collector for values of type T.
func NewCollector ¶ added in v0.0.67
NewCollector creates a Collector with a preallocated capacity. Pass 0 if you don't want to preallocate.
func (*Collector[T]) Append ¶ added in v0.0.67
func (c *Collector[T]) Append(x T)
Append appends one element to the collector.
type DeletePathPrio ¶ added in v0.0.63
type DeletePathPrio struct {
// contains filtered or unexported fields
}
func NewDeletePathPrio ¶ added in v0.0.63
func NewDeletePathPrio(owner string, prio int32) *DeletePathPrio
func (*DeletePathPrio) DeepCopy ¶ added in v0.0.63
func (ddp *DeletePathPrio) DeepCopy() *DeletePathPrio
func (*DeletePathPrio) GetOwner ¶ added in v0.0.63
func (dpp *DeletePathPrio) GetOwner() string
func (*DeletePathPrio) GetPathSet ¶ added in v0.0.63
func (dpp *DeletePathPrio) GetPathSet() *sdcpb.PathSet
func (*DeletePathPrio) GetPrio ¶ added in v0.0.63
func (dpp *DeletePathPrio) GetPrio() int32
type DeletePathSet ¶ added in v0.0.63
type DeletePathSet struct {
// contains filtered or unexported fields
}
func NewDeletePaths ¶ added in v0.0.63
func NewDeletePaths() *DeletePathSet
func (*DeletePathSet) Add ¶ added in v0.0.63
func (dp *DeletePathSet) Add(intentName string, prio int32, pathset *sdcpb.PathSet)
func (*DeletePathSet) DeepCopy ¶ added in v0.0.63
func (dp *DeletePathSet) DeepCopy() *DeletePathSet
func (*DeletePathSet) GetByIntentName ¶ added in v0.0.63
func (dp *DeletePathSet) GetByIntentName(intentName string) *sdcpb.PathSet
func (*DeletePathSet) Items ¶ added in v0.0.63
func (dp *DeletePathSet) Items() iter.Seq[*DeletePathPrio]
func (*DeletePathSet) RemoveIntentDeletes ¶ added in v0.0.63
func (dp *DeletePathSet) RemoveIntentDeletes(intentName string) *sdcpb.PathSet
type DescendMethod ¶ added in v0.0.63
type DescendMethod int
const ( DescendMethodAll DescendMethod = iota DescendMethodActiveChilds )
type Entry ¶
type Entry interface {
// PathName returns the last Path element, the name of the Entry
PathName() string
// GetLevel returns the depth of the Entry in the tree
GetLevel() int
// addChild Add a child entry
AddChild(context.Context, Entry) error
// AddUpdateRecursive Add the given cache.Update to the tree
AddUpdateRecursive(ctx context.Context, relativePath *sdcpb.Path, u *types.Update, flags *types.UpdateInsertFlags) (Entry, error)
// StringIndent debug tree struct as indented string slice
StringIndent(result []string) []string
// GetHighesPrio return the new cache.Update entried from the tree that are the highes priority.
// If the onlyNewOrUpdated option is set to true, only the New or Updated entries will be returned
// It will append to the given list and provide a new pointer to the slice
GetHighestPrecedence(result LeafVariantSlice, onlyNewOrUpdated bool, includeDefaults bool, includeExplicitDelete bool) LeafVariantSlice
// GetByOwner returns the branches Updates by owner
GetByOwner(owner string, result []*LeafEntry) LeafVariantSlice
// // markOwnerDelete Sets the delete flag on all the LeafEntries belonging to the given owner.
// MarkOwnerDelete(o string, onlyIntended bool)
// GetDeletes returns the cache-updates that are not updated, have no lower priority value left and hence should be deleted completely
GetDeletes(entries []types.DeleteEntry, aggregatePaths bool) ([]types.DeleteEntry, error)
// Validate kicks off validation
ValidateLevel(ctx context.Context, resultChan chan<- *types.ValidationResultEntry, stats *types.ValidationStats, vCfg *config.Validation)
// GetSchema returns the *sdcpb.SchemaElem of the Entry
GetSchema() *sdcpb.SchemaElem
// IsRoot returns true if the Entry is the root of the tree
IsRoot() bool
// FinishInsertionPhase indicates, that the insertion of Entries into the tree is over
// Hence calculations for e.g. choice/case can be performed.
FinishInsertionPhase(ctx context.Context) error
// GetParent returns the parent entry
GetParent() Entry
NavigateLeafRef(ctx context.Context) ([]Entry, error)
// GetFirstAncestorWithSchema returns the first parent node which has a schema set.
// if the parent has no schema (is a key element in the tree) it will recurs the call to the parents parent.
// the level of recursion is indicated via the levelUp attribute
GetFirstAncestorWithSchema() (ancestor Entry, levelUp int)
// SdcpbPath returns the sdcpb.Path struct for the Entry
SdcpbPath() *sdcpb.Path
// GetSchemaKeys checks for the schema of the entry, and returns the defined keys
GetSchemaKeys() []string
// GetRootBasedEntryChain returns all the entries starting from the root down to the actual Entry.
GetRootBasedEntryChain() []Entry
// GetRoot returns the Trees Root Entry
GetRoot() Entry
// remainsToExist indicates if a LeafEntry for this entry will survive the update.
// Since we add running to the tree, there will always be Entries, that will disappear in the
// as part of the SetIntent process. We need to consider this, when evaluating e.g. LeafRefs.
// The returned boolean will in indicate if the value remains existing (true) after the setintent.
// Or will disappear from device (running) as part of the update action.
RemainsToExist() bool
GetChilds(types.DescendMethod) EntryMap
GetChild(name string) (Entry, bool) // entry, exists
FilterChilds(keys map[string]string) ([]Entry, error)
// ToJson returns the Tree contained structure as JSON
// use e.g. json.MarshalIndent() on the returned struct
ToJson(onlyNewOrUpdated bool) (any, error)
// ToJsonIETF returns the Tree contained structure as JSON_IETF
// use e.g. json.MarshalIndent() on the returned struct
ToJsonIETF(onlyNewOrUpdated bool) (any, error)
// ToXML returns the tree and its current state in the XML representation used by netconf
ToXML(onlyNewOrUpdated bool, honorNamespace bool, operationWithNamespace bool, useOperationRemove bool) (*etree.Document, error)
TreeExport(owner string) ([]*tree_persist.TreeElement, error)
// DeleteBranch Deletes from the tree, all elements of the PathSlice defined branch of the given owner
DeleteBranch(ctx context.Context, path *sdcpb.Path, owner string) (err error)
GetDeviations(ctx context.Context, ch chan<- *types.DeviationEntry, activeCase bool)
// GetListChilds collects all the childs of the list. In the tree we store them seperated into their key branches.
// this is collecting all the last level key entries.
GetListChilds() ([]Entry, error)
BreadthSearch(ctx context.Context, path *sdcpb.Path) ([]Entry, error)
DeepCopy(tc *TreeContext, parent Entry) (Entry, error)
GetLeafVariantEntries() LeafVariantEntries
// returns true if the Entry contains leafvariants (presence container, field or leaflist)
HoldsLeafvariants() bool
CanDeleteBranch(keepDefault bool) bool
DeleteCanDeleteChilds(keepDefault bool)
GetTreeContext() *TreeContext
// contains filtered or unexported methods
}
Entry is the primary Element of the Tree.
type EntryMap ¶ added in v0.0.63
func (EntryMap) SortedKeys ¶ added in v0.0.67
type EntrySlice ¶ added in v0.0.44
type EntrySlice []Entry
type ExplicitDeleteProcessor ¶ added in v0.0.67
type ExplicitDeleteProcessor struct {
// contains filtered or unexported fields
}
func NewExplicitDeleteProcessor ¶ added in v0.0.67
func NewExplicitDeleteProcessor(params *ExplicitDeleteTaskParameters) *ExplicitDeleteProcessor
func (*ExplicitDeleteProcessor) GetCreatedExplicitDeleteLeafEntries ¶ added in v0.0.67
func (edp *ExplicitDeleteProcessor) GetCreatedExplicitDeleteLeafEntries() LeafVariantSlice
GetCreatedExplicitDeleteLeafEntries returns all the explicitDelete LeafVariants that where created.
func (*ExplicitDeleteProcessor) GetExplicitDeleteCreationCount ¶ added in v0.0.67
func (edp *ExplicitDeleteProcessor) GetExplicitDeleteCreationCount() int
GetExplicitDeleteCreationCount returns the amount of all the explicitDelete LeafVariants that where created.
func (*ExplicitDeleteProcessor) Run ¶ added in v0.0.67
func (p *ExplicitDeleteProcessor) Run(ctx context.Context, e Entry, poolFactory pool.VirtualPoolFactory) error
type ExplicitDeleteProcessorStat ¶ added in v0.0.67
type ExplicitDeleteProcessorStat interface {
GetCreatedExplicitDeleteLeafEntries() LeafVariantSlice
GetExplicitDeleteCreationCount() int
}
Stats structs
type ExplicitDeleteProcessorStatCollection ¶ added in v0.0.67
type ExplicitDeleteProcessorStatCollection map[string]ExplicitDeleteProcessorStat
func (ExplicitDeleteProcessorStatCollection) ContainsEntries ¶ added in v0.0.67
func (e ExplicitDeleteProcessorStatCollection) ContainsEntries() bool
func (ExplicitDeleteProcessorStatCollection) Count ¶ added in v0.0.67
func (e ExplicitDeleteProcessorStatCollection) Count() int
func (ExplicitDeleteProcessorStatCollection) Stats ¶ added in v0.0.67
func (e ExplicitDeleteProcessorStatCollection) Stats() map[string]int
type ExplicitDeleteTaskParameters ¶ added in v0.0.67
type ExplicitDeleteTaskParameters struct {
// contains filtered or unexported fields
}
func NewExplicitDeleteTaskParameters ¶ added in v0.0.67
func NewExplicitDeleteTaskParameters(owner string, priority int32) *ExplicitDeleteTaskParameters
type HighestPrecedenceFilter ¶ added in v0.0.56
type ImportConfigProcessor ¶ added in v0.0.67
type ImportConfigProcessor struct {
// contains filtered or unexported fields
}
func NewImportConfigProcessor ¶ added in v0.0.67
func NewImportConfigProcessor(importer treeimporter.ImportConfigAdapter, insertFlags *types.UpdateInsertFlags) *ImportConfigProcessor
func (*ImportConfigProcessor) GetStats ¶ added in v0.0.67
func (p *ImportConfigProcessor) GetStats() *types.ImportStats
func (*ImportConfigProcessor) Run ¶ added in v0.0.67
func (p *ImportConfigProcessor) Run(ctx context.Context, e Entry, poolFactory pool.VirtualPoolFactory) error
type ImportConfigProcessorParams ¶ added in v0.0.67
type ImportConfigProcessorParams struct {
// contains filtered or unexported fields
}
func NewParameters ¶ added in v0.0.67
func NewParameters( intentName string, intentPrio int32, insertFlags *types.UpdateInsertFlags, treeContext *TreeContext, leafListLock *sync.Map, stats *types.ImportStats, ) *ImportConfigProcessorParams
type LeafEntry ¶
type LeafEntry struct {
*types.Update
IsNew bool
Delete bool
DeleteOnlyIntended bool
IsUpdated bool
IsExplicitDelete bool
// contains filtered or unexported fields
}
LeafEntry stores the *cache.Update along with additional attributes. These Attributes indicate if the entry is to be deleted / added (new) or updated.
func NewLeafEntry ¶
NewLeafEntry constructor for a new LeafEntry
func (*LeafEntry) Compare ¶ added in v0.0.63
Compare used for slices.SortFunc. Sorts by path and if equal paths then by owner as the second criteria
func (*LeafEntry) DropDeleteFlag ¶ added in v0.0.50
func (*LeafEntry) GetDeleteFlag ¶ added in v0.0.50
func (*LeafEntry) GetDeleteOnlyIntendedFlag ¶ added in v0.0.54
func (*LeafEntry) GetExplicitDeleteFlag ¶ added in v0.0.63
func (*LeafEntry) GetNewFlag ¶ added in v0.0.50
func (*LeafEntry) GetUpdateFlag ¶ added in v0.0.50
func (*LeafEntry) MarkDelete ¶
MarkDelete indicate that the entry is to be deleted
func (*LeafEntry) MarkExpliciteDelete ¶ added in v0.0.63
func (l *LeafEntry) MarkExpliciteDelete()
MarkExpliciteDelete indicate that the entry is to be explicitely deleted
func (*LeafEntry) MarkUpdate ¶
MarkUpdate indicate that the entry is an Updated value
func (*LeafEntry) NonRevertive ¶ added in v0.0.67
func (*LeafEntry) RemoveDeleteFlag ¶ added in v0.0.61
type LeafEntryFilter ¶
type LeafVariantEntries ¶ added in v0.0.63
type LeafVariantEntries interface {
MarkOwnerForDeletion(owner string, onlyIntended bool) *LeafEntry
ResetFlags(deleteFlag bool, newFlag bool, updatedFlag bool) int
GetHighestPrecedence(onlyNewOrUpdated bool, includeDefaults bool, includeExplicitDeletes bool) *LeafEntry
GetRunning() *LeafEntry
DeleteByOwner(owner string) *LeafEntry
AddExplicitDeleteEntry(owner string, priority int32) *LeafEntry
GetByOwner(owner string) *LeafEntry
RemoveDeletedByOwner(owner string) *LeafEntry
Add(l *LeafEntry)
AddWithStats(l *LeafEntry, stats *types.ImportStats)
Length() int
}
type LeafVariantEntry ¶ added in v0.0.63
type LeafVariantSlice ¶ added in v0.0.42
type LeafVariantSlice []*LeafEntry
func (LeafVariantSlice) Equal ¶ added in v0.0.63
func (lvs LeafVariantSlice) Equal(otherLvs LeafVariantSlice) (bool, error)
Equal checks equality of the LeafVariantSlice with the other LeafVariantSlice
func (LeafVariantSlice) String ¶ added in v0.0.63
func (lvs LeafVariantSlice) String() string
func (LeafVariantSlice) ToPathAndUpdateSlice ¶ added in v0.0.66
func (lvs LeafVariantSlice) ToPathAndUpdateSlice() []*types.PathAndUpdate
func (LeafVariantSlice) ToSdcpbUpdateSlice ¶ added in v0.0.64
func (lvs LeafVariantSlice) ToSdcpbUpdateSlice() []*sdcpb.Update
func (LeafVariantSlice) ToUpdateSlice ¶ added in v0.0.56
func (lvs LeafVariantSlice) ToUpdateSlice() types.UpdateSlice
type LeafVariants ¶
type LeafVariants struct {
// contains filtered or unexported fields
}
func (*LeafVariants) Add ¶ added in v0.0.50
func (lv *LeafVariants) Add(le *LeafEntry)
func (*LeafVariants) AddExplicitDeleteEntry ¶ added in v0.0.63
func (lv *LeafVariants) AddExplicitDeleteEntry(intentName string, priority int32) *LeafEntry
func (*LeafVariants) AddWithStats ¶ added in v0.0.67
func (lv *LeafVariants) AddWithStats(le *LeafEntry, stats *types.ImportStats)
func (*LeafVariants) DeepCopy ¶ added in v0.0.56
func (lv *LeafVariants) DeepCopy(tc *TreeContext, parent Entry) *LeafVariants
func (*LeafVariants) DeleteByOwner ¶ added in v0.0.56
func (lv *LeafVariants) DeleteByOwner(owner string) *LeafEntry
func (*LeafVariants) GetByOwner ¶
func (lv *LeafVariants) GetByOwner(owner string) *LeafEntry
GetByOwner returns the entry that is owned by the given owner, returns nil if no entry exists.
func (*LeafVariants) GetDeviations ¶ added in v0.0.56
func (lv *LeafVariants) GetDeviations(ctx context.Context, ch chan<- *types.DeviationEntry, isActiveCase bool)
func (*LeafVariants) GetHighestPrecedence ¶
func (lv *LeafVariants) GetHighestPrecedence(onlyNewOrUpdated bool, includeDefaults bool, includeExplicitDelete bool) *LeafEntry
GetHighesNewUpdated returns the LeafEntry with the highes priority nil if no leaf entry exists.
func (*LeafVariants) GetHighestPrecedenceValue ¶
func (lv *LeafVariants) GetHighestPrecedenceValue(filter HighestPrecedenceFilter) int32
func (*LeafVariants) GetRunning ¶ added in v0.0.60
func (lv *LeafVariants) GetRunning() *LeafEntry
func (*LeafVariants) Items ¶ added in v0.0.49
func (lv *LeafVariants) Items() iter.Seq[*LeafEntry]
Items iterator for the LeafVariants
func (*LeafVariants) Length ¶ added in v0.0.49
func (lv *LeafVariants) Length() int
func (*LeafVariants) MarkOwnerForDeletion ¶ added in v0.0.56
func (lv *LeafVariants) MarkOwnerForDeletion(owner string, onlyIntended bool) *LeafEntry
MarkOwnerForDeletion searches for a LefVariant of given owner, if it exists the entry is marked for deletion. returning the leafentry if an owner entry was found, nil if not.
func (*LeafVariants) RemoveDeletedByOwner ¶ added in v0.0.67
func (lv *LeafVariants) RemoveDeletedByOwner(owner string) *LeafEntry
RemoveDeletedByOwner removes and returns the LeafEntry owned by the given owner if it is marked for deletion.
func (*LeafVariants) ResetFlags ¶ added in v0.0.67
func (lv *LeafVariants) ResetFlags(deleteFlag bool, newFlag bool, updatedFlag bool) int
type MarkOwnerDeleteProcessor ¶ added in v0.0.67
type MarkOwnerDeleteProcessor struct {
// contains filtered or unexported fields
}
func NewOwnerDeleteMarker ¶ added in v0.0.67
func NewOwnerDeleteMarker(c *OwnerDeleteMarkerTaskConfig) *MarkOwnerDeleteProcessor
func (*MarkOwnerDeleteProcessor) Run ¶ added in v0.0.67
func (p *MarkOwnerDeleteProcessor) Run(e Entry, poolFactory pool.VirtualPoolFactory) error
Run processes the entry tree starting from e, marking leaf variant entries for deletion by the specified owner. The pool parameter should be VirtualFailFast to stop on first error. Returns the first error encountered, or nil if successful.
type OwnerDeleteMarkerTaskConfig ¶ added in v0.0.67
type OwnerDeleteMarkerTaskConfig struct {
// contains filtered or unexported fields
}
func NewOwnerDeleteMarkerTaskConfig ¶ added in v0.0.67
func NewOwnerDeleteMarkerTaskConfig(owner string, onlyIntended bool) *OwnerDeleteMarkerTaskConfig
type RemoveDeletedProcessor ¶ added in v0.0.67
type RemoveDeletedProcessor struct {
// contains filtered or unexported fields
}
func NewRemoveDeletedProcessor ¶ added in v0.0.67
func NewRemoveDeletedProcessor(c *RemoveDeletedProcessorParameters) *RemoveDeletedProcessor
func (*RemoveDeletedProcessor) Run ¶ added in v0.0.67
func (p *RemoveDeletedProcessor) Run(e Entry, poolFactory pool.VirtualPoolFactory) error
Run processes the entry tree starting from e, removing leaf variant entries marked for deletion by the specified owner. The pool parameter should be VirtualFailFast to stop on first error. Returns the first error encountered, or nil if successful.
type RemoveDeletedProcessorParameters ¶ added in v0.0.67
type RemoveDeletedProcessorParameters struct {
// contains filtered or unexported fields
}
func NewRemoveDeletedProcessorParameters ¶ added in v0.0.67
func NewRemoveDeletedProcessorParameters(owner string) *RemoveDeletedProcessorParameters
func (*RemoveDeletedProcessorParameters) GetDeleteStatsCount ¶ added in v0.0.67
func (r *RemoveDeletedProcessorParameters) GetDeleteStatsCount() int64
func (*RemoveDeletedProcessorParameters) GetZeroLengthLeafVariantEntries ¶ added in v0.0.67
func (r *RemoveDeletedProcessorParameters) GetZeroLengthLeafVariantEntries() []Entry
GetZeroLengthLeafVariantEntries returns the entries that have zero-length leaf variant entries after removal
type ResetFlagsProcessor ¶ added in v0.0.67
type ResetFlagsProcessor struct {
// contains filtered or unexported fields
}
ResetFlagsProcessor resets the flags on leaf variant entries
func NewResetFlagsProcessor ¶ added in v0.0.67
func NewResetFlagsProcessor(c *ResetFlagsProcessorParameters) *ResetFlagsProcessor
func (*ResetFlagsProcessor) Run ¶ added in v0.0.67
func (p *ResetFlagsProcessor) Run(e Entry, poolFactory pool.VirtualPoolFactory) error
Run processes the entry tree starting from e, resetting flags on all leaf variant entries according to the processor configuration. The pool parameter can be either VirtualFailFast (stops on first error) or VirtualTolerant (collects all errors). Returns the first error for fail-fast pools, or a combined error for tolerant pools.
type ResetFlagsProcessorParameters ¶ added in v0.0.67
type ResetFlagsProcessorParameters struct {
// contains filtered or unexported fields
}
func NewResetFlagsProcessorParameters ¶ added in v0.0.67
func NewResetFlagsProcessorParameters() *ResetFlagsProcessorParameters
func (*ResetFlagsProcessorParameters) GetAdjustedFlagsCount ¶ added in v0.0.67
func (r *ResetFlagsProcessorParameters) GetAdjustedFlagsCount() int64
GetAdjustedFlagsCount returns the number of flags that were adjusted
func (*ResetFlagsProcessorParameters) SetDeleteFlag ¶ added in v0.0.67
func (r *ResetFlagsProcessorParameters) SetDeleteFlag() *ResetFlagsProcessorParameters
func (*ResetFlagsProcessorParameters) SetNewFlag ¶ added in v0.0.67
func (r *ResetFlagsProcessorParameters) SetNewFlag() *ResetFlagsProcessorParameters
func (*ResetFlagsProcessorParameters) SetUpdateFlag ¶ added in v0.0.67
func (r *ResetFlagsProcessorParameters) SetUpdateFlag() *ResetFlagsProcessorParameters
type RootEntry ¶
type RootEntry struct {
// contains filtered or unexported fields
}
RootEntry the root of the cache.Update tree
func NewTreeRoot ¶
func NewTreeRoot(ctx context.Context, tc *TreeContext) (*RootEntry, error)
NewTreeRoot Instantiate a new Tree Root element.
func (RootEntry) AddChild ¶ added in v0.0.67
AddChild add an entry to the list of child entries for the entry.
func (RootEntry) AddUpdateRecursive ¶ added in v0.0.56
func (s RootEntry) AddUpdateRecursive(ctx context.Context, path *sdcpb.Path, u *types.Update, flags *types.UpdateInsertFlags) (Entry, error)
AddUpdateRecursive recursively adds the given cache.Update to the tree. Thereby creating all the entries along the path. if the entries along th path already exist, the existing entries are called to add the Update.
func (*RootEntry) AddUpdatesRecursive ¶ added in v0.0.56
func (r *RootEntry) AddUpdatesRecursive(ctx context.Context, us []*types.PathAndUpdate, flags *types.UpdateInsertFlags) error
func (RootEntry) BreadthSearch ¶ added in v0.0.56
func (RootEntry) CanDeleteBranch ¶ added in v0.0.67
func (RootEntry) DeleteBranch ¶ added in v0.0.62
func (*RootEntry) DeleteBranchPaths ¶ added in v0.0.62
func (r *RootEntry) DeleteBranchPaths(ctx context.Context, deletes types.DeleteEntriesList, intentName string) error
DeleteSubtree Deletes from the tree, all elements of the PathSlice defined branch of the given owner. Return values are remainsToExist and error if an error occured.
func (RootEntry) DeleteCanDeleteChilds ¶ added in v0.0.67
func (s RootEntry) DeleteCanDeleteChilds(keepDefault bool)
func (RootEntry) FilterChilds ¶ added in v0.0.43
FilterChilds returns the child entries (skipping the key entries in the tree) that match the given keys. The keys do not need to match all levels of keys, in which case the key level is considered a wildcard match (*)
func (*RootEntry) FinishInsertionPhase ¶
func (*RootEntry) GetAncestorSchema ¶
func (r *RootEntry) GetAncestorSchema() (*sdcpb.SchemaElem, int)
func (RootEntry) GetByOwner ¶
func (s RootEntry) GetByOwner(owner string, result []*LeafEntry) LeafVariantSlice
GetByOwner returns all the LeafEntries that belong to a certain owner.
func (RootEntry) GetChilds ¶ added in v0.0.63
func (s RootEntry) GetChilds(d types.DescendMethod) EntryMap
func (*RootEntry) GetDeletes ¶
func (r *RootEntry) GetDeletes(aggregatePaths bool) (types.DeleteEntriesList, error)
GetDeletes returns the paths that due to the Tree content are to be deleted from the southbound device.
func (*RootEntry) GetDeletesForOwner ¶
GetDeletesForOwner returns the deletes that have been calculated for the given intent / owner
func (*RootEntry) GetDeviations ¶ added in v0.0.56
func (r *RootEntry) GetDeviations(ctx context.Context, ch chan<- *types.DeviationEntry)
func (RootEntry) GetFirstAncestorWithSchema ¶
GetAncestorSchema returns the schema of the parent node if the schema is set. if the parent has no schema (is a key element in the tree) it will recurs the call to the parents parent. the level of recursion is indicated via the levelUp attribute
func (*RootEntry) GetHighestPrecedence ¶
func (r *RootEntry) GetHighestPrecedence(onlyNewOrUpdated bool) LeafVariantSlice
GetHighesPrecedence return the new cache.Update entried from the tree that are the highes priority. If the onlyNewOrUpdated option is set to true, only the New or Updated entries will be returned It will append to the given list and provide a new pointer to the slice
func (RootEntry) GetLeafVariantEntries ¶ added in v0.0.63
func (s RootEntry) GetLeafVariantEntries() LeafVariantEntries
func (RootEntry) GetLevel ¶
func (s RootEntry) GetLevel() int
GetLevel returns the level / depth position of this element in the tree
func (RootEntry) GetListChilds ¶ added in v0.0.56
getListChilds collects all the childs of the list. In the tree we store them seperated into their key branches. this is collecting all the last level key entries.
func (RootEntry) GetParent ¶
func (s RootEntry) GetParent() Entry
GetParent returns the parent entry
func (RootEntry) GetRootBasedEntryChain ¶ added in v0.0.42
func (s RootEntry) GetRootBasedEntryChain() []Entry
func (RootEntry) GetSchema ¶
func (s RootEntry) GetSchema() *sdcpb.SchemaElem
GetSchema return the schema fiels of the Entry
func (RootEntry) GetSchemaKeys ¶
func (s RootEntry) GetSchemaKeys() []string
GetSchemaKeys checks for the schema of the entry, and returns the defined keys
func (RootEntry) GetTreeContext ¶ added in v0.0.67
func (s RootEntry) GetTreeContext() *TreeContext
func (*RootEntry) GetUpdatesForOwner ¶
func (r *RootEntry) GetUpdatesForOwner(owner string) types.UpdateSlice
GetUpdatesForOwner returns the updates that have been calculated for the given intent / owner
func (RootEntry) HoldsLeafvariants ¶ added in v0.0.63
func (s RootEntry) HoldsLeafvariants() bool
func (*RootEntry) ImportConfig ¶ added in v0.0.44
func (r *RootEntry) ImportConfig(ctx context.Context, basePath *sdcpb.Path, importer importer.ImportConfigAdapter, flags *types.UpdateInsertFlags, poolFactory pool.VirtualPoolFactory) (*types.ImportStats, error)
func (RootEntry) IsRoot ¶
func (s RootEntry) IsRoot() bool
IsRoot returns true if the element has no parent elements, hence is the root of the tree
func (RootEntry) NavigateLeafRef ¶ added in v0.0.43
NavigateLeafRef
func (RootEntry) NavigateSdcpbPath ¶ added in v0.0.42
func (RootEntry) PathName ¶
func (s RootEntry) PathName() string
PathName returns the name of the Entry
func (RootEntry) RemainsToExist ¶ added in v0.0.67
func (s RootEntry) RemainsToExist() bool
func (RootEntry) SdcpbPath ¶
SdcpbPath returns the sdcpb.Path, with its elements and keys based on the local schema
func (*RootEntry) SetNonRevertiveIntent ¶ added in v0.0.67
func (RootEntry) StringIndent ¶
StringIndent returns the sharedEntryAttributes in its string representation The string is intented according to the nesting level in the yang model
func (RootEntry) ToJsonIETF ¶ added in v0.0.44
func (*RootEntry) ToProtoDeletes ¶ added in v0.0.44
func (*RootEntry) ToProtoUpdates ¶ added in v0.0.44
func (RootEntry) ToXML ¶ added in v0.0.44
func (s RootEntry) ToXML(onlyNewOrUpdated, honorNamespace, operationWithNamespace, useOperationRemove bool) (*etree.Document, error)
ToXML yields the xml representation of the tree. Either updates only (onlyNewOrUpdated flag) or the actual view on the whole tree. If honorNamespace is set, the xml elements will carry their respective namespace attributes. If operationWithNamespace is set, the operation attributes added to the to be deleted alements will also carry the Netconf Base namespace. If useOperationRemove is set, the remove operation will be used for deletes, instead of the delete operation.
func (*RootEntry) TreeExport ¶ added in v0.0.56
func (*RootEntry) Validate ¶
func (r *RootEntry) Validate(ctx context.Context, vCfg *config.Validation, taskpoolFactory pool.VirtualPoolFactory) (types.ValidationResults, *types.ValidationStats)
func (RootEntry) ValidateLevel ¶ added in v0.0.67
func (s RootEntry) ValidateLevel(ctx context.Context, resultChan chan<- *types.ValidationResultEntry, stats *types.ValidationStats, vCfg *config.Validation)
Validate is the highlevel function to perform validation. it will multiplex all the different Validations that need to happen
type RootTreeImport ¶ added in v0.0.67
type RootTreeImport interface {
ImportConfig(ctx context.Context, basePath *sdcpb.Path, importer importer.ImportConfigAdapter, flags *types.UpdateInsertFlags, poolFactory pool.VirtualPoolFactory) (*types.ImportStats, error)
}
type TreeContext ¶
type TreeContext struct {
// contains filtered or unexported fields
}
func NewTreeContext ¶
func NewTreeContext(sc schemaClient.SchemaClientBound, poolFactory pool.VirtualPoolFactory) *TreeContext
func (*TreeContext) AddExplicitDeletes ¶ added in v0.0.67
func (t *TreeContext) AddExplicitDeletes(intentName string, priority int32, pathset *sdcpb.PathSet)
func (*TreeContext) AddNonRevertiveInfo ¶ added in v0.0.67
func (t *TreeContext) AddNonRevertiveInfo(intent string, nonRevertive bool)
func (*TreeContext) GetPoolFactory ¶ added in v0.0.67
func (t *TreeContext) GetPoolFactory() pool.VirtualPoolFactory
func (*TreeContext) IsNonRevertiveIntent ¶ added in v0.0.67
func (t *TreeContext) IsNonRevertiveIntent(intent string) bool
IsNonRevertiveIntent returns the non-revertive flag per intent. False is also returned the intent does not exist.
func (*TreeContext) RemoveExplicitDeletes ¶ added in v0.0.67
func (t *TreeContext) RemoveExplicitDeletes(intentName string) *sdcpb.PathSet
type ValidateProcessor ¶ added in v0.0.67
type ValidateProcessor struct {
// contains filtered or unexported fields
}
func NewValidateProcessor ¶ added in v0.0.67
func NewValidateProcessor(parameters *ValidateProcessorParameters) *ValidateProcessor
func (*ValidateProcessor) Run ¶ added in v0.0.67
func (p *ValidateProcessor) Run(taskpoolFactory pool.VirtualPoolFactory, e Entry)
type ValidateProcessorParameters ¶ added in v0.0.67
type ValidateProcessorParameters struct {
// contains filtered or unexported fields
}
func NewValidateProcessorConfig ¶ added in v0.0.67
func NewValidateProcessorConfig(resultChan chan<- *types.ValidationResultEntry, stats *types.ValidationStats, vCfg *config.Validation) *ValidateProcessorParameters
Source Files
¶
- childMap.go
- choice_case_resolver.go
- default_value.go
- entry.go
- entry_list.go
- entry_map.go
- intent_path_mapping.go
- json.go
- leaf_entry.go
- leaf_entry_filter.go
- leaf_variant_slice.go
- leaf_variants.go
- processor_blame_config.go
- processor_explicit_delete.go
- processor_importer.go
- processor_mark_owner_delete.go
- processor_remove_deleted.go
- processor_reset_flags.go
- processor_validate.go
- proto.go
- root_entry.go
- sharedEntryAttributes.go
- sorter.go
- tree_context.go
- utils.go
- validation_entry_leafref.go
- validation_entry_must.go
- xml.go
- yang-parser-adapter.go