Documentation
¶
Index ¶
- func WithAddr(a *string) func(*RouterOptions)
- func WithContainer(svc *service.Service) func(*ServiceOptions)
- func WithContext(ctx context.Context) func(*RouterOptions)
- func WithHealthCheck[T *ServiceOptions | *RouterOptions](healthChkFn HealthChkFn) func(T)
- func WithInitRoutesFn(i initRoutesFn) func(*RouterOptions)
- func WithName(n string) func(*RouterOptions)
- func WriteJSONBody(b *bytes.Buffer, body any, status int, altError string, w http.ResponseWriter)
- type HealthChkFn
- type RecoveryFunc
- type RouterOptions
- type Service
- type ServiceOptions
- type StackLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAddr ¶
func WithAddr(a *string) func(*RouterOptions)
func WithContainer ¶
func WithContainer(svc *service.Service) func(*ServiceOptions)
func WithContext ¶
func WithContext(ctx context.Context) func(*RouterOptions)
func WithHealthCheck ¶
func WithHealthCheck[T *ServiceOptions | *RouterOptions](healthChkFn HealthChkFn) func(T)
func WithName ¶
func WithName(n string) func(*RouterOptions)
func WriteJSONBody ¶
Types ¶
type RecoveryFunc ¶
type RecoveryFunc struct {
StackLevel StackLevel
}
func (*RecoveryFunc) TryToRecover ¶
func (s *RecoveryFunc) TryToRecover() mux.MiddlewareFunc
type RouterOptions ¶
type RouterOptions struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...func(*RouterOptions)) (*Service, error)
func NewWithServiceContainer ¶
func NewWithServiceContainer(opts ...func(*ServiceOptions)) (*Service, error)
type ServiceOptions ¶
type ServiceOptions struct {
// contains filtered or unexported fields
}
type StackLevel ¶
type StackLevel int
const ( StackLevelSimple StackLevel = iota + 1 StackLevelFullStack )
Click to show internal directories.
Click to hide internal directories.