rest

package
v0.0.0-...-0d32c9f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 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 {
	Version string
	URI     string
	// contains filtered or unexported fields
}

func (*Rest) Run

func (r *Rest) Run(ctx context.Context, 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