Documentation
¶
Index ¶
- Constants
- func CallAny[REQ any](e vndcontext.VndContext, req *REQ, name string, delegate CallDelegateAny[REQ]) (any, error)
- func CallSSE[REQ any](e vndcontext.VndContext, req *REQ, name string, delegate CallDelegateSSE[REQ]) error
- func Get[RES any](ctx context.Context, requestId string, url string, heades map[string]string) (*RES, error)
- func Patch[RES any](ctx context.Context, requestId string, url string, heades map[string]string, ...) (*RES, error)
- func Post[RES any](ctx context.Context, requestId string, url string, heades map[string]string, ...) (*RES, error)
- func Put[RES any](ctx context.Context, requestId string, url string, heades map[string]string, ...) (*RES, error)
- func RestLogFieldExtractor(c echo.Context) []zapcore.Field
- func Wrapper[TREQ any](wrapped func(vndcontext.VndContext, *TREQ) (*Result, error)) echo.HandlerFunc
- func WrapperAny[TREQ any](wrapped func(vndcontext.VndContext, *TREQ) (any, error)) echo.HandlerFunc
- func WrapperSSE[TREQ any](wrapped func(vndcontext.VndContext, *TREQ) error) echo.HandlerFunc
- type CallDelegate
- type CallDelegateAny
- type CallDelegateSSE
- type GenericResult
- type Pagination
- type PaginationReq
- type Result
Constants ¶
View Source
const RequestObjectContextKey = "service_requestObject"
Variables ¶
This section is empty.
Functions ¶
func CallAny ¶ added in v0.0.11
func CallAny[REQ any](e vndcontext.VndContext, req *REQ, name string, delegate CallDelegateAny[REQ]) (any, error)
func CallSSE ¶ added in v0.0.12
func CallSSE[REQ any](e vndcontext.VndContext, req *REQ, name string, delegate CallDelegateSSE[REQ]) error
func Wrapper ¶
func Wrapper[TREQ any](wrapped func(vndcontext.VndContext, *TREQ) (*Result, error)) echo.HandlerFunc
func WrapperAny ¶ added in v0.0.10
func WrapperAny[TREQ any](wrapped func(vndcontext.VndContext, *TREQ) (any, error)) echo.HandlerFunc
func WrapperSSE ¶ added in v0.0.12
func WrapperSSE[TREQ any](wrapped func(vndcontext.VndContext, *TREQ) error) echo.HandlerFunc
Types ¶
type CallDelegate ¶
type CallDelegate[REQ any] func(*logger.Logger, vndcontext.VndContext, *REQ) (*Result, error)
type CallDelegateAny ¶ added in v0.0.11
type CallDelegateAny[REQ any] func(*logger.Logger, vndcontext.VndContext, *REQ) (any, error)
type CallDelegateSSE ¶ added in v0.0.12
type CallDelegateSSE[REQ any] func(*logger.Logger, vndcontext.VndContext, *REQ) error
type GenericResult ¶
type GenericResult[T any] struct { RequestId string `json:"requestId,omitempty"` Data T `json:"data"` Pagination *Pagination `json:"pagination,omitempty"` }
type Pagination ¶
type Pagination struct {
Total int `json:"total"`
}
type PaginationReq ¶
type Result ¶
type Result struct {
RequestId string `json:"requestId,omitempty"`
Data any `json:"data"`
Pagination *Pagination `json:"pagination,omitempty"`
}
func Call ¶
func Call[REQ any](e vndcontext.VndContext, req *REQ, name string, delegate CallDelegate[REQ]) (*Result, error)
Click to show internal directories.
Click to hide internal directories.