rest

package
v0.0.0-...-9a46343 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrServerInternal = 0 // server internal error
	ErrJSONDecode     = 1 // failed unmarshalling incoming request
)

Variables

This section is empty.

Functions

func SendErrorJSON

func SendErrorJSON(w http.ResponseWriter, r *http.Request, httpStatusCode int, err error, errCode int, details string)

SendErrorJSON create response JSON in schema {error: err, details: more details, code: 1} json body and responds with error code

Types

type Rest

type Rest struct {
	DataService restInterface
	Version     string
	URI         string
	ReportPath  string
	// contains filtered or unexported fields
}

func (*Rest) Run

func (r *Rest) Run(port int)

Run http server

func (*Rest) Shutdown

func (r *Rest) Shutdown()

Shutdown http server

Jump to

Keyboard shortcuts

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