Documentation
¶
Index ¶
- type Opts
- type Server
- func (s *Server) GetHealthServer() *health.GRPCServer
- func (s *Server) GracefulStop() error
- func (s *Server) RegisterRoute(pattern string, handler func(http.ResponseWriter, *http.Request)) error
- func (s *Server) Serve(ctx context.Context) error
- func (s *Server) Stop() error
- func (s *Server) WithLogger(logger *slog.Logger) *Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts struct {
Health *health.GRPCOpts `group:"Health" namespace:"health" env-namespace:"HEALTH"`
Port int `long:"port" env:"PORT" description:"Port to serve HTTP on" default:"8080"`
ReadTimeout time.Duration `long:"read-timeout" env:"READ_TIMEOUT" description:"HTTP read timeout" default:"30s"`
WriteTimeout time.Duration `long:"write-timeout" env:"WRITE_TIMEOUT" description:"HTTP write timeout" default:"30s"`
IdleTimeout time.Duration `long:"idle-timeout" env:"IDLE_TIMEOUT" description:"HTTP idle timeout" default:"120s"`
GracefulStopTimeout int `` /* 127-byte string literal not displayed */
}
Opts holds HTTP server options.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the HTTP server state.
func (*Server) GetHealthServer ¶
func (s *Server) GetHealthServer() *health.GRPCServer
func (*Server) GracefulStop ¶
GracefulStop gracefully stops the gateway server.
func (*Server) RegisterRoute ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mockserver provides an HTTP server that stands in for a third party in tests.
|
Package mockserver provides an HTTP server that stands in for a third party in tests. |
Click to show internal directories.
Click to hide internal directories.