Versions in this module Expand all Collapse all v0 v0.26.0 Apr 9, 2022 Changes in this version + const StatusError + const StatusSuccess + var BuildInfo = &ThanosVersion + func Respond(w http.ResponseWriter, data interface{}, warnings []error) + func RespondError(w http.ResponseWriter, apiErr *ApiError, data interface{}) + func SetCORS(w http.ResponseWriter) + type ApiError struct + Err error + Typ ErrorType + func (e *ApiError) Error() string + type ApiFunc func(r *http.Request) (interface{}, []error, *ApiError) + type BaseAPI struct + Now func() time.Time + func NewBaseAPI(logger log.Logger, disableCORS bool, flagsMap map[string]string) *BaseAPI + func (api *BaseAPI) Register(r *route.Router, tracer opentracing.Tracer, logger log.Logger, ...) + type ErrorType string + const ErrorBadData + const ErrorCanceled + const ErrorExec + const ErrorInternal + const ErrorNone + const ErrorTimeout + type InstrFunc func(name string, f ApiFunc) http.HandlerFunc + func GetInstr(tracer opentracing.Tracer, logger log.Logger, ...) InstrFunc + type RuntimeInfo struct + CWD string + GODEBUG string + GOGC string + GOMAXPROCS int + GoroutineCount int + StartTime time.Time + type RuntimeInfoFn func() RuntimeInfo + func GetRuntimeInfoFunc(logger log.Logger) RuntimeInfoFn + type ThanosVersion struct + Branch string + BuildDate string + BuildUser string + GoVersion string + Revision string + Version string