package attributes
Import Path
google.golang.org/grpc/attributes (on go.dev)
Dependency Relation
imports one package, and imported by 2 packages
Involved Source Files
Package attributes defines a generic key/value store used in various gRPC
components.
All APIs in this package are EXPERIMENTAL.
Package-Level Type Names (only one, which is exported)
Attributes is an immutable struct for storing and retrieving generic
key/value pairs. Keys must be hashable, and users should define their own
types for keys.
m map[interface{}]interface{}
Value returns the value associated with these attributes for key, or nil if
no value is associated with key.
WithValues returns a new Attributes containing all key/value pairs in a and
kvs. Panics if len(kvs) is not even. If the same key appears multiple
times, the last value overwrites all previous values for that key. To
remove an existing key, use a nil value.
func New(kvs ...interface{}) *Attributes
func (*Attributes).WithValues(kvs ...interface{}) *Attributes
Package-Level Functions (only one, which is exported)
New returns a new Attributes containing all key/value pairs in kvs. If the
same key appears multiple times, the last value overwrites all previous
values for that key. Panics if len(kvs) is not even.
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |