Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientContext ¶
func NewClientContext(ctx context.Context, tr Transporter) context.Context
func NewServerContext ¶
func NewServerContext(ctx context.Context, tr Transporter) context.Context
Types ¶
type EndpointRegister ¶
EndpointRegister is registry endpoint.
type Header ¶
type Header interface { Get(key string) string Set(key, value string) Add(key, value string) Keys() []string Values(key string) []string }
Header is the storage medium used by a Header.
type Transporter ¶
type Transporter interface { // Kind transporter // grpc // http Kind() Kind // Endpoint returns server/client endpoint Endpoint() string // Operation Service full method selector generated by protobuf, like /hello.Greeter/SayHello Operation() string // RequestHeader returns the transport request header // grpc: [metadata.MD] // http: [http.Header] RequestHeader() Header // ReplyHeader returns the transport reply/response header // grpc: [metadata.MD] // http: [http.Header] ReplyHeader() Header }
Transporter is transport context value interface.
func FromClientContext ¶
func FromClientContext(ctx context.Context) (tr Transporter, ok bool)
func FromServerContext ¶
func FromServerContext(ctx context.Context) (tr Transporter, ok bool)
Click to show internal directories.
Click to hide internal directories.