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 LegacyHTTPHandler.
type LegacyHTTPHandler ¶
type LegacyHTTPHandler struct {
LegacyHTTPHandlerDeps
}
LegacyHTTPHandler 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 NewLegacyHTTPHandler ¶
func NewLegacyHTTPHandler(deps LegacyHTTPHandlerDeps) *LegacyHTTPHandler
NewLegacyHTTPHandler creates a new http.Handler for the resources endpoint.
func (*LegacyHTTPHandler) ServeHTTP ¶
func (h *LegacyHTTPHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler.
type LegacyHTTPHandlerDeps ¶
type LegacyHTTPHandlerDeps interface { ExtraDeps // contains filtered or unexported methods }
LegacyHTTPHandlerDeps exposes the external dependencies of LegacyHTTPHandler.
func NewLegacyHTTPHandlerDeps ¶
func NewLegacyHTTPHandlerDeps(extraDeps ExtraDeps) LegacyHTTPHandlerDeps
NewLegacyHTTPHandlerDeps returns an implementation of LegacyHTTPHandlerDeps.
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.