Documentation
¶
Overview ¶
Package api provides API endpoints and controllers.
Index ¶
- Variables
- type API
- func (api *API) Router() *echo.Echo
- func (api *API) Run() error
- func (api *API) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (api *API) Stop() error
- func (api *API) Use(middleware ...echo.MiddlewareFunc)
- func (api *API) WriteResult(c echo.Context, v interface{}, err error) (int, interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCDCDisabled = etre.Error{ Type: "cdc-disabled", HTTPStatus: http.StatusNotImplemented, Message: "CDC disabled", }
View Source
var ErrDb = etre.Error{ Type: "db-error", HTTPStatus: http.StatusInternalServerError, Message: "unknown database error", }
View Source
var ErrDuplicateEntity = etre.Error{ Type: "duplicate-entity", HTTPStatus: http.StatusConflict, Message: "cannot insert or update entity because identifying labels conflict with another entity", }
View Source
var ErrInternal = etre.Error{ Type: "internal-error", HTTPStatus: http.StatusInternalServerError, Message: "internal server error", }
View Source
var ErrInvalidParam = etre.Error{ Type: "invalid-param", HTTPStatus: http.StatusBadRequest, Message: "missing parameter", }
View Source
var ErrInvalidQuery = etre.Error{ Type: "invalid-query", HTTPStatus: http.StatusBadRequest, Message: "invalid query", }
View Source
var ErrMissingParam = etre.Error{ Type: "missing-param", HTTPStatus: http.StatusBadRequest, Message: "missing parameter", }
View Source
var ErrNotFound = etre.Error{ Type: "entity-not-found", HTTPStatus: http.StatusNotFound, Message: "entity not found", }
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API provides controllers for endpoints it registers with a router.
func (*API) ServeHTTP ¶
func (api *API) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP allows the API to statisfy the http.HandlerFunc interface.
func (*API) Use ¶
func (api *API) Use(middleware ...echo.MiddlewareFunc)
Use adds middleware to the echo web server in the API. See https://echo.labstack.com/middleware for more details.
func (*API) WriteResult ¶
Return an etre.WriteResult for all writes, successful of not. v are the writes, if any, from entity.Store calls, which is why it can be different types. v and err are _not_ mutually exclusive; writes can be partially successful.
Click to show internal directories.
Click to hide internal directories.