Documentation ¶
Index ¶
- Constants
- Variables
- func GetRouter() *mux.Router
- func InitAPI(r *mux.Router, serv *HttpServ)
- func InitEndpoints(r *mux.Router, serv *HttpServ)
- func InitHttpInvocationServer(r *mux.Router, serv *HttpServ)
- type HttpServ
- func (h *HttpServ) AddMW(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) DeleteMW(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) Execute(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) ExtractBundleFromPost(r *http.Request) (string, error)
- func (h *HttpServ) FetchAllActiveMW(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) FetchBundleFile(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) FetchMW(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) HandleError(err error, w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) HandleOK(payload interface{}, w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) HealthHandler(w http.ResponseWriter, r *http.Request)
- func (h *HttpServ) Listen(m *mux.Router, l net.Listener) error
- func (h *HttpServ) UpdateMW(w http.ResponseWriter, r *http.Request)
Constants ¶
const UploadFormField = "uploadfile"
UploadFormField is the name of the field/multi-part section which contains the file bytes.
Variables ¶
var ( ErrGenericMimeDetected = errors.New("the generic '" + mimeGeneric + "' MIME type was detected which is unsupported") ErrUploadNotZip = errors.New("uploaded file was not of '" + mimeZIP + "' MIME type") )
Functions ¶
func InitEndpoints ¶
Types ¶
type HttpServ ¶
type HttpServ struct {
// contains filtered or unexported fields
}
func (*HttpServ) AddMW ¶
func (h *HttpServ) AddMW(w http.ResponseWriter, r *http.Request)
swagger:route POST /api/mw mw mwAdd Adds a new middleware. If `store_only` field is 'true' then it will only be available for download. Expects a zipped file bundle in the `uploadfile` form field.
Security:
api_key:
Responses:
200: mwIDResponse 500: genericErrorResponse
func (*HttpServ) DeleteMW ¶
func (h *HttpServ) DeleteMW(w http.ResponseWriter, r *http.Request)
swagger:route DELETE /api/mw/{id} mw mwDelete Deletes a middleware specified by {id}.
Security:
api_key:
Responses:
200: mwIDResponse 500: genericErrorResponse
func (*HttpServ) Execute ¶
func (h *HttpServ) Execute(w http.ResponseWriter, r *http.Request)
swagger:route POST /execute/{name} invocation invoke Invokes a middleware by {name}. Expects a coprocess.Object encoded as JSON in the request body and returns the result in the same way.
Security:
api_key:
Responses:
200: invocationResponse 500: genericErrorResponse
func (*HttpServ) ExtractBundleFromPost ¶
func (*HttpServ) FetchAllActiveMW ¶
func (h *HttpServ) FetchAllActiveMW(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/mw/master/all mw mwListAll Lists all middleware.
Security:
api_key:
Responses:
200: mwListResponse 500: genericErrorResponse
func (*HttpServ) FetchBundleFile ¶
func (h *HttpServ) FetchBundleFile(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/mw/bundle/{id} mw mwFetchBundle Fetches a middleware bundle file specified by {id}.
Produces: - application/octet-stream
Security:
api_key:
Responses:
200: mwBundleResponse 500: genericErrorResponse
func (*HttpServ) FetchMW ¶
func (h *HttpServ) FetchMW(w http.ResponseWriter, r *http.Request)
swagger:route GET /api/mw/{id} mw mwFetch Fetches a middleware specified by {id}.
Security:
api_key:
Responses:
200: mwResponse 500: genericErrorResponse
func (*HttpServ) HandleError ¶
func (*HttpServ) HandleOK ¶
func (h *HttpServ) HandleOK(payload interface{}, w http.ResponseWriter, r *http.Request)
func (*HttpServ) HealthHandler ¶
func (h *HttpServ) HealthHandler(w http.ResponseWriter, r *http.Request)
swagger:route GET /health system health Query health status of Mserv service.
Responses:
200: healthResponse 500: healthResponse
func (*HttpServ) UpdateMW ¶
func (h *HttpServ) UpdateMW(w http.ResponseWriter, r *http.Request)
swagger:route PUT /api/mw/{id} mw mwUpdate Updates a middleware specified by {id}. Expects a file bundle in `uploadfile` form field.
Security:
api_key:
Responses:
200: mwIDResponse 500: genericErrorResponse