server

package
v0.0.0-...-81a4f0c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorReadingBody      = errors.New("error reading custom metrics request body")
	ErrorUnmarshalingBody = errors.New("error unmarshaling custom metrics request body")
	ErrorParsingBody      = errors.New("error parsing request body")
)
View Source
var (
	ErrorNoPolicy          = fmt.Errorf("no policy defined")
	ErrorStdMetricExists   = fmt.Errorf("metric already exists in std metrics")
	ErrorMetricNotInPolicy = fmt.Errorf("metric is not define in the policy")
)

Functions

func NewServer

func NewServer(logger lager.Logger, conf *config.Config, policyDB db.PolicyDB, credentials cred_helper.Credentials, allowedMetricCache cache.Cache, httpStatusCollector healthendpoint.HTTPStatusCollector, rateLimiter ratelimiter.Limiter) (ifrit.Runner, error)

Types

type CustomMetricsHandler

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

func NewCustomMetricsHandler

func NewCustomMetricsHandler(logger lager.Logger, metricForwarder forwarder.MetricForwarder, policyDB db.PolicyDB, allowedMetricCache cache.Cache) *CustomMetricsHandler

func (*CustomMetricsHandler) PublishMetrics

func (mh *CustomMetricsHandler) PublishMetrics(w http.ResponseWriter, r *http.Request, appID string) error

func (*CustomMetricsHandler) VerifyCredentialsAndPublishMetrics

func (mh *CustomMetricsHandler) VerifyCredentialsAndPublishMetrics(w http.ResponseWriter, r *http.Request, vars map[string]string)

type Error

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

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetMetricName

func (e *Error) GetMetricName() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type MetricError

type MetricError interface {
	GetMetricName() string
	Unwrap() error
	Error() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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