Documentation ¶
Index ¶
- type Endpoint
- type EndpointDecorator
- type EndpointDecoratorType
- type Option
- func AfterStart(fn func() error) Option
- func AfterStop(fn func() error) Option
- func BeforeStart(fn func() error) Option
- func BeforeStop(fn func() error) Option
- func Context(ctx context.Context) Option
- func Port(p int) Option
- func TLS(certFile string, keyFile string) Option
- func Tracing(s sdktrace.Sampler, e sdktrace.SpanExporter) Option
- type Options
- type Service
- func (s *Service) Endpoints(endpoints ...Endpoint) error
- func (s *Service) Init(opts ...Option) error
- func (s *Service) Name() string
- func (s *Service) Options() Options
- func (s *Service) Server() *server.HttpServer
- func (s *Service) Start(runInBackground bool) error
- func (s *Service) Stop() error
- func (s *Service) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct { Name string Method string URI string HandlerFunc http.HandlerFunc Decorators []EndpointDecorator }
type EndpointDecorator ¶
type EndpointDecorator struct { Type EndpointDecoratorType DecoratorFunc func(w http.ResponseWriter, r *http.Request) }
func AfterDecorator ¶
func AfterDecorator(df func(w http.ResponseWriter, r *http.Request)) EndpointDecorator
func BeforeDecorator ¶
func BeforeDecorator(df func(w http.ResponseWriter, r *http.Request)) EndpointDecorator
type EndpointDecoratorType ¶
type EndpointDecoratorType uint8
const ( Before EndpointDecoratorType = iota After )
Click to show internal directories.
Click to hide internal directories.