Documentation ¶
Index ¶
- func GetInstanceIDForService(ctx types.Context, service types.StorageService) *types.InstanceID
- func GetLocalDevicesForService(ctx types.Context, service types.StorageService) map[string]string
- func GetService(ctx types.Context) (types.StorageService, error)
- func GetStorageDriver(ctx types.Context) (types.StorageDriver, error)
- func NewDeleteRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewGetRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewHeadRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewOptionsRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewPostRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewPutRoute(name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
- func NewRoute(name, method, path string, handler types.APIFunc, ...) types.Route
- func WithServiceContext(ctx types.Context, service types.StorageService) (types.Context, error)
- func WriteData(w http.ResponseWriter, code int, v []byte) error
- func WriteJSON(w http.ResponseWriter, code int, v interface{}) error
- func WriteResponse(w http.ResponseWriter, rec *httptest.ResponseRecorder)
- func WriteTask(ctx types.Context, w http.ResponseWriter, store types.Store, task *types.Task, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInstanceIDForService ¶
func GetInstanceIDForService( ctx types.Context, service types.StorageService) *types.InstanceID
GetInstanceIDForService gets the instance ID for a service using the context's instance IDs map.
func GetLocalDevicesForService ¶
GetLocalDevicesForService gets the local devices for a service using the context's local devices map.
func GetService ¶
func GetService(ctx types.Context) (types.StorageService, error)
GetService gets the Service instance from a types.
func GetStorageDriver ¶
func GetStorageDriver(ctx types.Context) (types.StorageDriver, error)
GetStorageDriver gets the RemoteStorageDriver instance from a types.
func NewDeleteRoute ¶
func NewDeleteRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewDeleteRoute initializes a new route with the http method DELETE.
func NewGetRoute ¶
func NewGetRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewGetRoute initializes a new route with the http method GET.
func NewHeadRoute ¶
func NewHeadRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewHeadRoute initializes a new route with the http method HEAD.
func NewOptionsRoute ¶
func NewOptionsRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewOptionsRoute initializes a new route with the http method OPTIONS
func NewPostRoute ¶
func NewPostRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewPostRoute initializes a new route with the http method POST.
func NewPutRoute ¶
func NewPutRoute( name, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewPutRoute initializes a new route with the http method PUT.
func NewRoute ¶
func NewRoute( name, method, path string, handler types.APIFunc, middlewares ...types.Middleware) types.Route
NewRoute initialies a new local route for the reouter
func WithServiceContext ¶
WithServiceContext gets the service types.
func WriteData ¶
func WriteData(w http.ResponseWriter, code int, v []byte) error
WriteData writes the value v to the http response stream as binary.
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, code int, v interface{}) error
WriteJSON writes the value v to the http response stream as json with standard json encoding.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, rec *httptest.ResponseRecorder)
WriteResponse writes a recorded response to a ResponseWriter.
Types ¶
This section is empty.