shared

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Metric Enum
	MetricLatency      = "http-latency"
	MetricAvailability = "http-availability"

	// Datasource Enum
	LoggingDatasource    = "logging"
	MonitoringDatasource = "monitoring"

	// Alert Enum
	AlertingBurnRate = "burnrate"
	AlertingBudget   = "budget"
	AlertingTarget   = "target"

	GTThresholdType = ">"
	LTThresholdType = "<"

	// Notification Enum
	NotifSlack = "slack"
	NotifMail  = "email"
	NotifPager = "pager"
	NotifHook  = "webhook"

	OsloVersion = "openslo/v1"
)

Variables

View Source
var (
	ErrMissingServices          = validation.Error("Service definitions are required to create an SLO")
	ErrInvalidMonitorWindow     = validation.Error("Invalid `monitorWindow` in the body of the request")
	ErrInvalidTarget            = validation.Error("Invalid `target` in the body of the request")
	ErrInvalidBudgetingInterval = validation.Error("Invalid `budgetingInterval` in the body of the request : Must be between 1m & 1h")
	ErrInvalidMetricName        = validation.Error("Invalid `metricName` in the body of the request")
	ErrInvalidDescription       = validation.Errorf("Description %s", lengthConstraint(1050))
	ErrInvalidMetric            = validation.Error("Invalid preconfigured metric")
	ErrInvalidAlertType         = validation.Error("Invalid alert type")
	ErrInvalidAlertCondition    = validation.Error("Invalid Alert Condition")
	ErrInvalidAlertThreshold    = validation.Error("Invalid Alert Threshold")
	ErrInvalidAlertTarget       = validation.Error("Invalid Alert Target")
	ErrMissingServiceInfo       = validation.Error("Service job & cluster id are required to create an SLO")
	ErrNonNullId                = WithInternalServerError("Slo Create requests must not have a set id")
	ErrPrometheusGenerator      = WithInternalServerError("Prometheus generator failed to start")
	ErrInvalidDatasource        = WithNotFoundError("Invalid required datasource value")
	ErrNotImplemented           = WithUnimplementedError("Not Implemented")
)

validation error descriptions

Functions

func WithInternalServerError

func WithInternalServerError(msg string) error

func WithInternalServerErrorf

func WithInternalServerErrorf(format string, args ...interface{}) error

func WithNotFoundError

func WithNotFoundError(msg string) error

func WithNotFoundErrorf

func WithNotFoundErrorf(format string, args ...interface{}) error

func WithUnimplementedError

func WithUnimplementedError(msg string) error

func WithUnimplementedErrorf

func WithUnimplementedErrorf(format string, args ...interface{}) error

Types

type InternalServerError

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

func (*InternalServerError) Error

func (e *InternalServerError) Error() string

func (*InternalServerError) GRPCStatus

func (e *InternalServerError) GRPCStatus() *status.Status

type NotFoundError

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) GRPCStatus

func (e *NotFoundError) GRPCStatus() *status.Status

type UnimplementedError

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

func (*UnimplementedError) Error

func (e *UnimplementedError) Error() string

func (*UnimplementedError) GRPCStatus

func (e *UnimplementedError) GRPCStatus() *status.Status

Jump to

Keyboard shortcuts

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