Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ShutdownDelay is the time to wait for all request, go-routines etc complete ShutdownDelay = 10 // seconds )
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶
ErrorResponse reports the error and responds with an ErrorObject
Types ¶
type Server ¶
type Server interface {
StartBlocking()
Stop()
}
Server is an interface for the HTTP server
func New ¶
func New(router RouterFunc, shutdown ShutdownFunc, errorHandler echo.HTTPErrorHandler) Server
New returns a new HTTP server
type ShutdownFunc ¶
ShutdownFunc is called before the server stops
type StatusObject ¶
type StatusObject struct {
Status int `json:"status" binding:"required"`
Message string `json:"message" binding:"required"`
RootError error `json:"-"`
}
StatusObject is used to report operation status and errors in an API request. The struct can be used as a response object or be treated as an error object
func NewErrorStatus ¶
func NewErrorStatus(s int, e error) StatusObject
NewErrorStatus initializes a new StatusObject from an error
func NewStatus ¶
func NewStatus(s int, m string) StatusObject
NewStatus initializes a new StatusObject
func (*StatusObject) Error ¶
func (so *StatusObject) Error() string
Click to show internal directories.
Click to hide internal directories.