Documentation
¶
Index ¶
- func WriteJSONBody(b *bytes.Buffer, body any, status int, altError string, w http.ResponseWriter)
- type HealthCheckFn
- type Option
- func WithAddr(a *string) Option[*ServiceOptions]
- func WithContext(ctx context.Context) Option[*ServiceOptions]
- func WithHealthCheck[T *SidecarOptions | *ServiceOptions](healthChkFn HealthCheckFn) Option[T]
- func WithInitRoutesFn(i initRoutesFn) Option[*ServiceOptions]
- func WithListener[T *SidecarOptions | *ServiceOptions](listener service.HTTPListener) Option[T]
- func WithName(n string) Option[*ServiceOptions]
- func WithPrimaryService(svc *service.Base) Option[*SidecarOptions]
- func WithStackLevelOnError[T *SidecarOptions | *ServiceOptions](lvl StackLevel) Option[T]
- type RecoveryFunc
- type Service
- type ServiceOptions
- type SidecarOptions
- type StackLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSONBody ¶
Types ¶
type Option ¶
type Option[T httpOptions] interface {
Apply(T)
}
func WithAddr ¶
func WithAddr(a *string) Option[*ServiceOptions]
func WithContext ¶
func WithContext(ctx context.Context) Option[*ServiceOptions]
func WithHealthCheck ¶
func WithHealthCheck[T *SidecarOptions | *ServiceOptions](healthChkFn HealthCheckFn) Option[T]
func WithListener ¶
func WithListener[T *SidecarOptions | *ServiceOptions](listener service.HTTPListener) Option[T]
func WithName ¶
func WithName(n string) Option[*ServiceOptions]
func WithPrimaryService ¶
func WithPrimaryService(svc *service.Base) Option[*SidecarOptions]
func WithStackLevelOnError ¶
func WithStackLevelOnError[T *SidecarOptions | *ServiceOptions](lvl StackLevel) Option[T]
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 NewSidecar ¶
func NewSidecar(opts ...Option[*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.