restapi

package
v0.0.0-...-10c539f Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RESTError

type RESTError struct {
	Message     string `json:"message"`
	Description string `json:"description,omitempty"`
	Details     string `json:"details"`
}

RESTError is the standard structure for rest api errors

type RESTServer

type RESTServer struct {
	// contains filtered or unexported fields
}

func NewRestServer

func NewRestServer(errChan chan error, l golog.Logger, config config.Store) *RESTServer

func (*RESTServer) Router

func (rs *RESTServer) Router() *httprouter.Router

func (*RESTServer) SaveFiles

func (rs *RESTServer) SaveFiles(r *http.Request, ps httprouter.Params) *RouteReply

func (*RESTServer) Status

func (rs *RESTServer) Status(r *http.Request, ps httprouter.Params) *RouteReply

func (*RESTServer) Stop

func (rs *RESTServer) Stop() error

type RouteHandler

type RouteHandler func(*http.Request, httprouter.Params) *RouteReply

type RouteReply

type RouteReply struct {
	Code  int
	Error *RESTError
	Data  interface{}
}

Jump to

Keyboard shortcuts

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