Movatterモバイル変換


[0]ホーム

URL:


hierarchy

package
v1.77.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2025 License:Apache-2.0Imports:1Imported by:0

Details

Repository

github.com/grpc/grpc-go

Links

Documentation

Overview

Package hierarchy contains functions to set and get hierarchy string fromaddresses.

This package is experimental.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcFromEndpointadded inv1.69.0

func FromEndpoint(endpointresolver.Endpoint) []string

FromEndpoint returns the hierarchical path of endpoint.

funcGet

func Get(addrresolver.Address) []string

Get returns the hierarchical path of addr.

funcGroup

func Group(addrs []resolver.Address) map[string][]resolver.Address

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.

funcGroupEndpointsadded inv1.69.0

func GroupEndpoints(endpoints []resolver.Endpoint) map[string][]resolver.Endpoint

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.

funcSet

func Set(addrresolver.Address, path []string)resolver.Address

Set overrides the hierarchical path in addr with path.

funcSetInEndpointadded inv1.69.0

func SetInEndpoint(endpointresolver.Endpoint, path []string)resolver.Endpoint

SetInEndpoint overrides the hierarchical path in endpoint with path.

Types

This section is empty.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp