Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server interface {
// ListenAndServe runs the HTTP/S server until the provided context is
// canceled. This function always returns a non-nil error.
ListenAndServe(ctx context.Context) error
}
Server is an interface for an HTTP/S server. This is an improvement over the HTTP/S server built into Go's http package, as it exposes simple configuration options and a context-sensitive ListenAndServe function.
type ServerConfig ¶
type ServerConfig struct {
// Port specifies the port the server should bind to / listen on.
Port int
// TLSEnabled specifies whether the server should serve HTTP (false) or HTTPS
// (true).
TLSEnabled bool
// TLSCertPath is the path to a PEM-encoded x509 certificate that can be used
// for serving HTTPS.
TLSCertPath string
// TLSKeyPath is the path to a PEM-encoded x509 private key that can be used
// for serving HTTPS.
TLSKeyPath string
}
ServerConfig represents optional configuration for an HTTP/S server.
Click to show internal directories.
Click to hide internal directories.