consul

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2014 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypeBool = iota
	ConfigTypeString
	ConfigTypeInt
	ConfigTypeStrArray
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Node        string
	CheckID     string
	Name        string
	Status      string
	Notes       string
	Output      string
	ServiceID   string
	ServiceName string
}

type ChecksConfig

type ChecksConfig struct {
	Enabled         bool
	ChangeThreshold int
}

type Consul

type Consul interface {
	LoadConfig()

	EventsEnabled() bool
	ChecksEnabled() bool
	EventHandlers(eventName string) []string

	EmailConfig() *EmailNotifierConfig
	LogConfig() *LogNotifierConfig
	InfluxdbConfig() *InfluxdbNotifierConfig
	SlackConfig() *SlackNotifierConfig
	PagerDutyConfig() *PagerDutyNotifierConfig

	CheckChangeThreshold() int
	UpdateCheckData()
	NewAlerts() []Check

	IsBlacklisted(check *Check) bool

	CustomNotifiers() []string

	CheckStatus(node, statusId, checkId string) (status, output string)
}

type ConsulAlertClient

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

func NewClient

func NewClient(address, dc string) (*ConsulAlertClient, error)

func (*ConsulAlertClient) CheckChangeThreshold

func (c *ConsulAlertClient) CheckChangeThreshold() int

func (*ConsulAlertClient) CheckStatus

func (c *ConsulAlertClient) CheckStatus(node, serviceId, checkId string) (status, output string)

func (*ConsulAlertClient) ChecksEnabled

func (c *ConsulAlertClient) ChecksEnabled() bool

func (*ConsulAlertClient) CustomNotifiers

func (c *ConsulAlertClient) CustomNotifiers() []string

func (*ConsulAlertClient) EmailConfig

func (c *ConsulAlertClient) EmailConfig() *EmailNotifierConfig

func (*ConsulAlertClient) EventHandlers

func (c *ConsulAlertClient) EventHandlers(eventName string) []string

func (*ConsulAlertClient) EventsEnabled

func (c *ConsulAlertClient) EventsEnabled() bool

func (*ConsulAlertClient) InfluxdbConfig

func (c *ConsulAlertClient) InfluxdbConfig() *InfluxdbNotifierConfig

func (*ConsulAlertClient) IsBlacklisted added in v0.1.2

func (c *ConsulAlertClient) IsBlacklisted(check *Check) bool

func (*ConsulAlertClient) LoadConfig

func (c *ConsulAlertClient) LoadConfig()

func (*ConsulAlertClient) LogConfig

func (c *ConsulAlertClient) LogConfig() *LogNotifierConfig

func (*ConsulAlertClient) NewAlerts

func (c *ConsulAlertClient) NewAlerts() []Check

func (*ConsulAlertClient) PagerDutyConfig added in v0.1.2

func (c *ConsulAlertClient) PagerDutyConfig() *PagerDutyNotifierConfig

func (*ConsulAlertClient) SlackConfig

func (c *ConsulAlertClient) SlackConfig() *SlackNotifierConfig

func (*ConsulAlertClient) UpdateCheckData

func (c *ConsulAlertClient) UpdateCheckData()

type ConsulAlertConfig

type ConsulAlertConfig struct {
	Checks    *ChecksConfig
	Events    *EventsConfig
	Notifiers *NotifiersConfig
}

func DefaultAlertConfig

func DefaultAlertConfig() *ConsulAlertConfig

type EmailNotifierConfig

type EmailNotifierConfig struct {
	ClusterName string
	Enabled     bool
	Url         string
	Port        int
	Username    string
	Password    string
	SenderAlias string
	SenderEmail string
	Receivers   []string
	Template    string
}

type Event

type Event struct {
	ID            string
	Name          string
	Payload       []byte
	NodeFilter    string
	ServiceFilter string
	TagFilter     string
	Version       uint
	LTime         uint
}

type EventsConfig

type EventsConfig struct {
	Enabled  bool
	Handlers []string
}

type InfluxdbNotifierConfig

type InfluxdbNotifierConfig struct {
	Enabled    bool
	Host       string
	Username   string
	Password   string
	Database   string
	SeriesName string
}

type LogNotifierConfig

type LogNotifierConfig struct {
	Enabled bool
	Path    string
}

type NotifiersConfig

type NotifiersConfig struct {
	Email     *EmailNotifierConfig
	Log       *LogNotifierConfig
	Influxdb  *InfluxdbNotifierConfig
	Slack     *SlackNotifierConfig
	PagerDuty *PagerDutyNotifierConfig
	Custom    []string
}

type PagerDutyNotifierConfig added in v0.1.2

type PagerDutyNotifierConfig struct {
	Enabled    bool
	ServiceKey string
	ClientName string
	ClientUrl  string
}

type SlackNotifierConfig

type SlackNotifierConfig struct {
	Enabled     bool
	ClusterName string
	Team        string
	Token       string
	Channel     string
	Username    string
	IconUrl     string
	IconEmoji   string
}

type Status

type Status struct {
	Current          string
	CurrentTimestamp time.Time
	Pending          string
	PendingTimestamp time.Time
	HealthCheck      *Check
	ForNotification  bool
}

Jump to

Keyboard shortcuts

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