Documentation
¶
Overview ¶
This package holds the hook context API server implementation.
Index ¶
Constants ¶
const FacadeVersion = 1
FacadeVersion is the version of the current API facade. (We start at 1 to distinguish from the default value.)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtraDeps ¶
type ExtraDeps interface {
// NewResourceOpener returns a new opener for the request.
NewResourceOpener(*http.Request) (resource.Opener, error)
}
ExtraDeps exposes the non-superficial dependencies of HTTPHandler.
type HTTPHandler ¶
type HTTPHandler struct {
HTTPHandlerDeps
}
HTTPHandler is the HTTP handler for the resources endpoint. We use it rather having a separate handler for each HTTP method since registered API handlers must handle *all* HTTP methods currently.
func NewHTTPHandler ¶
func NewHTTPHandler(deps HTTPHandlerDeps) *HTTPHandler
NewHTTPHandler creates a new http.Handler for the resources endpoint.
func (*HTTPHandler) ServeHTTP ¶
func (h *HTTPHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler.
type HTTPHandlerDeps ¶
type HTTPHandlerDeps interface {
ExtraDeps
// contains filtered or unexported methods
}
HTTPHandlerDeps exposes the external dependencies of HTTPHandler.
func NewHTTPHandlerDeps ¶
func NewHTTPHandlerDeps(extraDeps ExtraDeps) HTTPHandlerDeps
NewHTTPHandlerDeps returns an implementation of HTTPHandlerDeps.
type UnitDataStore ¶
type UnitDataStore interface {
// ListResources lists all the resources for the application.
ListResources() (resource.ServiceResources, error)
}
UnitDataStore exposes the data storage functionality needed here. All functionality is tied to the unit's application.
type UnitFacade ¶
type UnitFacade struct {
//DataStore is the data store used by the facade.
DataStore UnitDataStore
}
UnitFacade is the resources portion of the uniter's API facade.
func NewUnitFacade ¶
func NewUnitFacade(dataStore UnitDataStore) *UnitFacade
NewUnitFacade returns the resources portion of the uniter's API facade.
func (UnitFacade) GetResourceInfo ¶
func (uf UnitFacade) GetResourceInfo(args private.ListResourcesArgs) (private.ResourcesResult, error)
GetResourceInfo returns the resource info for each of the given resource names (for the implicit application). If any one is missing then the corresponding result is set with errors.NotFound.