package metadata

Import Path
	google.golang.org/grpc/metadata (on go.dev)

Dependency Relation
	imports 3 packages, and imported by 9 packages

Involved Source Files Package metadata define the structure of the metadata supported by gRPC library. Please refer to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md for more information about custom-metadata.
Package-Level Type Names (total 4, in which 1 are exported)
/* sort exporteds by: | */
MD is a mapping from metadata keys to values. Users should use the following two convenience functions New and Pairs to generate MD. Append adds the values to key k, not overwriting what was already stored at that key. k is converted to lowercase before storing in md. Copy returns a copy of md. Delete removes the values for a given key k which is converted to lowercase before removing it from md. Get obtains the values for a given key. k is converted to lowercase before searching in md. Len returns the number of items in md. Set sets the value of a given key with a slice of values. k is converted to lowercase before storing in md. func FromIncomingContext(ctx context.Context) (MD, bool) func FromOutgoingContext(ctx context.Context) (MD, bool) func FromOutgoingContextRaw(ctx context.Context) (MD, [][]string, bool) func Join(mds ...MD) MD func New(m map[string]string) MD func Pairs(kv ...string) MD func MD.Copy() MD func google.golang.org/grpc.ClientStream.Header() (MD, error) func google.golang.org/grpc.ClientStream.Trailer() MD func google.golang.org/grpc/internal/grpcutil.ExtraMetadata(ctx context.Context) (md MD, ok bool) func google.golang.org/grpc/internal/metadata.Get(addr resolver.Address) MD func google.golang.org/grpc/internal/resolver.ClientStream.Header() (MD, error) func google.golang.org/grpc/internal/resolver.ClientStream.Trailer() MD func google.golang.org/grpc/internal/transport.(*Stream).Header() (MD, error) func google.golang.org/grpc/internal/transport.(*Stream).Trailer() MD func Join(mds ...MD) MD func NewIncomingContext(ctx context.Context, md MD) context.Context func NewOutgoingContext(ctx context.Context, md MD) context.Context func google.golang.org/grpc.Header(md *MD) grpc.CallOption func google.golang.org/grpc.SendHeader(ctx context.Context, md MD) error func google.golang.org/grpc.SetHeader(ctx context.Context, md MD) error func google.golang.org/grpc.SetTrailer(ctx context.Context, md MD) error func google.golang.org/grpc.Trailer(md *MD) grpc.CallOption func google.golang.org/grpc.ServerStream.SendHeader(MD) error func google.golang.org/grpc.ServerStream.SetHeader(MD) error func google.golang.org/grpc.ServerStream.SetTrailer(MD) func google.golang.org/grpc.ServerTransportStream.SendHeader(md MD) error func google.golang.org/grpc.ServerTransportStream.SetHeader(md MD) error func google.golang.org/grpc.ServerTransportStream.SetTrailer(md MD) error func google.golang.org/grpc/internal/balancerload.Parse(md MD) interface{} func google.golang.org/grpc/internal/balancerload.Parser.Parse(md MD) interface{} func google.golang.org/grpc/internal/grpcutil.WithExtraMetadata(ctx context.Context, md MD) context.Context func google.golang.org/grpc/internal/metadata.Set(addr resolver.Address, md MD) resolver.Address func google.golang.org/grpc/internal/metadata.Validate(md MD) error func google.golang.org/grpc/internal/transport.ServerTransport.WriteHeader(s *transport.Stream, md MD) error func google.golang.org/grpc/internal/transport.(*Stream).SendHeader(md MD) error func google.golang.org/grpc/internal/transport.(*Stream).SetHeader(md MD) error func google.golang.org/grpc/internal/transport.(*Stream).SetTrailer(md MD) error
Package-Level Functions (total 12, in which 11 are exported)
AppendToOutgoingContext returns a new context with the provided kv merged with any existing metadata in the context. Please refer to the documentation of Pairs for a description of kv.
DecodeKeyValue returns k, v, nil. Deprecated: use k and v directly instead.
FromIncomingContext returns the incoming metadata in ctx if it exists. All keys in the returned MD are lowercase.
FromOutgoingContext returns the outgoing metadata in ctx if it exists. All keys in the returned MD are lowercase.
FromOutgoingContextRaw returns the un-merged, intermediary contents of rawMD. Remember to perform strings.ToLower on the keys, for both the returned MD (MD is a map, there's no guarantee it's created using our helper functions) and the extra kv pairs (AppendToOutgoingContext doesn't turn them into lowercase). This is intended for gRPC-internal use ONLY. Users should use FromOutgoingContext instead.
Join joins any number of mds into a single MD. The order of values for each key is determined by the order in which the mds containing those values are presented to Join.
New creates an MD from a given key-value map. Only the following ASCII characters are allowed in keys: - digits: 0-9 - uppercase letters: A-Z (normalized to lower) - lowercase letters: a-z - special characters: -_. Uppercase letters are automatically converted to lowercase. Keys beginning with "grpc-" are reserved for grpc-internal use only and may result in errors if set in metadata.
NewIncomingContext creates a new context with incoming md attached.
NewOutgoingContext creates a new context with outgoing md attached. If used in conjunction with AppendToOutgoingContext, NewOutgoingContext will overwrite any previously-appended metadata.
Pairs returns an MD formed by the mapping of key, value ... Pairs panics if len(kv) is odd. Only the following ASCII characters are allowed in keys: - digits: 0-9 - uppercase letters: A-Z (normalized to lower) - lowercase letters: a-z - special characters: -_. Uppercase letters are automatically converted to lowercase. Keys beginning with "grpc-" are reserved for grpc-internal use only and may result in errors if set in metadata.
ValueFromIncomingContext returns the metadata value corresponding to the metadata key from the incoming metadata if it exists. Key must be lower-case. # Experimental Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.