hierarchy
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package hierarchy contains functions to set and get hierarchy string fromaddresses.
This package is experimental.
Index¶
- func FromEndpoint(endpoint resolver.Endpoint) []string
- func Get(addr resolver.Address) []string
- func Group(addrs []resolver.Address) map[string][]resolver.Address
- func GroupEndpoints(endpoints []resolver.Endpoint) map[string][]resolver.Endpoint
- func Set(addr resolver.Address, path []string) resolver.Address
- func SetInEndpoint(endpoint resolver.Endpoint, path []string) resolver.Endpoint
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcFromEndpoint¶added inv1.69.0
FromEndpoint returns the hierarchical path of endpoint.
funcGroup¶
Group splits a slice of addresses into groups based onthe first hierarchy path. The first hierarchy path will be removed from theresult.
Input:[
{addr0, path: [p0, wt0]}{addr1, path: [p0, wt1]}{addr2, path: [p1, wt2]}{addr3, path: [p1, wt3]}]
Addresses will be split into p0/p1, and the p0/p1 will be removed from thepath.
Output:
{ p0: [ {addr0, path: [wt0]}, {addr1, path: [wt1]}, ], p1: [ {addr2, path: [wt2]}, {addr3, path: [wt3]}, ],}If hierarchical path is not set, or has no path in it, the address isdropped.
funcGroupEndpoints¶added inv1.69.0
GroupEndpoints splits a slice of endpoints into groups based onthe first hierarchy path. The first hierarchy path will be removed from theresult.
Input:[
{endpoint0, path: [p0, wt0]}{endpoint1, path: [p0, wt1]}{endpoint2, path: [p1, wt2]}{endpoint3, path: [p1, wt3]}]
Endpoints will be split into p0/p1, and the p0/p1 will be removed from thepath.
Output:
{ p0: [ {endpoint0, path: [wt0]}, {endpoint1, path: [wt1]}, ], p1: [ {endpoint2, path: [wt2]}, {endpoint3, path: [wt3]}, ],}If hierarchical path is not set, or has no path in it, the endpoint isdropped.
Types¶
This section is empty.