registry

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertThresholds added in v0.7.11

func ConvertThresholds(apiv0Thresholds []APIV0Threshold) []indicator.Threshold

func NewAPIClient

func NewAPIClient(serverURL string, client *http.Client) *apiClient

func NewIndicatorDocumentsHandler

func NewIndicatorDocumentsHandler(store *DocumentStore, statusStore *status_store.Store) http.HandlerFunc

func NewIndicatorStatusBulkUpdateHandler added in v0.7.10

func NewIndicatorStatusBulkUpdateHandler(store *status_store.Store) http.HandlerFunc

func NewRegisterHandler

func NewRegisterHandler(store *DocumentStore) http.HandlerFunc

func NewWebServer

func NewWebServer(c WebServerConfig) (func() error, func() error, error)

func ToIndicatorDocument

func ToIndicatorDocument(d APIV0Document) indicator.Document

Types

type APIV0Alert

type APIV0Alert struct {
	For  string `json:"for"`
	Step string `json:"step"`
}

type APIV0Document

type APIV0Document struct {
	APIVersion string            `json:"apiVersion"`
	UID        string            `json:"uid"`
	Product    APIV0Product      `json:"product"`
	Metadata   map[string]string `json:"metadata"`
	Indicators []APIV0Indicator  `json:"indicators"`
	Layout     APIV0Layout       `json:"layout"`
}

func ToAPIV0Document

func ToAPIV0Document(doc indicator.Document, getStatus func(string) *APIV0IndicatorStatus) APIV0Document

type APIV0Indicator

type APIV0Indicator struct {
	Name          string                `json:"name"`
	PromQL        string                `json:"promql"`
	Thresholds    []APIV0Threshold      `json:"thresholds"`
	Alert         APIV0Alert            `json:"alert"`
	ServiceLevel  *APIV0ServiceLevel    `json:"serviceLevel"`
	Documentation map[string]string     `json:"documentation,omitempty"`
	Presentation  APIV0Presentation     `json:"presentation"`
	Status        *APIV0IndicatorStatus `json:"status"`
}

type APIV0IndicatorStatus added in v0.7.10

type APIV0IndicatorStatus struct {
	Value     *string   `json:"value"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type APIV0Layout

type APIV0Layout struct {
	Title       string         `json:"title"`
	Description string         `json:"description"`
	Sections    []APIV0Section `json:"sections"`
	Owner       string         `json:"owner"`
}

type APIV0Presentation

type APIV0Presentation struct {
	ChartType    string   `json:"chartType"`
	CurrentValue bool     `json:"currentValue"`
	Frequency    int64    `json:"frequency"`
	Labels       []string `json:"labels"`
	Units        string   `json:"units"`
}

type APIV0Product

type APIV0Product struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type APIV0Section

type APIV0Section struct {
	Title       string   `json:"title"`
	Description string   `json:"description"`
	Indicators  []string `json:"indicators"`
}

type APIV0ServiceLevel added in v0.7.11

type APIV0ServiceLevel struct {
	Objective float64 `json:"objective"`
}

type APIV0Threshold

type APIV0Threshold struct {
	Level    string  `json:"level"`
	Operator string  `json:"operator"`
	Value    float64 `json:"value"`
}

type APIV0UpdateIndicatorStatus added in v0.7.10

type APIV0UpdateIndicatorStatus struct {
	Name   string  `json:"name"`
	Status *string `json:"status"`
}

type Agent

type Agent struct {
	RegistryURI    string
	IntervalTime   time.Duration
	DocumentFinder DocumentFinder
	Client         *http.Client
}

func (Agent) Start

func (a Agent) Start()

type DocumentFinder

type DocumentFinder struct {
	Glob string
}

func (DocumentFinder) FindAll

func (df DocumentFinder) FindAll() ([]document, error)

type DocumentStore

type DocumentStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDocumentStore

func NewDocumentStore(timeout time.Duration, c clock) *DocumentStore

func (*DocumentStore) AllDocuments

func (d *DocumentStore) AllDocuments() []indicator.Document

func (*DocumentStore) AllPatches

func (d *DocumentStore) AllPatches() []indicator.Patch

func (*DocumentStore) UpsertDocument

func (d *DocumentStore) UpsertDocument(doc indicator.Document)

func (*DocumentStore) UpsertPatches

func (d *DocumentStore) UpsertPatches(patchList PatchList)

type PatchList

type PatchList struct {
	Source  string
	Patches []indicator.Patch
}

type WebServerConfig

type WebServerConfig struct {
	Address       string
	ServerPEMPath string
	ServerKeyPath string
	RootCAPath    string
	DocumentStore *DocumentStore
	StatusStore   *status_store.Store
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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