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 ¶
Functions ¶
func Respond ¶
func Respond(w http.ResponseWriter, data interface{}, warnings []error)
func RespondError ¶
func RespondError(w http.ResponseWriter, apiErr *ApiError, data interface{})
Types ¶
type BaseAPI ¶
func NewBaseAPI ¶
NewBaseAPI returns a new initialized BaseAPI type.
func (*BaseAPI) Register ¶
func (api *BaseAPI) Register(r *route.Router, tracer opentracing.Tracer, logger log.Logger, ins extpromhttp.InstrumentationMiddleware, logMiddleware *logging.HTTPServerMiddleware)
Register registers the common API endpoints.
type InstrFunc ¶
type InstrFunc func(name string, f ApiFunc) http.HandlerFunc
func GetInstr ¶
func GetInstr( tracer opentracing.Tracer, logger log.Logger, ins extpromhttp.InstrumentationMiddleware, logMiddleware *logging.HTTPServerMiddleware, disableCORS bool, ) InstrFunc
GetInstr returns a http HandlerFunc with the instrumentation middleware.
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.