Documentation
¶
Index ¶
Constants ¶
View Source
const ( Module = "settings" DB = "settings" ReqCollection = "requests" PolicyDir = "/etc/policies/alert_setting" PolicyV1 = "/etc/policies/alert_setting/alert_setting1_0.yml" MaxRecipientCount = 10 MaxSlackCount = 10 )
Variables ¶
This section is empty.
Functions ¶
func SetCosSchema ¶
func SetCosSchema(alert *Cos)
Types ¶
type Api ¶
type Api struct {
TitlePrefix `json:"titlePrefix" bson:"titlePrefix"`
Email email.Options `json:"email" bson:"email"`
Slack slack.Options `json:"slack" bson:"slack"`
}
func (*Api) SetOkStatus ¶
func (a *Api) SetOkStatus()
type Cos ¶
type Cos struct {
TitlePrefix string `json:"titlePrefix" yaml:"titlePrefix"`
Sender `json:"sender" yaml:"sender"`
Receiver `json:"receiver" yaml:"receiver"`
}
func GetCosSchema ¶
func GetCosSchema() *Cos
func (*Cos) GetSlackUrlByName ¶
func (*Cos) HasRecipient ¶
func (*Cos) ToApiSchema ¶
type Receiver ¶
type Receiver struct {
Emails []email.Recipient `json:"emails" yaml:"emails"`
Slacks []slack.CosChannel `json:"slacks" yaml:"slacks"`
}
type Setting ¶
type Setting struct {
Type string `json:"type" bson:"type"`
Key string `json:"key" bson:"key"`
Value any `json:"value" bson:"value"`
IsReportRequired bool `json:"-" bson:"-"`
*TitlePrefix `json:"titlePrefix,omitempty" bson:"titlePrefix,omitempty"`
*email.Sender `json:"sender,omitempty" bson:"sender,omitempty"`
*email.Recipient `json:"recipient,omitempty" bson:"recipient,omitempty"`
Slack *slack.ApiChannel `json:"slack,omitempty" bson:"slack,omitempty"`
Status status.Settings `json:"status" bson:"status"`
}
func (*Setting) GenTaskUpdate ¶
func (*Setting) SetCompleted ¶
func (o *Setting) SetCompleted()
func (*Setting) SetCreating ¶
func (o *Setting) SetCreating()
func (*Setting) SetDeleting ¶
func (o *Setting) SetDeleting()
func (*Setting) SetUpdating ¶
func (o *Setting) SetUpdating()
type TitlePrefix ¶
type TitlePrefix struct {
Value string `json:"value" bson:"value"`
Status status.Settings `json:"status" bson:"status"`
}
func (*TitlePrefix) SetUpdating ¶
func (t *TitlePrefix) SetUpdating()
Click to show internal directories.
Click to hide internal directories.