Documentation ¶
Index ¶
- Constants
- Variables
- func About(c echo.Context) error
- func CheckDetails(c echo.Context) error
- func CheckSummary(c echo.Context) error
- func DetailsHandler(c echo.Context) error
- func ErrorCode(err error) string
- func ErrorDebugInfo(err error) string
- func ErrorMessage(err error) string
- func ErrorStatusCode(code string) int
- func HealthSummary(c echo.Context) error
- func PostDataToServer(server string, body io.Reader) (err error)
- func PushHandler(c echo.Context) error
- func RunCanaryHandler(c echo.Context) error
- func RunTopologyHandler(c echo.Context) error
- func Topology(c echo.Context) error
- func WebhookHandler(c echo.Context) error
- func WriteError(c echo.Context, err error) error
- type CheckData
- type CheckErrorMessage
- type DetailResponse
- type Error
- type HTTPError
- type HTTPSuccess
- type QueueData
- type Response
- type RunCanaryResponse
Constants ¶
const ( ECONFLICT = "conflict" EFORBIDDEN = "forbidden" EINTERNAL = "internal" EINVALID = "invalid" ENOTFOUND = "not_found" ENOTIMPLEMENTED = "not_implemented" EUNAUTHORIZED = "unauthorized" )
Application error codes.
These are meant to be generic and they map well to HTTP error codes.
Variables ¶
var (
DefaultWindow = "1h"
)
Functions ¶
func CheckDetails ¶ added in v0.38.70
func CheckDetails(c echo.Context) error
func CheckSummary ¶ added in v0.38.70
func CheckSummary(c echo.Context) error
func DetailsHandler ¶ added in v0.38.96
func DetailsHandler(c echo.Context) error
func ErrorCode ¶ added in v1.0.85
ErrorCode unwraps an application error and returns its code. Non-application errors always return EINTERNAL.
func ErrorDebugInfo ¶ added in v1.0.85
ErrorDebugInfo unwraps an application error and returns its debug message.
func ErrorMessage ¶ added in v1.0.85
ErrorMessage unwraps an application error and returns its message. Non-application errors always return "Internal error".
func ErrorStatusCode ¶ added in v1.0.85
ErrorStatusCode returns the associated HTTP status code for an application error code.
func HealthSummary ¶ added in v0.38.232
func HealthSummary(c echo.Context) error
func PostDataToServer ¶ added in v0.38.85
func PushHandler ¶ added in v0.38.85
func PushHandler(c echo.Context) error
func RunCanaryHandler ¶ added in v0.38.257
func RunCanaryHandler(c echo.Context) error
func RunTopologyHandler ¶ added in v0.38.257
func RunTopologyHandler(c echo.Context) error
func Topology ¶ added in v0.38.85
func Topology(c echo.Context) error
TopologyQuery godoc @Id TopologyQuery @Summary Topology query @Description Query the topology graph @Tags topology @Produce json @Param id query string false "Topology ID" @Param topologyId query string false "Topology ID" @Param componentId query string false "Component ID" @Param owner query string false "Owner" @Param status query string false "Comma separated list of status" @Param types query string false "Comma separated list of types" @Param flatten query string false "Flatten the topology" @Success 200 {object} pkg.Components @Router /api/topology [get]
func WebhookHandler ¶ added in v1.0.85
func WebhookHandler(c echo.Context) error
func WriteError ¶ added in v1.0.85
WriteError writes the error to the HTTP response with appropriate status code
Types ¶
type CheckErrorMessage ¶ added in v0.38.257
type DetailResponse ¶ added in v0.38.70
type Error ¶ added in v1.0.85
type Error struct { // Machine-readable error code. Code string // Human-readable error message. Message string // DebugInfo contains low-level internal error details that should only be logged. // End-users should never see this. DebugInfo string }
Error represents an application-specific error.
func Errorf ¶ added in v1.0.85
Errorf is a helper function to return an Error with a given code and formatted message.
type HTTPSuccess ¶ added in v1.0.85
type QueueData ¶ added in v0.38.85
type QueueData struct { Check pkg.Check `json:",inline"` Status pkg.CheckStatus `json:",inline"` }
type RunCanaryResponse ¶ added in v0.38.257
type RunCanaryResponse struct { Total int `json:"total"` Failed int `json:"failed"` Success int `json:"success"` Errors []CheckErrorMessage `json:"errors,omitempty"` }
RunCanaryResponse represents the response body for a run now request
func (*RunCanaryResponse) FromCheckResults ¶ added in v0.38.257
func (t *RunCanaryResponse) FromCheckResults(result []*pkg.CheckResult)