config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChannelCapacity = 1000
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ReceiverOpts *v2alpha1.Options
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, logger log.Logger) (*Config, error)

func (*Config) GetSecretData

func (c *Config) GetSecretData(selector *v2alpha1.SecretKeySelector) (string, error)

func (*Config) OutputReceiver

func (c *Config) OutputReceiver(tenant, receiver string) interface{}

func (*Config) RcvsFromNs

func (c *Config) RcvsFromNs(namespace *string) []Receiver

func (*Config) Run

func (c *Config) Run() error

type DingTalk

type DingTalk struct {
	ChatID         string
	ChatBot        *DingTalkChatBot
	DingTalkConfig *DingTalkConfig
	Selector       *metav1.LabelSelector
	// contains filtered or unexported fields
}

func (*DingTalk) GenerateConfig

func (d *DingTalk) GenerateConfig(c *Config, obj interface{})

func (*DingTalk) GenerateReceiver

func (d *DingTalk) GenerateReceiver(c *Config, obj interface{})

func (*DingTalk) GetConfig

func (d *DingTalk) GetConfig() interface{}

func (*DingTalk) SetConfig

func (d *DingTalk) SetConfig(obj interface{}) error

func (DingTalk) SetUseDefault

func (c DingTalk) SetUseDefault(b bool)

func (DingTalk) UseDefault

func (c DingTalk) UseDefault() bool

type DingTalkChatBot

type DingTalkChatBot struct {
	Webhook  *v2alpha1.SecretKeySelector
	Keywords []string
	Secret   *v2alpha1.SecretKeySelector
}

Configuration of ChatBot

type DingTalkConfig

type DingTalkConfig struct {
	AppKey    *v2alpha1.SecretKeySelector
	AppSecret *v2alpha1.SecretKeySelector
}

type Email

type Email struct {
	To          []string
	EmailConfig *EmailConfig
	Selector    *metav1.LabelSelector
	// contains filtered or unexported fields
}

func NewEmail

func NewEmail(to []string) *Email

func (*Email) GenerateConfig

func (e *Email) GenerateConfig(c *Config, obj interface{})

func (*Email) GenerateReceiver

func (e *Email) GenerateReceiver(c *Config, obj interface{})

func (*Email) GetConfig

func (e *Email) GetConfig() interface{}

func (*Email) SetConfig

func (e *Email) SetConfig(obj interface{}) error

func (Email) SetUseDefault

func (c Email) SetUseDefault(b bool)

func (Email) UseDefault

func (c Email) UseDefault() bool

type EmailConfig

type EmailConfig struct {
	From         string
	SmartHost    v2alpha1.HostPort
	Hello        string
	AuthUsername string
	AuthIdentify string
	AuthPassword *v2alpha1.SecretKeySelector
	AuthSecret   *v2alpha1.SecretKeySelector
	RequireTLS   bool
	TLS          *v2alpha1.TLSConfig
}

type Receiver

type Receiver interface {
	UseDefault() bool
	SetUseDefault(b bool)
	GetConfig() interface{}
	SetConfig(c interface{}) error
	GenerateConfig(c *Config, obj interface{})
	GenerateReceiver(c *Config, obj interface{})
}

func NewDingTalkReceiver

func NewDingTalkReceiver() Receiver

func NewEmailReceiver

func NewEmailReceiver() Receiver

func NewSlackReceiver

func NewSlackReceiver() Receiver

func NewWebhookReceiver

func NewWebhookReceiver() Receiver

func NewWechatReceiver

func NewWechatReceiver() Receiver

type Slack

type Slack struct {
	// The channel or user to send notifications to.
	Channel     string
	SlackConfig *SlackConfig
	Selector    *metav1.LabelSelector
	// contains filtered or unexported fields
}

func (*Slack) GenerateConfig

func (s *Slack) GenerateConfig(c *Config, obj interface{})

func (*Slack) GenerateReceiver

func (s *Slack) GenerateReceiver(c *Config, obj interface{})

func (*Slack) GetConfig

func (s *Slack) GetConfig() interface{}

func (*Slack) SetConfig

func (s *Slack) SetConfig(obj interface{}) error

func (Slack) SetUseDefault

func (c Slack) SetUseDefault(b bool)

func (Slack) UseDefault

func (c Slack) UseDefault() bool

type SlackConfig

type SlackConfig struct {
	// The token of user or bot.
	Token *v2alpha1.SecretKeySelector
}

type Webhook

type Webhook struct {
	// `url` gives the location of the webhook, in standard URL form.
	URL           string
	HttpConfig    *v2alpha1.HTTPClientConfig
	WebhookConfig *WebhookConfig
	Selector      *metav1.LabelSelector
	// contains filtered or unexported fields
}

func (*Webhook) GenerateConfig

func (w *Webhook) GenerateConfig(_ *Config, _ interface{})

func (*Webhook) GenerateReceiver

func (w *Webhook) GenerateReceiver(c *Config, obj interface{})

func (*Webhook) GetConfig

func (w *Webhook) GetConfig() interface{}

func (*Webhook) SetConfig

func (w *Webhook) SetConfig(obj interface{}) error

func (Webhook) SetUseDefault

func (c Webhook) SetUseDefault(b bool)

func (Webhook) UseDefault

func (c Webhook) UseDefault() bool

type WebhookConfig

type WebhookConfig struct {
}

type Wechat

type Wechat struct {
	ToUser       string
	ToParty      string
	ToTag        string
	WechatConfig *WechatConfig
	Selector     *metav1.LabelSelector
	// contains filtered or unexported fields
}

func (*Wechat) Clone

func (w *Wechat) Clone() *Wechat

func (*Wechat) GenerateConfig

func (w *Wechat) GenerateConfig(c *Config, obj interface{})

func (*Wechat) GenerateReceiver

func (w *Wechat) GenerateReceiver(c *Config, obj interface{})

func (*Wechat) GetConfig

func (w *Wechat) GetConfig() interface{}

func (*Wechat) SetConfig

func (w *Wechat) SetConfig(obj interface{}) error

func (Wechat) SetUseDefault

func (c Wechat) SetUseDefault(b bool)

func (Wechat) UseDefault

func (c Wechat) UseDefault() bool

type WechatConfig

type WechatConfig struct {
	APISecret *v2alpha1.SecretKeySelector
	CorpID    string
	APIURL    string
	AgentID   string
}

Jump to

Keyboard shortcuts

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