www

package
v0.0.0-...-4d5ffc8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthCreds

type BasicAuthCreds struct {
	Username string
	Password string
}

BasicAuthCreds can be used to restrict access to Server.

type CFClientConfig

type CFClientConfig struct {
	APIEndpoint  *url.URL
	ClientID     string
	ClientSecret string
}

CFClientConfig contains the values required to configure a Cloud Foundry client.

type CFClients

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

CFClients encapsulates Cloud Foundry clients across multiple environments.

func NewCFClients

func NewCFClients(
	staging CFClientConfig,
	production CFClientConfig,
) *CFClients

NewCFClients makes a new CFClients.

func (*CFClients) NewProduction

func (c *CFClients) NewProduction(ctx context.Context) (*cfv2.Client, error)

NewProduction makes a new Cloud Foundry client that connects to the production env.

func (*CFClients) NewStaging

func (c *CFClients) NewStaging(ctx context.Context) (*cfv2.Client, error)

NewStaging makes a new Cloud Foundry client that connects to the staging env.

type CFMetricStore

type CFMetricStore struct {
	Staging    *CFMetrics
	Production *CFMetrics
}

CFMetricStore encapsulates Cloud Foundry metrics across multiple environments.

func NewCFMetricStore

func NewCFMetricStore() *CFMetricStore

NewCFMetricStore makes a new initialized CFMetricStore.

type CFMetrics

type CFMetrics struct {
	Deployments model.Vector
}

CFMetrics contains Cloud Foundry metrics.

type CachingPrometheus

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

CachingPrometheus provides a database cache layer over the prometheus API.

func NewCachingPrometheus

func NewCachingPrometheus(
	db *sql.DB,
	api prometheus.API,
	lifetime time.Duration,
) *CachingPrometheus

NewCachingPrometheus makes a new CachingPrometheus.

func (*CachingPrometheus) Query

func (c *CachingPrometheus) Query(ctx context.Context, q string, ts time.Time) (model.Value, error)

Query implements prometheus.API.

type Server

type Server struct {
	Creds           BasicAuthCreds
	NotFoundPath    string
	NotFoundContent []byte
	UIDir           string
	*CachingPrometheus
	PrometheusQueries map[string]string
	*CFMetricStore
	// contains filtered or unexported fields
}

func (*Server) GetStat

func (s *Server) GetStat(w http.ResponseWriter, r *http.Request)

GetStat is a handler that can return a stat with a provided `id` from the URL query.

func (*Server) NotFound

func (s *Server) NotFound(w http.ResponseWriter, r *http.Request)

NotFound is a handler that can write a HTML 404 response to w.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

Jump to

Keyboard shortcuts

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