api

package
v1.3.0-rc.1.0...-65594da Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 20 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

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

Config configures Configs API

func (*Config) RegisterFlags

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

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