ui

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLPathAppPrefix = "/app"

	URLParamServiceID = "serviceID"
	URLParamSLOID     = "sloID"
)
View Source
const (
	ServePrefix = "/u"
)

Variables

This section is empty.

Functions

func NewUI

func NewUI(cfg UIConfig) (http.Handler, error)

New returns UI HTTP handler.

func PercentBarSVG

func PercentBarSVG(percent float64) string

func PercentColorCSSClassCustom

func PercentColorCSSClassCustom(f float64, warningThreshold, criticalThreshold float64) string

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 PercentDownColorCSSClass

func PercentDownColorCSSClass(f float64) string

func PercentUpColorCSSClass

func PercentUpColorCSSClass(f float64) string

func SlothLogoSVG

func SlothLogoSVG(color string, width int) string

Types

type MetricsRecorder

type MetricsRecorder interface {
	gohttpmetrics.Recorder
}

MetricsRecorder is the service used to record metrics in the HTTP API handler.

type UIConfig

type UIConfig struct {
	Logger          log.Logger
	MetricsRecorder MetricsRecorder
	ServiceApp      ServiceApp
	TimeNowFunc     func() time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL