Documentation
¶
Index ¶
- Variables
- func AddUpdateRecursive(ctx context.Context, e api.Entry, path *sdcpb.Path, u *types.Update, ...) (api.Entry, error)
- func AddUpdateRecursiveInternal(ctx context.Context, s api.Entry, path *sdcpb.Path, idx int, u *types.Update, ...) (api.Entry, error)
- func CheckAndCreateKeysAsLeafs(ctx context.Context, e api.Entry, intentName string, prio int32, ...) error
- func ContainsOnlyDefaults(e api.Entry) bool
- func DefaultValueExists(schema *sdcpb.SchemaElem) bool
- func DefaultValueRetrieve(ctx context.Context, schema *sdcpb.SchemaElem, path *sdcpb.Path) (*types.Update, error)
- func DeleteBranch(ctx context.Context, e api.Entry, path *sdcpb.Path, owner string) error
- func FilterChilds(s api.Entry, keys map[string]string) ([]api.Entry, error)
- func GetDeletes(e api.Entry, aggregatePaths bool) (types.DeleteEntriesList, error)
- func GetDeviations(ctx context.Context, e api.Entry, config *GetDeviationParams, ...) error
- func GetFirstAncestorWithSchema(e api.Entry) (api.Entry, int)
- func GetHighestPrecedence(s api.Entry, onlyNewOrUpdated bool, includeDefaults bool, ...) api.LeafVariantSlice
- func GetHighestPrecedenceValueOfBranch(e api.Entry, filter api.HighestPrecedenceFilter) int32
- func GetListChilds(e api.Entry) ([]api.Entry, error)
- func GetOrCreateChilds(ctx context.Context, e api.Entry, path *sdcpb.Path) (api.Entry, error)
- func GetPathCompletions(ctx context.Context, entry api.Entry, toComplete string) []string
- func GetRoot(e api.Entry) api.Entry
- func GetRootBasedEntryChain(current api.Entry) []api.Entry
- func GetSchemaKeys(e api.Entry) []string
- func HoldsLeafVariants(e api.Entry) bool
- func LeafsOfOwner(e api.Entry, owner string, f ...api.LeafEntryFilter) api.LeafVariantSlice
- func NavigateSdcpbPath(ctx context.Context, e api.Entry, path *sdcpb.Path) (api.Entry, error)
- func ToJson(ctx context.Context, e api.Entry, onlyNewOrUpdated bool) (any, error)
- func ToJsonIETF(ctx context.Context, e api.Entry, onlyNewOrUpdated bool) (any, error)
- func ToProtoDeletes(ctx context.Context, e api.Entry) ([]*sdcpb.Path, error)
- func ToProtoUpdates(ctx context.Context, e api.Entry, onlyNewOrUpdated bool) ([]*sdcpb.Update, error)
- func ToXML(ctx context.Context, e api.Entry, ...) (*etree.Document, error)
- func TreeExport(e api.Entry, owner string, priority int32, orphan bool) (*tree_persist.Intent, error)
- type GetDeviationParams
Constants ¶
This section is empty.
Variables ¶
var (
ErrorIntentNotPresent = fmt.Errorf("intent not present")
)
Functions ¶
func AddUpdateRecursive ¶
func AddUpdateRecursive(ctx context.Context, e api.Entry, path *sdcpb.Path, u *types.Update, flags *types.UpdateInsertFlags) (api.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 ContainsOnlyDefaults ¶
ContainsOnlyDefaults checks if the given entry is a container that only contains leafvariants with owner defaults, and that all childs are in the list of childs with defaults defined in the container schema. Containers without childs return true, while non-container entries or entries without schema return false. It returns true if the entry is a container with only default values, and false otherwise.
func DefaultValueExists ¶
func DefaultValueExists(schema *sdcpb.SchemaElem) bool
func DefaultValueRetrieve ¶
func DeleteBranch ¶
func FilterChilds ¶
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 GetDeletes ¶
GetDeletes calculate the deletes that need to be send to the device.
func GetDeviations ¶
func GetDeviations(ctx context.Context, e api.Entry, config *GetDeviationParams, poolFactory pool.VirtualPoolFactory) error
func 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 continue up the tree. the level of traversal is indicated via the level return value
func GetHighestPrecedence ¶
func GetHighestPrecedence(s api.Entry, onlyNewOrUpdated bool, includeDefaults bool, includeExplicitDelete bool) api.LeafVariantSlice
GetHighestPrecedence goes through the whole branch and returns the new and updated cache.Updates. These are the updated that will be send to the device.
func GetHighestPrecedenceValueOfBranch ¶
func GetHighestPrecedenceValueOfBranch(e api.Entry, filter api.HighestPrecedenceFilter) int32
GetHighestPrecedenceValueOfBranch goes through all the child branches to find the highest precedence value (lowest priority value) for the entire branch and returns it.
func GetListChilds ¶
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 GetOrCreateChilds ¶
func GetPathCompletions ¶
func GetRootBasedEntryChain ¶
GetRootBasedEntryChain returns all the entries starting from the root down to the actual Entry. The first element of the returned slice is the root, and the last element is the actual Entry.
func GetSchemaKeys ¶
GetSchemaKeys checks for the schema of the entry, and returns the defined keys
func HoldsLeafVariants ¶
func LeafsOfOwner ¶
func LeafsOfOwner(e api.Entry, owner string, f ...api.LeafEntryFilter) api.LeafVariantSlice
LeafsOfOwner returns the Tree content filtered by owner, whilst allowing to filter further via providing additional LeafEntryFilter
func NavigateSdcpbPath ¶
func ToJsonIETF ¶
func ToProtoUpdates ¶
func ToXML ¶
func ToXML(ctx context.Context, e api.Entry, 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 TreeExport ¶
Types ¶
type GetDeviationParams ¶
type GetDeviationParams struct {
Ch chan<- *types.DeviationEntry
}
Source Files
¶
- checkandcreatekeysasleafs.go
- containsonlydefaults.go
- default_value.go
- deletebranch.go
- filterchilds.go
- getbyowner.go
- getdeletes.go
- getdeviations.go
- getfirstancesterwithschema.go
- gethighestprecedence.go
- gethighestprecedencevalueofbranch.go
- getlistchilds.go
- getorcreatechilds.go
- getpathcompletions.go
- getroot.go
- getrootbasedentrychain.go
- getschemakeys.go
- holdsleafvariants.go
- json.go
- navigatesdcpbpath.go
- proto.go
- treeexport.go
- utils.go
- xml.go