{"modulePath":"github.com/codedellemc/libstorage","version":"v0.6.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httputils\n\n## Functions\n\n```go\nfunc NewDeleteRoute(\n\tname, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewDeleteRoute initializes a new route with the http method DELETE.\n\n```go\nfunc NewGetRoute(\n\tname, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewGetRoute initializes a new route with the http method GET.\n\n```go\nfunc NewHeadRoute(\n\tname, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewHeadRoute initializes a new route with the http method HEAD.\n\n```go\nfunc NewOptionsRoute(\n\tname, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewOptionsRoute initializes a new route with the http method OPTIONS\n\n```go\nfunc NewPostRoute(\n\tname, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewPostRoute initializes a new route with the http method POST.\n\n```go\nfunc NewPutRoute(\n\tname, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewPutRoute initializes a new route with the http method PUT.\n\n```go\nfunc NewRoute(\n\tname, method, path string,\n\thandler types.APIFunc,\n\tmiddlewares ...types.Middleware) types.Route\n```\nNewRoute initialies a new local route for the reouter\n\n```go\nfunc WriteData(w http.ResponseWriter, code int, v []byte) error\n```\nWriteData writes the value v to the http response stream as binary.\n\n```go\nfunc WriteJSON(w http.ResponseWriter, code int, v interface{}) error\n```\nWriteJSON writes the value v to the http response stream as json with standard json encoding.\n\n```go\nfunc WriteResponse(w http.ResponseWriter, rec *httptest.ResponseRecorder)\n```\nWriteResponse writes a recorded response to a ResponseWriter.\n\n```go\nfunc WriteTask(\n\tctx types.Context,\n\tconfig gofig.Config,\n\tw http.ResponseWriter,\n\tstore types.Store,\n\ttask *types.Task,\n\tokStatus int) error\n```\nWriteTask writes a task to a ResponseWriter.\n\n","path":"github.com/codedellemc/libstorage/api/server/httputils","name":"httputils","synopsis":"","isRedistributable":true}
