api

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatInvalid = "invalid"
	FormatJSON    = "json"
	FormatYAML    = "yaml"
)

Variables

View Source
var (
	ErrEmailNotificationsAreDisabled   = errors.New("email notifications are disabled")
	ErrWebhookNotificationsAreDisabled = errors.New("webhook notifications are disabled")
)

Functions

This section is empty.

Types

type API

type API struct {
	http.Handler
	// contains filtered or unexported fields
}

API implements the configs api.

func New

func New(database db.DB, cfg Config) *API

New creates a new API

func (*API) RegisterRoutes

func (a *API) RegisterRoutes(r *mux.Router)

RegisterRoutes registers the configs API HTTP routes with the provided Router.

type Config added in v0.7.0

type Config struct {
	Notifications NotificationsConfig `yaml:"notifications"`
}

Config configures Configs API

func (*Config) RegisterFlags added in v0.7.0

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to configure this to the given FlagSet.

type ConfigsView

type ConfigsView struct {
	Configs map[string]userconfig.View `json:"configs"`
}

ConfigsView renders multiple configurations, mapping userID to userconfig.View. Exposed only for tests.

type NotificationsConfig added in v0.7.0

type NotificationsConfig struct {
	DisableEmail   bool `yaml:"disable_email"`
	DisableWebHook bool `yaml:"disable_webhook"`
}

NotificationsConfig configures Alertmanager notifications method.

Jump to

Keyboard shortcuts

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