Documentation ¶
Index ¶
Constants ¶
View Source
const ( GRPC = "grpc" HTTP = "http" )
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 Endpointer ¶
type Transporter ¶
type Transporter interface { // Endpoint return server or client endpoint // Server Transport: grpc://127.0.0.1:9000 // Client Transport: discovery:///provider-demo Endpoint() string // Operation Service full method // http: /api/check_update // grpc: CMD_GAME_LOGIN Operation() string Header() Header }
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.