v4

package
v4.0.0-...-b90d246 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2015 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIHandler

func NewAPIHandler(pool *charmstore.Pool, config charmstore.ServerParams) http.Handler

NewAPIHandler returns a new Handler as an http Handler. It is defined for the convenience of callers that require a charmstore.NewAPIHandlerFunc.

func ResolveURL

func ResolveURL(store *charmstore.Store, url *charm.Reference) (*router.ResolvedURL, error)

ResolveURL resolves the series and revision of the given URL if either is unspecified by filling them out with information retrieved from the store.

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 {
	*router.Router
	// contains filtered or unexported fields
}

func New

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

New returns a new instance of the v4 API handler.

func (*Handler) AuthorizeEntity

func (h *Handler) AuthorizeEntity(id *router.ResolvedURL, req *http.Request) error

AuthorizeEntity checks that the given HTTP request can access the entity with the given id.

func (*Handler) ServeHTTP

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

type PublishedResponse

type PublishedResponse struct {
	Id        *charm.Reference
	Published time.Time
}

Jump to

Keyboard shortcuts

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