rest

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(exec command.Exec, rw http.ResponseWriter, req io.Reader)

Execute executes given command with args provided and writes error to response writer.

func SendError

func SendError(rw http.ResponseWriter, err command.Error)

SendError sends command error as http response in generic error format.

func SendHTTPStatusError

func SendHTTPStatusError(rw http.ResponseWriter, httpStatus int, code command.Code, err error)

SendHTTPStatusError sends given http status code to response with error body.

Types

type Handler

type Handler interface {
	Path() string
	Method() string
	Handle() http.HandlerFunc
}

Handler http handler for each controller API endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL