Documentation ¶
Overview ¶
Package utils implements various gNMI path manipulation facilities.
Package utils implements various gNMI path manipulation facilities.
Index ¶
- func MatchWildcardChNameRegexp(query string, exact bool) *regexp.Regexp
- func MatchWildcardRegexp(query string, exact bool) *regexp.Regexp
- func ParseGNMIElements(elms []string) (*pb.Path, error)
- func SplitPath(path string) []string
- func SplitPaths(paths []string) [][]string
- func StrPath(path *pb.Path) string
- func StrPathElem(pathElem []*pb.PathElem) string
- func StrVal(val *pb.TypedValue) string
- func TemporaryEvaluate(md metautils.NiceMD) error
- func ToConfigName(deviceID devicetype.ID, version devicetype.Version) string
- func ToModelName(name devicetype.Type, version devicetype.Version) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchWildcardChNameRegexp ¶
MatchWildcardChNameRegexp creates a Regular Expression from a wild-carded path
func MatchWildcardRegexp ¶
MatchWildcardRegexp creates a Regular Expression from a gNMI wild-carded path This follows the gNMI wildcard syntax https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-path-conventions.md#wildcards-in-paths
func ParseGNMIElements ¶
ParseGNMIElements builds up a gnmi path, from user-supplied text
func SplitPath ¶
SplitPath splits a gnmi path according to the spec. See https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-path-conventions.md No validation is done. Behavior is undefined if path is an invalid gnmi path. TODO: Do validation?
func StrPathElem ¶
StrPathElem builds a human-readable form of a list of path elements. e.g. /a/b/c[e=f]
func StrVal ¶
func StrVal(val *pb.TypedValue) string
StrVal will return a string representing the supplied value
func TemporaryEvaluate ¶ added in v0.7.16
TemporaryEvaluate - simple evaluation of rules until OpenPolicyAgent is added This is so that aether-config can be deployed to the cloud in 2021 Q1 with simple RBAC It applies to Set (gnmi) and CompactChanges(admin) and RollbackNetworkChange(admin) TODO replace the following with fine grained RBAC using OpenPolicyAgent Rego in 2021 Q2
func ToConfigName ¶
func ToConfigName(deviceID devicetype.ID, version devicetype.Version) string
ToConfigName simply joins together device ID and version in a consistent way
func ToModelName ¶
func ToModelName(name devicetype.Type, version devicetype.Version) string
ToModelName simply joins together model name and version in a consistent way
Types ¶
This section is empty.