Documentation ¶
Index ¶
- func CreateCtxWithReqHeader(ctx context.Context, header *RequestHeader) context.Context
- func CreateCtxWithReqID(ctx context.Context, reqId string) context.Context
- func CreateCtxWithRspHeader(ctx context.Context, header *ResponseHeader) context.Context
- func GetReqID(ctx context.Context) string
- func WrapHandler[Req any, Rsp any](handle func(ctx context.Context, req *Req) (rsp *Rsp, err error)) func(ctx *fiber.Ctx) error
- type Close
- type GrpcHandler
- type HandlerFunc
- type HttpRouter
- type Init
- type Initializer
- type Middleware
- type Request
- type RequestHeader
- type Response
- type ResponseHeader
- type Service
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCtxWithReqHeader ¶
func CreateCtxWithReqHeader(ctx context.Context, header *RequestHeader) context.Context
func CreateCtxWithReqID ¶
func CreateCtxWithRspHeader ¶
func CreateCtxWithRspHeader(ctx context.Context, header *ResponseHeader) context.Context
Types ¶
type GrpcHandler ¶
type GrpcHandler interface { Init() Middlewares() []Middleware ServiceDesc() *grpc.ServiceDesc }
type HttpRouter ¶
type HttpRouter interface { Init() Middlewares() []Middleware Router(app *fiber.App) Openapi(swag *opendoc.Swagger) }
type Middleware ¶
type Middleware func(next HandlerFunc) HandlerFunc
func Chain ¶
func Chain(m ...Middleware) 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 GetReqHeader ¶
func GetReqHeader(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 GetRspHeader ¶
func GetRspHeader(ctx context.Context) *ResponseHeader
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
clients
|
|
cmds
|
|
core
|
|
registry
Package registry is an interface for service discovery
|
Package registry is an interface for service discovery |
registry/drivers/mdns
Package mdns is a multicast dns registry
|
Package mdns is a multicast dns registry |
example
module
|
|
internal
|
|
example/grpc
Module
|
|
example/http
Module
|
|
modules
|
|
pkg
|
|
servers
|
|
Click to show internal directories.
Click to hide internal directories.