Documentation ¶
Index ¶
- func CreateCtxWithClientInfo(ctx context.Context, info *lavapbv1.ServiceInfo) context.Context
- func CreateCtxWithReqID(ctx context.Context, reqId string) context.Context
- func CreateCtxWithServerInfo(ctx context.Context, info *lavapbv1.ServiceInfo) context.Context
- func CreateReqHeader(ctx context.Context, header *RequestHeader) context.Context
- func CreateRspHeader(ctx context.Context, header *ResponseHeader) context.Context
- func GetClientInfo(ctx context.Context) *lavapbv1.ServiceInfo
- func GetReqID(ctx context.Context) string
- func GetServerInfo(ctx context.Context) *lavapbv1.ServiceInfo
- type Annotation
- type Annotations
- type Close
- type GrpcGatewayRouter
- type GrpcRouter
- type HandlerFunc
- type HttpRouter
- type Init
- type Initializer
- type InnerServer
- type Middleware
- type MiddlewareWrap
- type Middlewares
- type Request
- type RequestHeader
- type Response
- type ResponseHeader
- type Server
- type Service
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCtxWithClientInfo ¶
func CreateCtxWithReqID ¶
func CreateCtxWithServerInfo ¶
func CreateReqHeader ¶
func CreateReqHeader(ctx context.Context, header *RequestHeader) context.Context
func CreateRspHeader ¶
func CreateRspHeader(ctx context.Context, header *ResponseHeader) context.Context
func GetClientInfo ¶
func GetClientInfo(ctx context.Context) *lavapbv1.ServiceInfo
func GetServerInfo ¶
func GetServerInfo(ctx context.Context) *lavapbv1.ServiceInfo
Types ¶
type Annotation ¶
type Annotation interface {
Name() string
}
Annotation is used to attach arbitrary metadata to the schema objects
type Annotations ¶
type Annotations = []Annotation
type GrpcGatewayRouter ¶
type GrpcGatewayRouter interface { GrpcRouter RegisterGateway(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error }
type GrpcRouter ¶
type GrpcRouter interface { Middlewares() []Middleware ServiceDesc() *grpc.ServiceDesc }
type HttpRouter ¶
type HttpRouter interface { Middlewares() []Middleware Router(router fiber.Router) Prefix() string }
type InnerServer ¶
type InnerServer struct {
grpc.ClientConnInterface
}
type Middleware ¶
type Middleware interface { Middleware(next HandlerFunc) HandlerFunc String() string }
func Chain ¶
func Chain(m ...Middleware) Middleware
type MiddlewareWrap ¶
type MiddlewareWrap struct { Next func(next HandlerFunc) HandlerFunc Name string }
func (MiddlewareWrap) Middleware ¶
func (m MiddlewareWrap) Middleware(next HandlerFunc) HandlerFunc
func (MiddlewareWrap) String ¶
func (m MiddlewareWrap) String() string
type Middlewares ¶
type Middlewares []Middleware
type Request ¶
type Request interface { // Client server or client Client() bool // Kind [http|grpc...] Kind() string // Stream Indicates whether it's a stream Stream() bool // Service name requested Service() string // Operation requested Operation() string // Endpoint requested Endpoint() string // ContentType Content type provided ContentType() string // Header of the request Header() *RequestHeader // Payload is the decoded value Payload() interface{} }
Request is a synchronous request interface
type RequestHeader ¶
type RequestHeader = fasthttp.RequestHeader
func ReqHeader ¶
func ReqHeader(ctx context.Context) *RequestHeader
type Response ¶
type Response interface { Header() *ResponseHeader Payload() interface{} Stream() bool }
Response is the response writer for un encoded messages
type ResponseHeader ¶
type ResponseHeader = fasthttp.ResponseHeader
func RspHeader ¶
func RspHeader(ctx context.Context) *ResponseHeader
Click to show internal directories.
Click to hide internal directories.