config

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFailCountAlertThreshold = 1
View Source
const DefaultRepeatFailAlerts = false

Variables

This section is empty.

Functions

func Copy

func Copy(srcStore Store, destStore writableStore) error

Types

type CheckRecord

type CheckRecord struct {
	ID         string              `db:"id"`
	Name       string              `db:"name"`
	Type       string              `db:"type"`
	SendAlerts []string            `db:"send_alerts"`
	Backoff    backoffs.Config     `db:"backoff"`
	Config     json.RawMessage     `db:"config"`
	Assertions []assertions.Config `db:"assertions"`
}

type DBStore

type DBStore struct {
	DB *gorp.DbMap
}

func NewDBStore

func NewDBStore(connectionURL string) (*DBStore, error)

func (*DBStore) Checks

func (c *DBStore) Checks() ([]checks.Config, error)

func (*DBStore) Notifications

func (c *DBStore) Notifications() ([]notifiers.Config, error)

func (*DBStore) Preferences

func (c *DBStore) Preferences() (Preferences, error)

type FileStore

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

func NewFileStore

func NewFileStore(filename string) (*FileStore, error)

func (*FileStore) Checks

func (f *FileStore) Checks() ([]checks.Config, error)

func (*FileStore) Notifications

func (f *FileStore) Notifications() ([]notifiers.Config, error)

func (*FileStore) Preferences

func (f *FileStore) Preferences() (Preferences, error)

type FileStoreData

type FileStoreData struct {
	Checks        []checks.Config    `json:"checks"`
	Notifications []notifiers.Config `json:"notifications"`
	Preferences   Preferences        `json:"preferences"`
}

type NotificationPreferences

type NotificationPreferences struct {

	// send an alert only after N fails (default to 1)
	FailCountAlertThreshold *int `json:"fail_count_alert_threshold,omitempty"`

	// continue to send fail alerts (default to false)
	RepeatFailAlerts *bool `json:"repeat_fail_alerts,omitempty"`
}

type NotificationRecord

type NotificationRecord struct {
	ID     string            `db:"id"`
	Name   string            `db:"name"`
	Type   string            `db:"type"`
	Config map[string]string `db:"config"`
}

type Preferences

type Preferences struct {
	Notifications NotificationPreferences `json:"notifications"`
}

type PreferencesRecord

type PreferencesRecord struct {
	ID          int             `db:"id"`
	Preferences json.RawMessage `db:"preferences"`
}

type S3Store added in v0.2.3

type S3Store struct {
	URL string
	// contains filtered or unexported fields
}

func NewS3Store added in v0.2.3

func NewS3Store(URL string) (*S3Store, error)

func (*S3Store) Checks added in v0.2.3

func (s *S3Store) Checks() ([]checks.Config, error)

func (*S3Store) Notifications added in v0.2.3

func (s *S3Store) Notifications() ([]notifiers.Config, error)

func (*S3Store) Preferences added in v0.2.3

func (s *S3Store) Preferences() (Preferences, error)

type S3StoreData added in v0.2.3

type S3StoreData struct {
	Checks        []checks.Config    `json:"checks"`
	Notifications []notifiers.Config `json:"notifications"`
	Preferences   Preferences        `json:"preferences"`
}

type Store

type Store interface {
	Notifications() ([]notifiers.Config, error)
	Checks() ([]checks.Config, error)
	Preferences() (Preferences, error)
}

type TypeConverter

type TypeConverter struct{}

func (TypeConverter) FromDb

func (t TypeConverter) FromDb(target interface{}) (gorp.CustomScanner, bool)

func (TypeConverter) ToDb

func (t TypeConverter) ToDb(val interface{}) (interface{}, error)

type URLStore added in v0.2.2

type URLStore struct {
	URL string
	// contains filtered or unexported fields
}

func NewURLStore added in v0.2.2

func NewURLStore(URL string) (*URLStore, error)

func (*URLStore) Checks added in v0.2.2

func (u *URLStore) Checks() ([]checks.Config, error)

func (*URLStore) Notifications added in v0.2.2

func (u *URLStore) Notifications() ([]notifiers.Config, error)

func (*URLStore) Preferences added in v0.2.2

func (u *URLStore) Preferences() (Preferences, error)

type URLStoreData added in v0.2.2

type URLStoreData struct {
	Checks        []checks.Config    `json:"checks"`
	Notifications []notifiers.Config `json:"notifications"`
	Preferences   Preferences        `json:"preferences"`
}

Jump to

Keyboard shortcuts

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