Documentation
¶
Index ¶
- Constants
- Variables
- type CorsOption
- type Manager
- type MiddlewareHandler
- type MockManager
- func (_mock *MockManager) AddMiddleware(middlewareHandler MiddlewareHandler) Manager
- func (_mock *MockManager) AddRoute(opts ...RouteOption) Manager
- func (_mock *MockManager) AddRouteGroup(opts ...RouteGroupOption) Manager
- func (_m *MockManager) EXPECT() *MockManager_Expecter
- func (_mock *MockManager) EnableTLS(tls *TLS) Manager
- func (_mock *MockManager) GetShutdownHandler() bool
- func (_mock *MockManager) GetShutdownTimeout() time.Duration
- func (_mock *MockManager) Listen() <-chan error
- func (_mock *MockManager) SetCore(core *fasthttp.Server) Manager
- func (_mock *MockManager) SetListener(listener net.Listener) Manager
- func (_mock *MockManager) SetRouter(router1 *router.Router) Manager
- func (_mock *MockManager) SetTelemetryManager(telemetry1 telemetry.Manager) Manager
- func (_mock *MockManager) Shutdown(ctx context.Context, code int) error
- func (_mock *MockManager) Up()
- func (_mock *MockManager) UseCors(opts ...CorsOption) Manager
- func (_mock *MockManager) UseProfiling() Manager
- func (_mock *MockManager) UseSwagger() Manager
- type MockManager_AddMiddleware_Call
- func (_c *MockManager_AddMiddleware_Call) Return(manager Manager) *MockManager_AddMiddleware_Call
- func (_c *MockManager_AddMiddleware_Call) Run(run func(middlewareHandler MiddlewareHandler)) *MockManager_AddMiddleware_Call
- func (_c *MockManager_AddMiddleware_Call) RunAndReturn(run func(middlewareHandler MiddlewareHandler) Manager) *MockManager_AddMiddleware_Call
- type MockManager_AddRouteGroup_Call
- func (_c *MockManager_AddRouteGroup_Call) Return(manager Manager) *MockManager_AddRouteGroup_Call
- func (_c *MockManager_AddRouteGroup_Call) Run(run func(opts ...RouteGroupOption)) *MockManager_AddRouteGroup_Call
- func (_c *MockManager_AddRouteGroup_Call) RunAndReturn(run func(opts ...RouteGroupOption) Manager) *MockManager_AddRouteGroup_Call
- type MockManager_AddRoute_Call
- func (_c *MockManager_AddRoute_Call) Return(manager Manager) *MockManager_AddRoute_Call
- func (_c *MockManager_AddRoute_Call) Run(run func(opts ...RouteOption)) *MockManager_AddRoute_Call
- func (_c *MockManager_AddRoute_Call) RunAndReturn(run func(opts ...RouteOption) Manager) *MockManager_AddRoute_Call
- type MockManager_EnableTLS_Call
- type MockManager_Expecter
- func (_e *MockManager_Expecter) AddMiddleware(middlewareHandler interface{}) *MockManager_AddMiddleware_Call
- func (_e *MockManager_Expecter) AddRoute(opts ...interface{}) *MockManager_AddRoute_Call
- func (_e *MockManager_Expecter) AddRouteGroup(opts ...interface{}) *MockManager_AddRouteGroup_Call
- func (_e *MockManager_Expecter) EnableTLS(tls interface{}) *MockManager_EnableTLS_Call
- func (_e *MockManager_Expecter) GetShutdownHandler() *MockManager_GetShutdownHandler_Call
- func (_e *MockManager_Expecter) GetShutdownTimeout() *MockManager_GetShutdownTimeout_Call
- func (_e *MockManager_Expecter) Listen() *MockManager_Listen_Call
- func (_e *MockManager_Expecter) SetCore(core interface{}) *MockManager_SetCore_Call
- func (_e *MockManager_Expecter) SetListener(listener interface{}) *MockManager_SetListener_Call
- func (_e *MockManager_Expecter) SetRouter(router1 interface{}) *MockManager_SetRouter_Call
- func (_e *MockManager_Expecter) SetTelemetryManager(telemetry1 interface{}) *MockManager_SetTelemetryManager_Call
- func (_e *MockManager_Expecter) Shutdown(ctx interface{}, code interface{}) *MockManager_Shutdown_Call
- func (_e *MockManager_Expecter) Up() *MockManager_Up_Call
- func (_e *MockManager_Expecter) UseCors(opts ...interface{}) *MockManager_UseCors_Call
- func (_e *MockManager_Expecter) UseProfiling() *MockManager_UseProfiling_Call
- func (_e *MockManager_Expecter) UseSwagger() *MockManager_UseSwagger_Call
- type MockManager_GetShutdownHandler_Call
- func (_c *MockManager_GetShutdownHandler_Call) Return(b bool) *MockManager_GetShutdownHandler_Call
- func (_c *MockManager_GetShutdownHandler_Call) Run(run func()) *MockManager_GetShutdownHandler_Call
- func (_c *MockManager_GetShutdownHandler_Call) RunAndReturn(run func() bool) *MockManager_GetShutdownHandler_Call
- type MockManager_GetShutdownTimeout_Call
- func (_c *MockManager_GetShutdownTimeout_Call) Return(duration time.Duration) *MockManager_GetShutdownTimeout_Call
- func (_c *MockManager_GetShutdownTimeout_Call) Run(run func()) *MockManager_GetShutdownTimeout_Call
- func (_c *MockManager_GetShutdownTimeout_Call) RunAndReturn(run func() time.Duration) *MockManager_GetShutdownTimeout_Call
- type MockManager_Listen_Call
- type MockManager_SetCore_Call
- func (_c *MockManager_SetCore_Call) Return(manager Manager) *MockManager_SetCore_Call
- func (_c *MockManager_SetCore_Call) Run(run func(core *fasthttp.Server)) *MockManager_SetCore_Call
- func (_c *MockManager_SetCore_Call) RunAndReturn(run func(core *fasthttp.Server) Manager) *MockManager_SetCore_Call
- type MockManager_SetListener_Call
- func (_c *MockManager_SetListener_Call) Return(manager Manager) *MockManager_SetListener_Call
- func (_c *MockManager_SetListener_Call) Run(run func(listener net.Listener)) *MockManager_SetListener_Call
- func (_c *MockManager_SetListener_Call) RunAndReturn(run func(listener net.Listener) Manager) *MockManager_SetListener_Call
- type MockManager_SetRouter_Call
- func (_c *MockManager_SetRouter_Call) Return(manager Manager) *MockManager_SetRouter_Call
- func (_c *MockManager_SetRouter_Call) Run(run func(router1 *router.Router)) *MockManager_SetRouter_Call
- func (_c *MockManager_SetRouter_Call) RunAndReturn(run func(router1 *router.Router) Manager) *MockManager_SetRouter_Call
- type MockManager_SetTelemetryManager_Call
- func (_c *MockManager_SetTelemetryManager_Call) Return(manager Manager) *MockManager_SetTelemetryManager_Call
- func (_c *MockManager_SetTelemetryManager_Call) Run(run func(telemetry1 telemetry.Manager)) *MockManager_SetTelemetryManager_Call
- func (_c *MockManager_SetTelemetryManager_Call) RunAndReturn(run func(telemetry1 telemetry.Manager) Manager) *MockManager_SetTelemetryManager_Call
- type MockManager_Shutdown_Call
- func (_c *MockManager_Shutdown_Call) Return(err error) *MockManager_Shutdown_Call
- func (_c *MockManager_Shutdown_Call) Run(run func(ctx context.Context, code int)) *MockManager_Shutdown_Call
- func (_c *MockManager_Shutdown_Call) RunAndReturn(run func(ctx context.Context, code int) error) *MockManager_Shutdown_Call
- type MockManager_Up_Call
- type MockManager_UseCors_Call
- type MockManager_UseProfiling_Call
- type MockManager_UseSwagger_Call
- type Option
- func WithCore(core *fasthttp.Server) Option
- func WithCoreOptions(opts ...core.Option) Option
- func WithListener(listener net.Listener) Option
- func WithListenerOptions(opts ...listener.Option) Option
- func WithRouter(router *fasthttpRouter.Router) Option
- func WithRouterOptions(opts ...router.Option) Option
- func WithShutdownTimeout(timeout time.Duration) Option
- func WithTLS(tls *TLS) Option
- func WithTelemetryManager(telemetry telemetry.Manager) Option
- func WithoutShutdownHandler() Option
- type RequestContext
- func (c *RequestContext) GetBearerToken() (string, error)
- func (c *RequestContext) GetContext() context.Context
- func (c *RequestContext) GetHeaderStr(key string) string
- func (c *RequestContext) GetIpAddr() string
- func (c *RequestContext) ReadJsonBody(data any) error
- func (c *RequestContext) SetTraceIdHeader()
- func (c *RequestContext) UserValueBool(key any) (bool, error)
- func (c *RequestContext) UserValueInt(key any) (int, error)
- func (c *RequestContext) UserValueStr(key any) (string, error)
- func (c *RequestContext) UserValueStrBase64(key any) (string, error)
- func (c *RequestContext) UserValueUint(key any) (uint, error)
- func (c *RequestContext) Write(p []byte) (int, error)
- func (c *RequestContext) WriteError(err error)
- func (c *RequestContext) WriteJson(data any) error
- func (c *RequestContext) WriteJsonWithStatusCode(statusCode http.StatusCode, data any) error
- func (c *RequestContext) WriteStatusCode(code http.StatusCode)
- func (c *RequestContext) WriteString(s string) (int, error)
- type RequestHandler
- type RouteGroupOption
- type RouteOption
- func WithRouteBodyParserHandler[T any](handler func(context.Context, *RequestContext, *T)) RouteOption
- func WithRouteHandler(handler func(context.Context, *RequestContext)) RouteOption
- func WithRouteMethod(method string) RouteOption
- func WithRouteMiddlewares(middlewares ...MiddlewareHandler) RouteOption
- func WithRoutePath(path string) RouteOption
- type TLS
Constants ¶
Variables ¶
var ErrorStatusCodeMap = map[error]int{ errors.ErrBadRequest: fasthttp.StatusBadRequest, errors.ErrUnauthorized: fasthttp.StatusUnauthorized, errors.ErrPaymentRequired: fasthttp.StatusPaymentRequired, errors.ErrForbidden: fasthttp.StatusForbidden, errors.ErrNotFound: fasthttp.StatusNotFound, errors.ErrMethodNotAllowed: fasthttp.StatusMethodNotAllowed, errors.ErrConflict: fasthttp.StatusConflict, errors.ErrGone: fasthttp.StatusGone, errors.ErrRequestEntityTooLarge: fasthttp.StatusRequestEntityTooLarge, errors.ErrUnsupportedMediaType: fasthttp.StatusUnsupportedMediaType, errors.ErrRequestedRangeNotSatisfiable: fasthttp.StatusRequestedRangeNotSatisfiable, errors.ErrTeapot: fasthttp.StatusTeapot, errors.ErrUnprocessableEntity: fasthttp.StatusUnprocessableEntity, errors.ErrLocked: fasthttp.StatusLocked, errors.ErrFailedDependency: fasthttp.StatusFailedDependency, errors.ErrPreconditionRequired: fasthttp.StatusPreconditionRequired, errors.ErrTooManyRequests: fasthttp.StatusTooManyRequests, errors.ErrUnavailableForLegalReasons: fasthttp.StatusUnavailableForLegalReasons, errors.ErrInternalServerError: fasthttp.StatusInternalServerError, errors.ErrNotImplemented: fasthttp.StatusNotImplemented, errors.ErrBadGateway: fasthttp.StatusBadGateway, errors.ErrServiceUnavailable: fasthttp.StatusServiceUnavailable, errors.ErrGatewayTimeout: fasthttp.StatusGatewayTimeout, errors.ErrLoopDetected: fasthttp.StatusLoopDetected, }
Functions ¶
This section is empty.
Types ¶
type CorsOption ¶
type CorsOption func(*cors)
func WithCorsHeaders ¶
func WithCorsHeaders(headers string) CorsOption
func WithCorsMethods ¶
func WithCorsMethods(methods string) CorsOption
func WithCorsOrigin ¶
func WithCorsOrigin(origin string) CorsOption
type Manager ¶ added in v0.4.0
type Manager interface {
SetListener(listener net.Listener) Manager
SetCore(core *fasthttp.Server) Manager
SetRouter(router *fasthttpRouter.Router) Manager
SetTelemetryManager(telemetry telemetry.Manager) Manager
EnableTLS(tls *TLS) Manager
AddMiddleware(MiddlewareHandler) Manager
AddRoute(opts ...RouteOption) Manager
AddRouteGroup(opts ...RouteGroupOption) Manager
UseCors(opts ...CorsOption) Manager
UseSwagger() Manager
UseProfiling() Manager
Listen() <-chan error
Up()
GetShutdownTimeout() time.Duration
GetShutdownHandler() bool
Shutdown(ctx context.Context, code int) error
}
type MiddlewareHandler ¶
type MiddlewareHandler func(RequestHandler) RequestHandler
type MockManager ¶ added in v0.11.0
MockManager is an autogenerated mock type for the Manager type
func NewMockManager ¶ added in v0.11.0
func NewMockManager(t interface {
mock.TestingT
Cleanup(func())
}) *MockManager
NewMockManager creates a new instance of MockManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockManager) AddMiddleware ¶ added in v0.11.0
func (_mock *MockManager) AddMiddleware(middlewareHandler MiddlewareHandler) Manager
AddMiddleware provides a mock function for the type MockManager
func (*MockManager) AddRoute ¶ added in v0.11.0
func (_mock *MockManager) AddRoute(opts ...RouteOption) Manager
AddRoute provides a mock function for the type MockManager
func (*MockManager) AddRouteGroup ¶ added in v0.11.0
func (_mock *MockManager) AddRouteGroup(opts ...RouteGroupOption) Manager
AddRouteGroup provides a mock function for the type MockManager
func (*MockManager) EXPECT ¶ added in v0.11.0
func (_m *MockManager) EXPECT() *MockManager_Expecter
func (*MockManager) EnableTLS ¶ added in v0.11.0
func (_mock *MockManager) EnableTLS(tls *TLS) Manager
EnableTLS provides a mock function for the type MockManager
func (*MockManager) GetShutdownHandler ¶ added in v0.11.0
func (_mock *MockManager) GetShutdownHandler() bool
GetShutdownHandler provides a mock function for the type MockManager
func (*MockManager) GetShutdownTimeout ¶ added in v0.11.0
func (_mock *MockManager) GetShutdownTimeout() time.Duration
GetShutdownTimeout provides a mock function for the type MockManager
func (*MockManager) Listen ¶ added in v0.11.0
func (_mock *MockManager) Listen() <-chan error
Listen provides a mock function for the type MockManager
func (*MockManager) SetCore ¶ added in v0.11.0
func (_mock *MockManager) SetCore(core *fasthttp.Server) Manager
SetCore provides a mock function for the type MockManager
func (*MockManager) SetListener ¶ added in v0.11.0
func (_mock *MockManager) SetListener(listener net.Listener) Manager
SetListener provides a mock function for the type MockManager
func (*MockManager) SetRouter ¶ added in v0.11.0
func (_mock *MockManager) SetRouter(router1 *router.Router) Manager
SetRouter provides a mock function for the type MockManager
func (*MockManager) SetTelemetryManager ¶ added in v0.11.0
func (_mock *MockManager) SetTelemetryManager(telemetry1 telemetry.Manager) Manager
SetTelemetryManager provides a mock function for the type MockManager
func (*MockManager) Shutdown ¶ added in v0.11.0
func (_mock *MockManager) Shutdown(ctx context.Context, code int) error
Shutdown provides a mock function for the type MockManager
func (*MockManager) Up ¶ added in v0.11.0
func (_mock *MockManager) Up()
Up provides a mock function for the type MockManager
func (*MockManager) UseCors ¶ added in v0.11.0
func (_mock *MockManager) UseCors(opts ...CorsOption) Manager
UseCors provides a mock function for the type MockManager
func (*MockManager) UseProfiling ¶ added in v0.11.0
func (_mock *MockManager) UseProfiling() Manager
UseProfiling provides a mock function for the type MockManager
func (*MockManager) UseSwagger ¶ added in v0.11.0
func (_mock *MockManager) UseSwagger() Manager
UseSwagger provides a mock function for the type MockManager
type MockManager_AddMiddleware_Call ¶ added in v0.11.0
MockManager_AddMiddleware_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddMiddleware'
func (*MockManager_AddMiddleware_Call) Return ¶ added in v0.11.0
func (_c *MockManager_AddMiddleware_Call) Return(manager Manager) *MockManager_AddMiddleware_Call
func (*MockManager_AddMiddleware_Call) Run ¶ added in v0.11.0
func (_c *MockManager_AddMiddleware_Call) Run(run func(middlewareHandler MiddlewareHandler)) *MockManager_AddMiddleware_Call
func (*MockManager_AddMiddleware_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_AddMiddleware_Call) RunAndReturn(run func(middlewareHandler MiddlewareHandler) Manager) *MockManager_AddMiddleware_Call
type MockManager_AddRouteGroup_Call ¶ added in v0.11.0
MockManager_AddRouteGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRouteGroup'
func (*MockManager_AddRouteGroup_Call) Return ¶ added in v0.11.0
func (_c *MockManager_AddRouteGroup_Call) Return(manager Manager) *MockManager_AddRouteGroup_Call
func (*MockManager_AddRouteGroup_Call) Run ¶ added in v0.11.0
func (_c *MockManager_AddRouteGroup_Call) Run(run func(opts ...RouteGroupOption)) *MockManager_AddRouteGroup_Call
func (*MockManager_AddRouteGroup_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_AddRouteGroup_Call) RunAndReturn(run func(opts ...RouteGroupOption) Manager) *MockManager_AddRouteGroup_Call
type MockManager_AddRoute_Call ¶ added in v0.11.0
MockManager_AddRoute_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddRoute'
func (*MockManager_AddRoute_Call) Return ¶ added in v0.11.0
func (_c *MockManager_AddRoute_Call) Return(manager Manager) *MockManager_AddRoute_Call
func (*MockManager_AddRoute_Call) Run ¶ added in v0.11.0
func (_c *MockManager_AddRoute_Call) Run(run func(opts ...RouteOption)) *MockManager_AddRoute_Call
func (*MockManager_AddRoute_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_AddRoute_Call) RunAndReturn(run func(opts ...RouteOption) Manager) *MockManager_AddRoute_Call
type MockManager_EnableTLS_Call ¶ added in v0.11.0
MockManager_EnableTLS_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableTLS'
func (*MockManager_EnableTLS_Call) Return ¶ added in v0.11.0
func (_c *MockManager_EnableTLS_Call) Return(manager Manager) *MockManager_EnableTLS_Call
func (*MockManager_EnableTLS_Call) Run ¶ added in v0.11.0
func (_c *MockManager_EnableTLS_Call) Run(run func(tls *TLS)) *MockManager_EnableTLS_Call
func (*MockManager_EnableTLS_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_EnableTLS_Call) RunAndReturn(run func(tls *TLS) Manager) *MockManager_EnableTLS_Call
type MockManager_Expecter ¶ added in v0.11.0
type MockManager_Expecter struct {
// contains filtered or unexported fields
}
func (*MockManager_Expecter) AddMiddleware ¶ added in v0.11.0
func (_e *MockManager_Expecter) AddMiddleware(middlewareHandler interface{}) *MockManager_AddMiddleware_Call
AddMiddleware is a helper method to define mock.On call
- middlewareHandler MiddlewareHandler
func (*MockManager_Expecter) AddRoute ¶ added in v0.11.0
func (_e *MockManager_Expecter) AddRoute(opts ...interface{}) *MockManager_AddRoute_Call
AddRoute is a helper method to define mock.On call
- opts ...RouteOption
func (*MockManager_Expecter) AddRouteGroup ¶ added in v0.11.0
func (_e *MockManager_Expecter) AddRouteGroup(opts ...interface{}) *MockManager_AddRouteGroup_Call
AddRouteGroup is a helper method to define mock.On call
- opts ...RouteGroupOption
func (*MockManager_Expecter) EnableTLS ¶ added in v0.11.0
func (_e *MockManager_Expecter) EnableTLS(tls interface{}) *MockManager_EnableTLS_Call
EnableTLS is a helper method to define mock.On call
- tls *TLS
func (*MockManager_Expecter) GetShutdownHandler ¶ added in v0.11.0
func (_e *MockManager_Expecter) GetShutdownHandler() *MockManager_GetShutdownHandler_Call
GetShutdownHandler is a helper method to define mock.On call
func (*MockManager_Expecter) GetShutdownTimeout ¶ added in v0.11.0
func (_e *MockManager_Expecter) GetShutdownTimeout() *MockManager_GetShutdownTimeout_Call
GetShutdownTimeout is a helper method to define mock.On call
func (*MockManager_Expecter) Listen ¶ added in v0.11.0
func (_e *MockManager_Expecter) Listen() *MockManager_Listen_Call
Listen is a helper method to define mock.On call
func (*MockManager_Expecter) SetCore ¶ added in v0.11.0
func (_e *MockManager_Expecter) SetCore(core interface{}) *MockManager_SetCore_Call
SetCore is a helper method to define mock.On call
- core *fasthttp.Server
func (*MockManager_Expecter) SetListener ¶ added in v0.11.0
func (_e *MockManager_Expecter) SetListener(listener interface{}) *MockManager_SetListener_Call
SetListener is a helper method to define mock.On call
- listener net.Listener
func (*MockManager_Expecter) SetRouter ¶ added in v0.11.0
func (_e *MockManager_Expecter) SetRouter(router1 interface{}) *MockManager_SetRouter_Call
SetRouter is a helper method to define mock.On call
- router1 *router.Router
func (*MockManager_Expecter) SetTelemetryManager ¶ added in v0.11.0
func (_e *MockManager_Expecter) SetTelemetryManager(telemetry1 interface{}) *MockManager_SetTelemetryManager_Call
SetTelemetryManager is a helper method to define mock.On call
- telemetry1 telemetry.Manager
func (*MockManager_Expecter) Shutdown ¶ added in v0.11.0
func (_e *MockManager_Expecter) Shutdown(ctx interface{}, code interface{}) *MockManager_Shutdown_Call
Shutdown is a helper method to define mock.On call
- ctx context.Context
- code int
func (*MockManager_Expecter) Up ¶ added in v0.11.0
func (_e *MockManager_Expecter) Up() *MockManager_Up_Call
Up is a helper method to define mock.On call
func (*MockManager_Expecter) UseCors ¶ added in v0.11.0
func (_e *MockManager_Expecter) UseCors(opts ...interface{}) *MockManager_UseCors_Call
UseCors is a helper method to define mock.On call
- opts ...CorsOption
func (*MockManager_Expecter) UseProfiling ¶ added in v0.11.0
func (_e *MockManager_Expecter) UseProfiling() *MockManager_UseProfiling_Call
UseProfiling is a helper method to define mock.On call
func (*MockManager_Expecter) UseSwagger ¶ added in v0.11.0
func (_e *MockManager_Expecter) UseSwagger() *MockManager_UseSwagger_Call
UseSwagger is a helper method to define mock.On call
type MockManager_GetShutdownHandler_Call ¶ added in v0.11.0
MockManager_GetShutdownHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShutdownHandler'
func (*MockManager_GetShutdownHandler_Call) Return ¶ added in v0.11.0
func (_c *MockManager_GetShutdownHandler_Call) Return(b bool) *MockManager_GetShutdownHandler_Call
func (*MockManager_GetShutdownHandler_Call) Run ¶ added in v0.11.0
func (_c *MockManager_GetShutdownHandler_Call) Run(run func()) *MockManager_GetShutdownHandler_Call
func (*MockManager_GetShutdownHandler_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_GetShutdownHandler_Call) RunAndReturn(run func() bool) *MockManager_GetShutdownHandler_Call
type MockManager_GetShutdownTimeout_Call ¶ added in v0.11.0
MockManager_GetShutdownTimeout_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetShutdownTimeout'
func (*MockManager_GetShutdownTimeout_Call) Return ¶ added in v0.11.0
func (_c *MockManager_GetShutdownTimeout_Call) Return(duration time.Duration) *MockManager_GetShutdownTimeout_Call
func (*MockManager_GetShutdownTimeout_Call) Run ¶ added in v0.11.0
func (_c *MockManager_GetShutdownTimeout_Call) Run(run func()) *MockManager_GetShutdownTimeout_Call
func (*MockManager_GetShutdownTimeout_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_GetShutdownTimeout_Call) RunAndReturn(run func() time.Duration) *MockManager_GetShutdownTimeout_Call
type MockManager_Listen_Call ¶ added in v0.11.0
MockManager_Listen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Listen'
func (*MockManager_Listen_Call) Return ¶ added in v0.11.0
func (_c *MockManager_Listen_Call) Return(errCh <-chan error) *MockManager_Listen_Call
func (*MockManager_Listen_Call) Run ¶ added in v0.11.0
func (_c *MockManager_Listen_Call) Run(run func()) *MockManager_Listen_Call
func (*MockManager_Listen_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_Listen_Call) RunAndReturn(run func() <-chan error) *MockManager_Listen_Call
type MockManager_SetCore_Call ¶ added in v0.11.0
MockManager_SetCore_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetCore'
func (*MockManager_SetCore_Call) Return ¶ added in v0.11.0
func (_c *MockManager_SetCore_Call) Return(manager Manager) *MockManager_SetCore_Call
func (*MockManager_SetCore_Call) Run ¶ added in v0.11.0
func (_c *MockManager_SetCore_Call) Run(run func(core *fasthttp.Server)) *MockManager_SetCore_Call
func (*MockManager_SetCore_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_SetCore_Call) RunAndReturn(run func(core *fasthttp.Server) Manager) *MockManager_SetCore_Call
type MockManager_SetListener_Call ¶ added in v0.11.0
MockManager_SetListener_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetListener'
func (*MockManager_SetListener_Call) Return ¶ added in v0.11.0
func (_c *MockManager_SetListener_Call) Return(manager Manager) *MockManager_SetListener_Call
func (*MockManager_SetListener_Call) Run ¶ added in v0.11.0
func (_c *MockManager_SetListener_Call) Run(run func(listener net.Listener)) *MockManager_SetListener_Call
func (*MockManager_SetListener_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_SetListener_Call) RunAndReturn(run func(listener net.Listener) Manager) *MockManager_SetListener_Call
type MockManager_SetRouter_Call ¶ added in v0.11.0
MockManager_SetRouter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRouter'
func (*MockManager_SetRouter_Call) Return ¶ added in v0.11.0
func (_c *MockManager_SetRouter_Call) Return(manager Manager) *MockManager_SetRouter_Call
func (*MockManager_SetRouter_Call) Run ¶ added in v0.11.0
func (_c *MockManager_SetRouter_Call) Run(run func(router1 *router.Router)) *MockManager_SetRouter_Call
func (*MockManager_SetRouter_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_SetRouter_Call) RunAndReturn(run func(router1 *router.Router) Manager) *MockManager_SetRouter_Call
type MockManager_SetTelemetryManager_Call ¶ added in v0.11.0
MockManager_SetTelemetryManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetTelemetryManager'
func (*MockManager_SetTelemetryManager_Call) Return ¶ added in v0.11.0
func (_c *MockManager_SetTelemetryManager_Call) Return(manager Manager) *MockManager_SetTelemetryManager_Call
func (*MockManager_SetTelemetryManager_Call) Run ¶ added in v0.11.0
func (_c *MockManager_SetTelemetryManager_Call) Run(run func(telemetry1 telemetry.Manager)) *MockManager_SetTelemetryManager_Call
func (*MockManager_SetTelemetryManager_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_SetTelemetryManager_Call) RunAndReturn(run func(telemetry1 telemetry.Manager) Manager) *MockManager_SetTelemetryManager_Call
type MockManager_Shutdown_Call ¶ added in v0.11.0
MockManager_Shutdown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shutdown'
func (*MockManager_Shutdown_Call) Return ¶ added in v0.11.0
func (_c *MockManager_Shutdown_Call) Return(err error) *MockManager_Shutdown_Call
func (*MockManager_Shutdown_Call) Run ¶ added in v0.11.0
func (_c *MockManager_Shutdown_Call) Run(run func(ctx context.Context, code int)) *MockManager_Shutdown_Call
func (*MockManager_Shutdown_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_Shutdown_Call) RunAndReturn(run func(ctx context.Context, code int) error) *MockManager_Shutdown_Call
type MockManager_Up_Call ¶ added in v0.11.0
MockManager_Up_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Up'
func (*MockManager_Up_Call) Return ¶ added in v0.11.0
func (_c *MockManager_Up_Call) Return() *MockManager_Up_Call
func (*MockManager_Up_Call) Run ¶ added in v0.11.0
func (_c *MockManager_Up_Call) Run(run func()) *MockManager_Up_Call
func (*MockManager_Up_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_Up_Call) RunAndReturn(run func()) *MockManager_Up_Call
type MockManager_UseCors_Call ¶ added in v0.11.0
MockManager_UseCors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseCors'
func (*MockManager_UseCors_Call) Return ¶ added in v0.11.0
func (_c *MockManager_UseCors_Call) Return(manager Manager) *MockManager_UseCors_Call
func (*MockManager_UseCors_Call) Run ¶ added in v0.11.0
func (_c *MockManager_UseCors_Call) Run(run func(opts ...CorsOption)) *MockManager_UseCors_Call
func (*MockManager_UseCors_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_UseCors_Call) RunAndReturn(run func(opts ...CorsOption) Manager) *MockManager_UseCors_Call
type MockManager_UseProfiling_Call ¶ added in v0.11.0
MockManager_UseProfiling_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseProfiling'
func (*MockManager_UseProfiling_Call) Return ¶ added in v0.11.0
func (_c *MockManager_UseProfiling_Call) Return(manager Manager) *MockManager_UseProfiling_Call
func (*MockManager_UseProfiling_Call) Run ¶ added in v0.11.0
func (_c *MockManager_UseProfiling_Call) Run(run func()) *MockManager_UseProfiling_Call
func (*MockManager_UseProfiling_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_UseProfiling_Call) RunAndReturn(run func() Manager) *MockManager_UseProfiling_Call
type MockManager_UseSwagger_Call ¶ added in v0.11.0
MockManager_UseSwagger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UseSwagger'
func (*MockManager_UseSwagger_Call) Return ¶ added in v0.11.0
func (_c *MockManager_UseSwagger_Call) Return(manager Manager) *MockManager_UseSwagger_Call
func (*MockManager_UseSwagger_Call) Run ¶ added in v0.11.0
func (_c *MockManager_UseSwagger_Call) Run(run func()) *MockManager_UseSwagger_Call
func (*MockManager_UseSwagger_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockManager_UseSwagger_Call) RunAndReturn(run func() Manager) *MockManager_UseSwagger_Call
type Option ¶
type Option func(*server) error
func WithCoreOptions ¶
func WithListener ¶
func WithListenerOptions ¶
func WithRouter ¶
func WithRouter(router *fasthttpRouter.Router) Option
func WithRouterOptions ¶
func WithShutdownTimeout ¶
func WithTelemetryManager ¶
func WithoutShutdownHandler ¶
func WithoutShutdownHandler() Option
type RequestContext ¶
type RequestContext struct {
*fasthttp.RequestCtx
}
func (*RequestContext) GetBearerToken ¶
func (c *RequestContext) GetBearerToken() (string, error)
func (*RequestContext) GetContext ¶
func (c *RequestContext) GetContext() context.Context
func (*RequestContext) GetHeaderStr ¶
func (c *RequestContext) GetHeaderStr(key string) string
func (*RequestContext) GetIpAddr ¶
func (c *RequestContext) GetIpAddr() string
func (*RequestContext) ReadJsonBody ¶
func (c *RequestContext) ReadJsonBody(data any) error
func (*RequestContext) SetTraceIdHeader ¶
func (c *RequestContext) SetTraceIdHeader()
func (*RequestContext) UserValueBool ¶
func (c *RequestContext) UserValueBool(key any) (bool, error)
func (*RequestContext) UserValueInt ¶
func (c *RequestContext) UserValueInt(key any) (int, error)
func (*RequestContext) UserValueStr ¶
func (c *RequestContext) UserValueStr(key any) (string, error)
func (*RequestContext) UserValueStrBase64 ¶ added in v0.6.0
func (c *RequestContext) UserValueStrBase64(key any) (string, error)
func (*RequestContext) UserValueUint ¶
func (c *RequestContext) UserValueUint(key any) (uint, error)
func (*RequestContext) WriteError ¶
func (c *RequestContext) WriteError(err error)
func (*RequestContext) WriteJson ¶
func (c *RequestContext) WriteJson(data any) error
func (*RequestContext) WriteJsonWithStatusCode ¶
func (c *RequestContext) WriteJsonWithStatusCode(statusCode http.StatusCode, data any) error
func (*RequestContext) WriteStatusCode ¶
func (c *RequestContext) WriteStatusCode(code http.StatusCode)
func (*RequestContext) WriteString ¶
func (c *RequestContext) WriteString(s string) (int, error)
type RequestHandler ¶
type RequestHandler func(*RequestContext)
type RouteGroupOption ¶
type RouteGroupOption func(*routeGroup)
func WithRouteGroup ¶
func WithRouteGroup(opts ...RouteGroupOption) RouteGroupOption
func WithRouteGroupMiddlewares ¶
func WithRouteGroupMiddlewares(middlewares ...MiddlewareHandler) RouteGroupOption
func WithRouteGroupPath ¶
func WithRouteGroupPath(path string) RouteGroupOption
func WithRouteGroupRoute ¶
func WithRouteGroupRoute(opts ...RouteOption) RouteGroupOption
type RouteOption ¶
type RouteOption func(*route)
func WithRouteBodyParserHandler ¶
func WithRouteBodyParserHandler[T any](handler func(context.Context, *RequestContext, *T)) RouteOption
func WithRouteHandler ¶
func WithRouteHandler(handler func(context.Context, *RequestContext)) RouteOption
func WithRouteMethod ¶
func WithRouteMethod(method string) RouteOption
func WithRouteMiddlewares ¶
func WithRouteMiddlewares(middlewares ...MiddlewareHandler) RouteOption
func WithRoutePath ¶
func WithRoutePath(path string) RouteOption