Documentation ¶
Index ¶
- Constants
- type Endpoints
- func (e *Endpoints) Down() error
- func (e *Endpoints) NetworkAddress() string
- func (e *Endpoints) NetworkCert() *cert.Info
- func (e *Endpoints) NetworkPrivateKey() []byte
- func (e *Endpoints) NetworkPublicKey() []byte
- func (e *Endpoints) NetworkUpdateAddress(address string) error
- func (e *Endpoints) NetworkUpdateCert(cert *cert.Info) error
- func (e *Endpoints) PprofAddress() string
- func (e *Endpoints) PprofUpdateAddress(address string) error
- func (e *Endpoints) Up() error
- type Option
- type Server
Constants ¶
const DefaultPort = "8080"
DefaultPort defines the default port for the http server
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints are in charge of bringing up and down the HTTP endpoints for serving the RESTful API.
When it starts up, they start listen to the appropriate sockets and attach the relevant HTTP handlers to them. When it shuts down they close all sockets.
func (*Endpoints) NetworkAddress ¶
NetworkAddress returns the network addresses of the network endpoint, or an empty string if there's no network endpoint
func (*Endpoints) NetworkCert ¶
NetworkCert returns the full TLS certificate information for this endpoint.
func (*Endpoints) NetworkPrivateKey ¶
NetworkPrivateKey returns the private key of the TLS certificate used by the network endpoint.
func (*Endpoints) NetworkPublicKey ¶
NetworkPublicKey returns the public key of the TLS certificate used by the network endpoint.
func (*Endpoints) NetworkUpdateAddress ¶
NetworkUpdateAddress updates the address for the network endpoint, shutting it down and restarting it.
func (*Endpoints) NetworkUpdateCert ¶
NetworkUpdateCert updates the TLS keypair and CA used by the network endpoint.
If the network endpoint is active, in-flight requests will continue using the old certificate, and only new requests will use the new one.
func (*Endpoints) PprofAddress ¶
PprofAddress returns the network addresss of the pprof endpoint, or an empty string if there's no pprof endpoint
func (*Endpoints) PprofUpdateAddress ¶
PprofUpdateAddress updates the address for the pprof endpoint, shutting it down and restarting it.
type Option ¶
type Option func(*options)
Option to be passed to Connect to customize the resulting instance.
func WithDebugAddress ¶
WithDebugAddress sets the debugAddress on the option
func WithLogger ¶
WithLogger sets the logger on the option
func WithNetworkAddress ¶
WithNetworkAddress sets the networkAddress on the option
func WithRestServer ¶
WithRestServer sets the restServer on the option
func WithSleeper ¶
WithSleeper sets the sleeper on the options