Documentation ¶
Index ¶
- Constants
- func WriteJSONBody(b *bytes.Buffer, body any, status int, altError string, w http.ResponseWriter)
- type Container
- type HealthCheckClient
- type HealthCheckFn
- type Option
- func WithAddr(a string) Option[*ServiceOptions]
- func WithContext(ctx context.Context) Option[*ServiceOptions]
- func WithDisableOtel(otel bool) Option[*SidecarOptions]
- func WithHealthCheckFn[T *SidecarOptions | *ServiceOptions](healthChkFn HealthCheckFn) Option[T]
- func WithInitRoutesFn[T *SidecarOptions | *ServiceOptions](i initRoutesFn) Option[T]
- func WithListener[T *SidecarOptions | *ServiceOptions](listener service.HTTPListener) Option[T]
- func WithName(n string) Option[*ServiceOptions]
- func WithPrimaryService(svc *service.Base) Option[*SidecarOptions]
- func WithProfilingEnabled(p bool) Option[*ServiceOptions]
- func WithStackLevelOnError[T *SidecarOptions | *ServiceOptions](lvl StackLevel) Option[T]
- type RecoveryFunc
- type Service
- type ServiceOptions
- type SidecarOptions
- type StackLevel
Constants ¶
View Source
const Kind = service.HTTP
Variables ¶
This section is empty.
Functions ¶
func WriteJSONBody ¶
Types ¶
type Container ¶
func (*Container) AddrOrPanic ¶
func (*Container) NewHealthCheckClient ¶
func (c *Container) NewHealthCheckClient() (service.HealthChecker, error)
type HealthCheckClient ¶
type HealthCheckClient struct { ServerAddr string Builder service.HTTPClientBuilder }
func (*HealthCheckClient) Close ¶
func (c *HealthCheckClient) Close() error
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 WithDisableOtel ¶
func WithDisableOtel(otel bool) Option[*SidecarOptions]
func WithHealthCheckFn ¶
func WithHealthCheckFn[T *SidecarOptions | *ServiceOptions](healthChkFn HealthCheckFn) Option[T]
func WithInitRoutesFn ¶
func WithInitRoutesFn[T *SidecarOptions | *ServiceOptions](i initRoutesFn) Option[T]
Setters
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 WithProfilingEnabled ¶
func WithProfilingEnabled(p bool) Option[*ServiceOptions]
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 { Listener service.HTTPListener // contains filtered or unexported fields }
func NewSidecar ¶
func NewSidecar(opts ...Option[*SidecarOptions]) (*Service, error)
func (*Service) HelthCheckClient ¶
func (s *Service) HelthCheckClient(c service.HTTPClientBuilder) *HealthCheckClient
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.