badge

package
v2.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Blue   = color.RGBA{16, 61, 102, 255} // #103d66
	Green  = color.RGBA{11, 97, 42, 255}  // #0b612a
	Purple = color.RGBA{115, 31, 77, 255} // #731f4d
	Orange = color.RGBA{189, 115, 0, 255} // #bd7300
	Red    = color.RGBA{167, 46, 38, 255} // #a72e26
	Grey   = color.RGBA{41, 52, 61, 255}  // #29343D

	HealthStatusColors = map[health.HealthStatusCode]color.RGBA{
		health.HealthStatusDegraded:    Red,
		health.HealthStatusHealthy:     Green,
		health.HealthStatusMissing:     Purple,
		health.HealthStatusProgressing: Blue,
		health.HealthStatusSuspended:   Grey,
		health.HealthStatusUnknown:     Purple,
	}

	SyncStatusColors = map[appv1.SyncStatusCode]color.RGBA{
		appv1.SyncStatusCodeSynced:    Green,
		appv1.SyncStatusCodeOutOfSync: Orange,
		appv1.SyncStatusCodeUnknown:   Purple,
	}
)

Functions

func NewHandler

func NewHandler(appClientset versioned.Interface, settingsMrg *settings.SettingsManager, namespace string, enabledNamespaces []string) http.Handler

NewHandler creates handler serving to do api/badge endpoint

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler used to get application in order to access health/sync

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP returns badge with health and sync status for application (or an error badge if wrong query or application name is given)

Jump to

Keyboard shortcuts

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