Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string `koanf:"host" default:"localhost"`
Port uint16 `koanf:"port" default:"5000"`
}
Config contains the configuration for creating a Server instance.
type Handler ¶
type Handler interface {
Register(*http.ServeMux, []connect.HandlerOption)
}
Handler implementations can register themselves to be hosted by the server.
type Recoverer ¶
type Recoverer struct {
// contains filtered or unexported fields
}
Recoverer handles the recovery from panics and should be used with connect.WithRecover.
When a panic occurs, the following are performed:
- A log record is produced containing the panic value and stacktrace. - If available, the current span's status is set to error and the panic value is recorded as an event. - The "rpc.server.panics" counter metric is incremented. This metric includes the "rpc.service" and "rpc.method" attributes.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides a HTTP/2 server for one or more HTTP handlers.
func NewFromConfig ¶
func NewFromConfig(config Config, handlers []Handler, opts []connect.HandlerOption) *Server
New creates a new Server instance from the given configuration.