Documentation ¶
Index ¶
- func Env(env string) func(o *Opts)
- func Name(name string) func(o *Opts)
- func WithPprof() func(o *DebugOpts)
- func WithPrometheusHandler(handler http.Handler) func(o *DebugOpts)
- func WithStatusAddr(addr string) func(o *DebugOpts)
- type DebugOpt
- type DebugOpts
- type Listener
- type Opt
- type Opts
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPrometheusHandler ¶
WithPrometheusHandler is adding this prometheus http handler as an option.
func WithStatusAddr ¶
WithStatusAddr is adding this status addr as an option.
Types ¶
type Listener ¶
type Listener interface { // Start is being called on the listener Start(ctx context.Context, ready func()) func() error }
Listener is the interface to a listener, so starting and shutdown of a listener, or any routine.
type Opts ¶
type Opts struct { // Name Name string // Env Env string // ReloadSignal ReloadSignal syscall.Signal // TermSignal TermSignal syscall.Signal // KillSignal KillSignal syscall.Signal }
Opts ...
type Server ¶
type Server interface { // Run is running a new routine Listen(listener Listener, ready bool) // Name Name() string // Env Env() string // Waits for the server to fail, // or gracefully shutdown if called Wait() error }
Server is the interface to be implemented to run the server.
s, ctx := WithContext(context.Background()) s.Listen(listener, false) if err := s.Wait(); err != nil { panic(err) }
Click to show internal directories.
Click to hide internal directories.