Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithValueTransporter ¶
func WithValueTransporter(ctx context.Context, p Transporter) context.Context
WithValueTransporter returns a new Context that carries value.
Types ¶
type ErrorTranslator ¶
type Header ¶
type Header interface { // Len returns the number of items in header. Len() int // Get returns the value associated with the passed key. Get(key string) string Set(key string, value string) // Add adds the key, value pair to the header. Add(key, value string) // Append adds the values to key k, not overwriting what was already stored at // that key. Append(key string, vals ...string) // Delete removes the values for a given key k which is converted to lowercase // before removing it from header. Delete(key string) Keys() []string Clone() Header }
Header is the storage medium used by a Header.
type TranslatorData ¶
type TranslatorError ¶
type Transporter ¶
type Transporter interface { // Kind transporter // grpc // http Kind() Kind // FullPath Service full method or path FullPath() string // ClientIp client ip ClientIp() string // RequestHeader return transport request header // http: http.Header // grpc: metadata.MD RequestHeader() Header // ResponseHeader return transport response header // http: http.Header // grpc: metadata.MD ResponseHeader() Header }
func FromTransporter ¶
func FromTransporter(ctx context.Context) (p Transporter, ok bool)
FromTransporter returns the Transporter value stored in ctx, if any.
func MustFromTransporter ¶
func MustFromTransporter(ctx context.Context) Transporter
MustFromTransporter returns the Transporter value stored in ctx.
Click to show internal directories.
Click to hide internal directories.