Documentation ¶
Index ¶
- func AuthMiddleware(rootUsername, rootPassword string, s store.Store) echo.MiddlewareFunc
- func BadRequest(c echo.Context, msg string) error
- func Conflict(c echo.Context, msg string) error
- func Created(c echo.Context, payload interface{}) error
- func InstrumentMiddleware(stats *statsd.Client) echo.MiddlewareFunc
- func InternalServerError(c echo.Context, err error) error
- func Invalid(c echo.Context, msg string) error
- func LogMiddleware() echo.MiddlewareFunc
- func NewServer(conf ServerConfig) (*standard.Server, error)
- func NoContent(c echo.Context) error
- func NotFound(c echo.Context) error
- func OK(c echo.Context, payload interface{}) error
- func RequestID(c echo.Context) string
- func TraceMiddleware() echo.MiddlewareFunc
- type EnvironmentResource
- type Error
- type EventResource
- type FeatureResource
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(rootUsername, rootPassword string, s store.Store) echo.MiddlewareFunc
AuthMiddleware checks login credentials.
func BadRequest ¶
BadRequest generates an HTTP 400 Bad Request response with specified error message serialized as JSON.
func Conflict ¶
Conflict generates an HTTP 409 Conflict response with specified error message serialized as JSON.
func Created ¶
Created generates an HTTP 201 Created response with specified payload serialized as JSON.
func InstrumentMiddleware ¶
func InstrumentMiddleware(stats *statsd.Client) echo.MiddlewareFunc
InstrumentMiddleware collects metrics about the current request.
func InternalServerError ¶
InternalServerError generates an HTTP 500 Internal Server Error response with a generic error message serialized as JSON, while the provided error is logged with ERROR level.
func Invalid ¶
Invalid generates an HTTP 422 Unprocessable Entity response with specified error message serialized as JSON.
func LogMiddleware ¶
func LogMiddleware() echo.MiddlewareFunc
LogMiddleware logs information about the current request.
func NewServer ¶
func NewServer(conf ServerConfig) (*standard.Server, error)
NewServer creates a new server.
func NotFound ¶
NotFound generates an HTTP 404 Not Found response with a generic error message serialized as JSON.
func TraceMiddleware ¶
func TraceMiddleware() echo.MiddlewareFunc
TraceMiddleware attaches an ID to the current request.
Types ¶
type EnvironmentResource ¶
type EnvironmentResource struct {
// contains filtered or unexported fields
}
func NewEnvironmentResource ¶
func NewEnvironmentResource(store store.Store, stats *statsd.Client) *EnvironmentResource
type Error ¶
type Error struct {
Message string `json:"message"`
}
Error represents an error message response.
type EventResource ¶ added in v1.0.0
type EventResource struct {
// contains filtered or unexported fields
}
func NewEventResource ¶ added in v1.0.0
type FeatureResource ¶
type FeatureResource struct {
// contains filtered or unexported fields
}