registry

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 21 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 []APIThresholdResponse) []v1.Threshold

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)

Types

type APIAlertResponse added in v0.7.15

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

type APIDocumentResponse added in v0.7.15

type APIDocumentResponse struct {
	APIVersion string                  `json:"apiVersion"`
	UID        string                  `json:"uid"`
	Kind       string                  `json:"kind"`
	Metadata   APIMetadataResponse     `json:"metadata"`
	Spec       APIDocumentSpecResponse `json:"spec"`
}

func ToAPIDocumentResponse added in v0.7.15

func ToAPIDocumentResponse(doc v1.IndicatorDocument) APIDocumentResponse

type APIDocumentSpecResponse added in v0.7.15

type APIDocumentSpecResponse struct {
	Product    APIProductResponse     `json:"product"`
	Indicators []APIIndicatorResponse `json:"indicators"`
	Layout     APILayoutResponse      `json:"layout"`
}

type APIIndicatorResponse added in v0.7.15

type APIIndicatorResponse struct {
	Name          string                      `json:"name"`
	Type          string                      `json:"type"`
	PromQL        string                      `json:"promql"`
	Thresholds    []APIThresholdResponse      `json:"thresholds"`
	Alert         APIAlertResponse            `json:"alert"`
	Documentation map[string]string           `json:"documentation,omitempty"`
	Presentation  APIPresentationResponse     `json:"presentation"`
	Status        *APIIndicatorStatusResponse `json:"status"`
}

type APIIndicatorStatusResponse added in v0.7.15

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

type APILayoutResponse added in v0.7.15

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

type APIMetadataResponse added in v0.7.15

type APIMetadataResponse struct {
	Labels map[string]string `json:"labels"`
}

type APIPresentationResponse added in v0.7.15

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

type APIProductResponse added in v0.7.15

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

type APISectionResponse added in v0.7.15

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

type APIThresholdResponse added in v0.7.15

type APIThresholdResponse 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() []v1.IndicatorDocument

func (*DocumentStore) AllPatches

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

func (*DocumentStore) FilteredDocuments added in v0.7.15

func (d *DocumentStore) FilteredDocuments(productName string) []v1.IndicatorDocument

func (*DocumentStore) UpsertDocument

func (d *DocumentStore) UpsertDocument(doc v1.IndicatorDocument)

func (*DocumentStore) UpsertPatches

func (d *DocumentStore) UpsertPatches(patchList PatchList)

type PatchList

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

type RegistryApiClient added in v0.7.15

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

func NewAPIClient

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

func (*RegistryApiClient) BulkStatusUpdate added in v0.7.15

func (c *RegistryApiClient) BulkStatusUpdate(statusUpdates []APIV0UpdateIndicatorStatus, documentId string) error

func (*RegistryApiClient) IndicatorDocuments added in v0.7.15

func (c *RegistryApiClient) IndicatorDocuments() ([]APIDocumentResponse, error)

type WebServerConfig

type WebServerConfig struct {
	Address       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