v4

package
v0.0.0-...-f67de66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2016 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PromulgatorsGroup         = v5.PromulgatorsGroup
	UsernameAttr              = v5.UsernameAttr
	DelegatableMacaroonExpiry = v5.DelegatableMacaroonExpiry
	DefaultIcon               = v5.DefaultIcon
	ArchiveCachePublicMaxAge  = v5.ArchiveCachePublicMaxAge
)

Variables

This section is empty.

Functions

func NewAPIHandler

func NewAPIHandler(pool *charmstore.Pool, config charmstore.ServerParams, rootPath string) charmstore.HTTPCloseHandler

func StatsEnabled

func StatsEnabled(req *http.Request) bool

StatsEnabled reports whether statistics should be gathered for the given HTTP request.

Types

type Handler

type Handler struct {
	*v5.Handler
}

func New

func New(pool *charmstore.Pool, config charmstore.ServerParams, rootPath string) Handler

func (*Handler) NewReqHandler

func (h *Handler) NewReqHandler() (ReqHandler, error)

NewReqHandler fetchs a new instance of ReqHandler from h.Pool and returns it. The ReqHandler must be closed when finished with.

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ReqHandler

type ReqHandler struct {
	*v5.ReqHandler
}

func (ReqHandler) Close

func (h ReqHandler) Close()

Close closes the ReqHandler. This should always be called when the ReqHandler is done with.

func (ReqHandler) ResolveURL

func (h ReqHandler) ResolveURL(url *charm.URL) (*router.ResolvedURL, error)

ResolveURL implements router.Context.ResolveURL, ensuring that any resulting ResolvedURL always has a non-empty PreferredSeries field.

func (ReqHandler) ResolveURLs

func (h ReqHandler) ResolveURLs(urls []*charm.URL) ([]*router.ResolvedURL, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL