Documentation
¶
Index ¶
- Constants
- func NewUI(cfg UIConfig) (http.Handler, error)
- func PercentBarSVG(percent float64) string
- func PercentColorCSSClassCustom(f float64, warningThreshold, criticalThreshold float64) string
- func PercentDownColorCSSClass(f float64) string
- func PercentUpColorCSSClass(f float64) string
- func SlothLogoSVG(color string, width int) string
- type MetricsRecorder
- type ServiceApp
- type UIConfig
Constants ¶
View Source
const ( URLPathAppPrefix = "/app" URLParamServiceID = "serviceID" URLParamSLOID = "sloID" )
View Source
const (
ServePrefix = "/u"
)
Variables ¶
This section is empty.
Functions ¶
func PercentBarSVG ¶
func PercentColorCSSClassCustom ¶
PercentColorCSSClassCustom returns a CSS class based on the given percent value (f). If inverse is true, lower values are considered worse. warningThreshold defines the threshold for warning state. criticalThreshold defines the threshold for critical state.
func PercentUpColorCSSClass ¶
func SlothLogoSVG ¶
Types ¶
type MetricsRecorder ¶
type MetricsRecorder interface {
gohttpmetrics.Recorder
}
MetricsRecorder is the service used to record metrics in the HTTP API handler.
type ServiceApp ¶
type ServiceApp interface {
ListServices(ctx context.Context, req app.ListServicesRequest) (*app.ListServicesResponse, error)
ListSLOs(ctx context.Context, req app.ListSLOsRequest) (*app.ListSLOsResponse, error)
GetSLO(ctx context.Context, req app.GetSLORequest) (*app.GetSLOResponse, error)
ListSLIAvailabilityRange(ctx context.Context, req app.ListSLIAvailabilityRangeRequest) (*app.ListSLIAvailabilityRangeResponse, error)
ListBurnedBudgetRange(ctx context.Context, req app.ListBurnedBudgetRangeRequest) (*app.ListBurnedBudgetRangeResponse, error)
}
type UIConfig ¶
type UIConfig struct {
Logger log.Logger
MetricsRecorder MetricsRecorder
ServiceApp ServiceApp
TimeNowFunc func() time.Time
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.