Documentation ¶
Index ¶
- func NewCabby(ds cabby.DataStore, c cabby.Config) *http.Server
- func RouteRequest(h RequestHandler) http.HandlerFunc
- func WithMimeType(h http.HandlerFunc, mh, mv string) http.HandlerFunc
- type APIRootHandler
- type CollectionHandler
- type CollectionsHandler
- type DiscoveryHandler
- type ManifestHandler
- type ObjectsHandler
- type RequestHandler
- type StatusHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RouteRequest ¶
func RouteRequest(h RequestHandler) http.HandlerFunc
RouteRequest takes a RequestHandler and routes requests to its methods
func WithMimeType ¶
func WithMimeType(h http.HandlerFunc, mh, mv string) http.HandlerFunc
WithMimeType decorates a handle with content type check
Types ¶
type APIRootHandler ¶
type APIRootHandler struct {
APIRootService cabby.APIRootService
}
APIRootHandler holds a cabby APIRootService
func (APIRootHandler) Get ¶
func (h APIRootHandler) Get(w http.ResponseWriter, r *http.Request)
Get handles a get request
func (APIRootHandler) Post ¶
func (h APIRootHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request
type CollectionHandler ¶
type CollectionHandler struct {
CollectionService cabby.CollectionService
}
CollectionHandler handles Collection requestion
func (CollectionHandler) Get ¶
func (h CollectionHandler) Get(w http.ResponseWriter, r *http.Request)
Get handles a get request
func (CollectionHandler) Post ¶
func (h CollectionHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request
type CollectionsHandler ¶
type CollectionsHandler struct {
CollectionService cabby.CollectionService
}
CollectionsHandler handles Collections requests
func (CollectionsHandler) Get ¶
func (h CollectionsHandler) Get(w http.ResponseWriter, r *http.Request)
Get handles a get request
func (CollectionsHandler) Post ¶
func (h CollectionsHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request
type DiscoveryHandler ¶
type DiscoveryHandler struct { DiscoveryService cabby.DiscoveryService Port int }
DiscoveryHandler holds a cabby DiscoveryService
func (DiscoveryHandler) Get ¶
func (h DiscoveryHandler) Get(w http.ResponseWriter, r *http.Request)
Get serves a discovery resource
func (DiscoveryHandler) Post ¶
func (h DiscoveryHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request
type ManifestHandler ¶
type ManifestHandler struct {
ManifestService cabby.ManifestService
}
ManifestHandler holds a cabby ManifestService
func (ManifestHandler) Get ¶
func (h ManifestHandler) Get(w http.ResponseWriter, r *http.Request)
Get serves a manifest resource
func (ManifestHandler) Post ¶
func (h ManifestHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request
type ObjectsHandler ¶
type ObjectsHandler struct { ObjectService cabby.ObjectService StatusService cabby.StatusService MaxContentLength int64 }
ObjectsHandler handles Objects requests
func (ObjectsHandler) Get ¶
func (h ObjectsHandler) Get(w http.ResponseWriter, r *http.Request)
Get handles a get request
func (ObjectsHandler) Post ¶
func (h ObjectsHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request
type RequestHandler ¶
type RequestHandler interface { Get(w http.ResponseWriter, r *http.Request) Post(w http.ResponseWriter, r *http.Request) }
RequestHandler interface for handling requests
type StatusHandler ¶
type StatusHandler struct {
StatusService cabby.StatusService
}
StatusHandler holds a cabby StatusService
func (StatusHandler) Get ¶
func (h StatusHandler) Get(w http.ResponseWriter, r *http.Request)
Get serves a status resource
func (StatusHandler) Post ¶
func (h StatusHandler) Post(w http.ResponseWriter, r *http.Request)
Post handles post request