Documentation ¶
Index ¶
- Constants
- type Endpoint
- type EndpointType
- type Endpoints
- func (e *Endpoints) Add(endpoints map[string]Endpoint) error
- func (e *Endpoints) Down(types ...EndpointType) error
- func (e *Endpoints) DownByName(name string) error
- func (e *Endpoints) Get(name string) Endpoint
- func (e *Endpoints) List(types ...EndpointType) map[string]Endpoint
- func (e *Endpoints) Up() error
- func (e *Endpoints) UpdateTLSByName(name string, cert *shared.CertInfo)
- type Network
- type Socket
Constants ¶
const ( // EndpointControl represents the control endpoint accessible via unix socket. EndpointControl = iota // EndpointNetwork represents the user endpoint accessible over https (on a different port to the user endpoint). EndpointNetwork )
const ( // EndpointsUnix represents the name of the Unix endpoints. EndpointsUnix string = "unix" // EndpointsCore represents the name of the core API endpoints. EndpointsCore string = "core" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint interface { Listen() error Serve() Close() error Type() EndpointType }
Endpoint represents the common methods of an Endpoint.
type EndpointType ¶
type EndpointType int
EndpointType enumerates the supported endpoints.
func (EndpointType) String ¶
func (et EndpointType) String() string
String labels EndpointTypes for logging purposes.
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints represents all listeners and servers for the microcluster daemon REST API.
func NewEndpoints ¶
NewEndpoints aggregates the given endpoints so we can manage them from one source.
func (*Endpoints) Add ¶
Add calls Serve on the additional set of listeners, and adds them to Endpoints.
func (*Endpoints) Down ¶
func (e *Endpoints) Down(types ...EndpointType) error
Down closes all of the configured listeners, or any for the type specifically supplied.
func (*Endpoints) DownByName ¶
DownByName closes the configured listeners based on its name.
func (*Endpoints) List ¶
func (e *Endpoints) List(types ...EndpointType) map[string]Endpoint
List returns a list of already added endpoints.
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network represents an HTTPS listener and its server.
func NewNetwork ¶
func NewNetwork(ctx context.Context, endpointType EndpointType, server *http.Server, address api.URL, cert *shared.CertInfo) *Network
NewNetwork assigns an address, certificate, and server to the Network.