Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CertificateRegexp = regexp.MustCompile(`^-----BEGIN .+?-----([\s\S]*)-----END .+?-----\s?$`)
Functions ¶
func YAMLNodeFromString ¶ added in v1.4.3
func YAMLNodeFromString(value string) yaml.Node
Types ¶
type Manager ¶
type Manager interface { Id() string AlertManagers() *prom_config.AlertmanagerConfigs }
type ManagerConfig ¶ added in v1.4.0
type ManagerConfig struct {
// contains filtered or unexported fields
}
func ManagerConfigFromJSON ¶ added in v1.4.0
func ManagerConfigFromJSON(body io.ReadCloser) (*ManagerConfig, error)
func NewManagerConfig ¶ added in v1.4.0
func NewManagerConfig(id string, alertmanagers *prom_config.AlertmanagerConfigs) *ManagerConfig
func (*ManagerConfig) AlertManagers ¶ added in v1.4.0
func (m *ManagerConfig) AlertManagers() *prom_config.AlertmanagerConfigs
func (*ManagerConfig) GenerateId ¶ added in v1.4.0
func (m *ManagerConfig) GenerateId()
func (*ManagerConfig) Id ¶ added in v1.4.0
func (m *ManagerConfig) Id() string
func (*ManagerConfig) ToJSON ¶ added in v1.4.0
func (m *ManagerConfig) ToJSON() ([]byte, error)
func (*ManagerConfig) Validate ¶ added in v1.4.0
func (m *ManagerConfig) Validate() error
type Rule ¶
type RuleGroup ¶
type RuleGroupData ¶
type RuleGroupData struct {
Data RuleGroup `json:"data"`
}
type RuleGroups ¶ added in v1.4.3
type RuleGroups struct {
Groups []RuleGroup `json:"groups"`
}
type RulesClient ¶
type RulesClient struct {
// contains filtered or unexported fields
}
func NewRulesClient ¶
func NewRulesClient(addr string, tlsConfig *tls.Config, opts ...RulesClientOption) *RulesClient
func (*RulesClient) CreateManager ¶
func (c *RulesClient) CreateManager(managerId string, alertmanagerConfigs *prom_config.AlertmanagerConfigs) (Manager, *ApiError)
func (*RulesClient) DeleteManager ¶
func (c *RulesClient) DeleteManager(managerId string) *ApiError
func (*RulesClient) UpsertRuleGroup ¶
func (c *RulesClient) UpsertRuleGroup(managerId string, ruleGroup RuleGroup) (*RuleGroup, *ApiError)
type RulesClientOption ¶
type RulesClientOption func(*RulesClient)
func WithRulesClientLogger ¶
func WithRulesClientLogger(log *logger.Logger) RulesClientOption
func WithRulesClientPrivate ¶
func WithRulesClientPrivate() RulesClientOption
func WithRulesClientTimeout ¶
func WithRulesClientTimeout(timeout time.Duration) RulesClientOption
Click to show internal directories.
Click to hide internal directories.