Documentation
¶
Index ¶
- Constants
- Variables
- func Module(extends ...di.Node) di.Node
- func NewFiberApp(config FiberConfig) *fiber.App
- func NopOtelMiddleware() di.Node
- func Priority(value PriorityLevel) di.Option
- func RegisterFiberApp(lc fx.Lifecycle, app *fiber.App, logger *zap.Logger, config Config)
- func SetupHandlers(in setupHandlersIn)
- func UseBuildInfo(opts ...BuildInfoOption) di.Node
- func UseOtel() di.Node
- func UseSpa(opts ...SpaOption) di.Node
- func UseSwagger(opts ...SwaggerOption) di.Node
- type BuildInfoHandler
- type BuildInfoOption
- type Config
- type DateQuery
- type Error
- type ErrorDetail
- type FiberConfig
- type Handler
- type MockHandler
- type MockHandler_Expecter
- type MockHandler_Handle_Call
- type OtelMiddleware
- type PageQuery
- type PagedMeta
- type PagedResponse
- type PriorityLevel
- type Response
- type SpaMiddleware
- type SpaOption
- type SwaggerHandler
- type SwaggerOption
Constants ¶
View Source
const ( Earliest = di.Earliest Earlier = di.Earlier Normal = di.Normal Later = di.Later Latest = di.Latest )
View Source
const DefaultSpaDistPath = "web/dist"
Variables ¶
View Source
var HandlersGroupName = "us.handlers"
Functions ¶
func NewFiberApp ¶
func NewFiberApp(config FiberConfig) *fiber.App
func NopOtelMiddleware ¶
func Priority ¶
func Priority(value PriorityLevel) di.Option
func RegisterFiberApp ¶
func SetupHandlers ¶
func SetupHandlers(in setupHandlersIn)
func UseBuildInfo ¶
func UseBuildInfo(opts ...BuildInfoOption) di.Node
func UseSwagger ¶
func UseSwagger(opts ...SwaggerOption) di.Node
Types ¶
type BuildInfoHandler ¶
func NewBuildInfoHandler ¶
func NewBuildInfoHandler(opts ...BuildInfoOption) *BuildInfoHandler
type BuildInfoOption ¶
func WithDefaultPath ¶
func WithDefaultPath(path ...string) BuildInfoOption
type Error ¶
type Error struct {
Error ErrorDetail `json:"error"`
RequestID string `json:"request_id"`
}
type ErrorDetail ¶
type FiberConfig ¶
type FiberConfig struct {
Name string `mapstructure:"name"`
}
type MockHandler ¶ added in v1.2.0
MockHandler is an autogenerated mock type for the Handler type
func NewMockHandler ¶ added in v1.2.0
func NewMockHandler(t interface {
mock.TestingT
Cleanup(func())
}) *MockHandler
NewMockHandler creates a new instance of MockHandler. 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 (*MockHandler) EXPECT ¶ added in v1.2.0
func (_m *MockHandler) EXPECT() *MockHandler_Expecter
func (*MockHandler) Handle ¶ added in v1.2.0
func (_mock *MockHandler) Handle(r fiber.Router)
Handle provides a mock function for the type MockHandler
type MockHandler_Expecter ¶ added in v1.2.0
type MockHandler_Expecter struct {
// contains filtered or unexported fields
}
func (*MockHandler_Expecter) Handle ¶ added in v1.2.0
func (_e *MockHandler_Expecter) Handle(r interface{}) *MockHandler_Handle_Call
Handle is a helper method to define mock.On call
- r fiber.Router
type MockHandler_Handle_Call ¶ added in v1.2.0
MockHandler_Handle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handle'
func (*MockHandler_Handle_Call) Return ¶ added in v1.2.0
func (_c *MockHandler_Handle_Call) Return() *MockHandler_Handle_Call
func (*MockHandler_Handle_Call) Run ¶ added in v1.2.0
func (_c *MockHandler_Handle_Call) Run(run func(r fiber.Router)) *MockHandler_Handle_Call
func (*MockHandler_Handle_Call) RunAndReturn ¶ added in v1.2.0
func (_c *MockHandler_Handle_Call) RunAndReturn(run func(r fiber.Router)) *MockHandler_Handle_Call
type OtelMiddleware ¶
func NewOtelMiddleware ¶
func NewOtelMiddleware(config otel.Config, lp *otel.LoggerProvider) *OtelMiddleware
func (*OtelMiddleware) Handle ¶
func (h *OtelMiddleware) Handle(r fiber.Router)
type PagedResponse ¶
type PriorityLevel ¶
type PriorityLevel = di.PriorityLevel
func Between ¶
func Between(lower, upper PriorityLevel) PriorityLevel
type SpaMiddleware ¶
type SpaMiddleware struct {
// contains filtered or unexported fields
}
func NewSpaMiddleware ¶
func NewSpaMiddlewareWithOptions ¶ added in v1.2.0
func NewSpaMiddlewareWithOptions(opts ...SpaOption) (*SpaMiddleware, error)
func (*SpaMiddleware) Handle ¶
func (s *SpaMiddleware) Handle(r fiber.Router)
type SpaOption ¶ added in v1.2.0
type SpaOption func(*spaOptions)
func WithSpaAssets ¶ added in v1.2.0
func WithSpaDistPath ¶ added in v1.2.0
func WithSpaLogger ¶ added in v1.2.0
type SwaggerHandler ¶
type SwaggerHandler struct {
// contains filtered or unexported fields
}
func NewSwaggerHandler ¶
func NewSwaggerHandler(config Config) (*SwaggerHandler, error)
func NewSwaggerHandlerWithOptions ¶ added in v1.2.0
func NewSwaggerHandlerWithOptions(opts ...SwaggerOption) (*SwaggerHandler, error)
func (*SwaggerHandler) Handle ¶
func (h *SwaggerHandler) Handle(r fiber.Router)
type SwaggerOption ¶ added in v1.2.0
type SwaggerOption func(*swaggerOptions)
func WithSwaggerConfig ¶ added in v1.2.0
func WithSwaggerConfig(config Config) SwaggerOption
func WithSwaggerPath ¶ added in v1.2.0
func WithSwaggerPath(path string) SwaggerOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.