Documentation
¶
Index ¶
- func WithAddr(a *string) func(*ServiceOptions)
- func WithContext(ctx context.Context) func(*ServiceOptions)
- func WithHealthCheck[T *SidecarOptions | *ServiceOptions](healthChkFn HealthCheckFn) func(T)
- func WithInitRoutesFn(i initRoutesFn) func(*ServiceOptions)
- func WithName(n string) func(*ServiceOptions)
- func WithPrimaryService(svc *service.Base) func(*SidecarOptions)
- func WithStackLevelOnError[T *SidecarOptions | *ServiceOptions](lvl StackLevel) func(T)
- func WriteJSONBody(b *bytes.Buffer, body any, status int, altError string, w http.ResponseWriter)
- type HealthCheckFn
- type RecoveryFunc
- type Service
- type ServiceOptions
- type SidecarOptions
- type StackLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAddr ¶
func WithAddr(a *string) func(*ServiceOptions)
func WithContext ¶
func WithContext(ctx context.Context) func(*ServiceOptions)
func WithHealthCheck ¶
func WithHealthCheck[T *SidecarOptions | *ServiceOptions](healthChkFn HealthCheckFn) func(T)
func WithName ¶
func WithName(n string) func(*ServiceOptions)
func WithPrimaryService ¶
func WithPrimaryService(svc *service.Base) func(*SidecarOptions)
func WithStackLevelOnError ¶
func WithStackLevelOnError[T *SidecarOptions | *ServiceOptions](lvl StackLevel) func(T)
func WriteJSONBody ¶
Types ¶
type RecoveryFunc ¶
type RecoveryFunc struct {
StackLevel StackLevel
}
func (*RecoveryFunc) TryToRecover ¶
func (s *RecoveryFunc) TryToRecover() mux.MiddlewareFunc
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...func(*ServiceOptions)) (*Service, error)
func NewSidecar ¶
func NewSidecar(opts ...func(*SidecarOptions)) (*Service, error)
type ServiceOptions ¶
type ServiceOptions struct {
// contains filtered or unexported fields
}
type SidecarOptions ¶
type SidecarOptions 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.