gocharm: github.com/juju/gocharm/charmbits/httprelation Index | Files

package httprelation

import "github.com/juju/gocharm/charmbits/httprelation"

The httprelation package can be used in a charm that uses a relation with interface type "http".

Index

Package Files

provider.go requirer.go

Variables

var ErrHTTPSNotConfigured = errgo.New("HTTPS not configured")

type Provider Uses

type Provider struct {
    // contains filtered or unexported fields
}

Provider represents the provider of an http relation.

func (*Provider) HTTPPort Uses

func (p *Provider) HTTPPort() int

HTTPPort returns the configured port of the HTTP server. If the port has not been set, it returns 0.

func (*Provider) HTTPSPort Uses

func (p *Provider) HTTPSPort() int

HTTPPort returns the configured port of the HTTP server. If the port has not been set, it returns 0.

func (*Provider) Register Uses

func (p *Provider) Register(r *hook.Registry, relationName string, allowHTTPS bool)

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 Uses

func (p *Provider) TLSCertPEM() (string, error)

TLSCertPEM returns the currently configured server certificate in PEM format. It returns ErrHTTPSNotConfigured if there is no currently configured certificate.

type Requirer Uses

type Requirer struct {
    // contains filtered or unexported fields
}

Requirer represents the requirer of an http relation.

func (*Requirer) Register Uses

func (req *Requirer) Register(r *hook.Registry, relationName string)

Register registers everything necessary on r for running the provider side of an http relation with the given relation name.

func (*Requirer) URLs Uses

func (req *Requirer) URLs() []string

URLs returns the URLs of all the provider units.

Package httprelation imports 7 packages (graph) and is imported by 2 packages. Updated 2016-07-28. Refresh now. Tools for package owners.