Documentation ¶
Overview ¶
Package utils implements various gNMI path manipulation facilities.
Index ¶
- func FormatInput(json []byte, groups []string) string
- func FormatOutput(body []byte) (string, error)
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatInput ¶ added in v0.8.2
FormatInput add 'input' and `groups` objects to the JSON Also temporarily replace `-` as OPA can't handle it
func FormatOutput ¶ added in v0.8.2
FormatOutput replace the '-' back in where they were
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
Types ¶
This section is empty.