Documentation ¶
Index ¶
- func GenSignedCert() (keyPem []byte, certPem []byte, err error)
- func InitProxy(httpAuth ProxyHTTPAuth)
- func LoadOrGenCA() error
- func LoadOrGenSignedMasterCert() error
- func MasterCACert() ([]byte, error)
- func MasterKeyAndCert() (keyPem []byte, certPem []byte, err error)
- func VerifyMasterSigned(state tls.ConnectionState) error
- type Proxy
- func (p *Proxy) ClearProxy()
- func (p *Proxy) GetService(serviceID string) *Service
- func (p *Proxy) NewProxyHandler(serviceID string) echo.HandlerFunc
- func (p *Proxy) Register(serviceID string, url *url.URL, proxyTCP bool, unauth bool)
- func (p *Proxy) Summaries() map[string]Service
- func (p *Proxy) Summary(id string) (Service, bool)
- func (p *Proxy) Unregister(serviceID string)
- type ProxyHTTPAuth
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenSignedCert ¶
GenSignedCert generates a key and cert pair, signed by the master CA cert.
func LoadOrGenCA ¶
func LoadOrGenCA() error
LoadOrGenCA generates a new CA cert and key if they do not exist in DB or are expired.
func LoadOrGenSignedMasterCert ¶
func LoadOrGenSignedMasterCert() error
LoadOrGenSignedMasterCert generates a new master cert and key if they do not exist in DB or are expired.
func MasterKeyAndCert ¶
MasterKeyAndCert returns the key and cert, signed by CA, that Master uses.
func VerifyMasterSigned ¶
func VerifyMasterSigned(state tls.ConnectionState) error
VerifyMasterSigned checks the offered certificate to ensure that it was signed by the master CA.
Types ¶
type Proxy ¶
type Proxy struct { HTTPAuth ProxyHTTPAuth // contains filtered or unexported fields }
Proxy is an actor that proxies requests to registered services.
var DefaultProxy *Proxy
DefaultProxy is the global proxy singleton.
func (*Proxy) ClearProxy ¶
func (p *Proxy) ClearProxy()
ClearProxy erases all services from the proxy in case any handlers are still active.
func (*Proxy) GetService ¶
GetService returns the Service, if any, given the serviceID key.
func (*Proxy) NewProxyHandler ¶
NewProxyHandler returns a middleware function for proxying HTTP-like traffic to services running in the cluster. Services an HTTP request through the /proxy/:service/* route.
func (*Proxy) Register ¶
Register registers the service name with the associated target URL. All requests with the format ".../:service-name/*" are forwarded to the service via the target URL.
func (*Proxy) Unregister ¶
Unregister removes the service from the proxy. All future requests until the service name is registered again will be responded with a 404 response. If the service is not registered with the proxy, the message is ignored.
type ProxyHTTPAuth ¶
ProxyHTTPAuth processes a proxy request, returning true if the request should terminate immediately and an error if one was encountered during authentication.