metadata

package
v1.72.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package metadata contains functions to set and get metadata from addresses.

This package is experimental.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(addr resolver.Address) metadata.MD

Get returns the metadata of addr.

func Set

Set sets (overrides) the metadata in addr.

When a SubConn is created with this address, the RPCs sent on it will all have this metadata.

func Validate added in v1.46.0

func Validate(md metadata.MD) error

Validate validates every pair in md with ValidatePair.

func ValidateKey added in v1.72.0

func ValidateKey(key string) error

ValidateKey validates a key with the following rules (pseudo-headers are skipped): - the key must contain one or more characters. - the characters in the key must be in [0-9 a-z _ - .].

func ValidatePair added in v1.54.0

func ValidatePair(key string, vals ...string) error

ValidatePair validates a key-value pair with the following rules (pseudo-header are skipped):

  • the key must contain one or more characters.
  • the characters in the key must be in [0-9 a-z _ - .].
  • if the key ends with a "-bin" suffix, no validation of the corresponding value is performed.
  • the characters in every value must be printable (in [%x20-%x7E]).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL