Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientContext ¶
func NewClientContext(ctx context.Context, tr Transporter) context.Context
NewClientContext returns a new Context that carries value.
func NewServerContext ¶
func NewServerContext(ctx context.Context, tr Transporter) context.Context
NewServerContext returns a new Context that carries value.
Types ¶
type Endpointer ¶
Endpointer is registry endpoint.
type Transporter ¶
type Transporter interface { // Kind transporter // grpc // http Kind() Kind // Endpoint return server or client endpoint Endpoint() string // Operation Service full method selector generated by protobuf // example: /helloworld.Greeter/SayHello Operation() string // RequestHeader return transport request header // http: http.Header // grpc: metadata.MD RequestHeader() Header // ReplyHeader return transport reply/response header // only valid for server transport // http: http.Header // grpc: metadata.MD ReplyHeader() Header }
Transporter is transport context value interface.
func FromClientContext ¶
func FromClientContext(ctx context.Context) (tr Transporter, ok bool)
FromClientContext returns the Transport value stored in ctx, if any.
func FromServerContext ¶
func FromServerContext(ctx context.Context) (tr Transporter, ok bool)
FromServerContext returns the Transport value stored in ctx, if any.
Click to show internal directories.
Click to hide internal directories.