Documentation
¶
Index ¶
- Constants
- Variables
- 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
- type ApiFunc
- type BaseAPI
- type ErrorType
- type InstrFunc
- type RuntimeInfo
- type RuntimeInfoFn
- type ThanosVersion
Constants ¶
View Source
const (
StatusSuccess status = "success"
StatusError status = "error"
)
Variables ¶
View Source
var BuildInfo = &ThanosVersion{
Version: version.Version,
Revision: version.Revision,
Branch: version.Branch,
BuildUser: version.BuildUser,
BuildDate: version.BuildDate,
GoVersion: version.GoVersion,
}
Functions ¶
func RespondError ¶
func RespondError(w http.ResponseWriter, apiErr *ApiError, data interface{})
Types ¶
type BaseAPI ¶
type BaseAPI struct {
Now func() time.Time
// contains filtered or unexported fields
}
func NewBaseAPI ¶
func NewBaseAPI(logger log.Logger, disableCORS bool, flagsMap map[string]string) *BaseAPI
NewBaseAPI returns a new initialized BaseAPI type.
type ErrorType ¶
type ErrorType string
const (
ErrorNone ErrorType = ""
ErrorTimeout ErrorType = "timeout"
ErrorCanceled ErrorType = "canceled"
ErrorExec ErrorType = "execution"
ErrorBadData ErrorType = "bad_data"
ErrorInternal ErrorType = "internal"
)
type RuntimeInfo ¶
type RuntimeInfo struct {
StartTime time.Time `json:"startTime"`
CWD string `json:"CWD"`
GoroutineCount int `json:"goroutineCount"`
GOMAXPROCS int `json:"GOMAXPROCS"`
GOGC string `json:"GOGC"`
GODEBUG string `json:"GODEBUG"`
}
RuntimeInfo contains runtime information about Thanos.
type RuntimeInfoFn ¶
type RuntimeInfoFn func() RuntimeInfo
RuntimeInfoFn returns updated runtime information about Thanos.
func GetRuntimeInfoFunc ¶
func GetRuntimeInfoFunc(logger log.Logger) RuntimeInfoFn
type ThanosVersion ¶
type ThanosVersion struct {
Version string `json:"version"`
Revision string `json:"revision"`
Branch string `json:"branch"`
BuildUser string `json:"buildUser"`
BuildDate string `json:"buildDate"`
GoVersion string `json:"goVersion"`
}
ThanosVersion contains build information about Thanos.
Click to show internal directories.
Click to hide internal directories.