Documentation ¶
Overview ¶
The httprelation package can be used in a charm that uses a relation with interface type "http".
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrHTTPSNotConfigured = errgo.New("HTTPS not configured")
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider represents the provider of an http relation.
func (*Provider) HTTPPort ¶
HTTPPort returns the configured port of the HTTP server. If the port has not been set, it returns 0.
func (*Provider) HTTPSPort ¶
HTTPPort returns the configured port of the HTTP server. If the port has not been set, it returns 0.
func (*Provider) Register ¶
Register registers everything necessary on r for running the provider side of an http relation with the given relation name.
It takes care of opening and closing the configured port, but does not actually start the HTTP handler server. If changed is not nil, it notifies that the port has changed by calling changed.HTTPServerPortChanged.
The port of the server is configured with the "server-port" charm configuration option.
func (*Provider) TLSCertPEM ¶
TLSCertPEM returns the currently configured server certificate in PEM format. It returns ErrHTTPSNotConfigured if there is no currently configured certificate.