Documentation ¶
Index ¶
- Constants
- Variables
- func CheckElements(formats []map[string]string, title, template []string) error
- func ValidateInt(field int64) string
- func ValidateString(field string) string
- type Behavior
- type CreateNotifyReq
- type CreateUserDefineNotifyTemplate
- type GetAllGroupData
- type GetNotifyRes
- type GroupInfo
- type Metadata
- type Model
- type NotifyDetailResponse
- type NotifyRecord
- type NotifyRes
- type NotifyTarget
- type QueryNotifyListReq
- type QueryNotifyListRes
- type Render
- type Target
- type TargetValue
- type Templates
- type UpdateNotifyReq
Constants ¶
View Source
const ( PageNumber = 1 PageSize = 10 RuneCount = 50 )
View Source
const ( FieldEmpty = "this field not be empty" FieldTooLong = "this field is too long" SpaceField = "this field can't just contain spaces" FiledZero = "this field must not be zero" )
View Source
const ( Address = "群组地址:" Role = "通知角色:" DingDingTarget = "dingding" )
Variables ¶
View Source
var ( ErrCreateNotify = err("ErrCreateNotify", "创建通知失败") ErrGetNotify = err("ErrGetNotify", "获取通知失败") ErrDeleteNotify = err("ErrDeleteNotify", "删除通知失败") ErrUpdateNotify = err("ErrUpdateNotify", "更新通知失败") ErrNotifyEnable = err("ErrNotifyEnable", "启用通知失败") )
Functions ¶
func CheckElements ¶
func ValidateInt ¶
func ValidateString ¶
Types ¶
type CreateNotifyReq ¶
type CreateNotifyReq struct { ScopeID string `query:scopeId validate:"required"` Scope string `query:"scope" validate:"required"` TemplateID []string `query:"templateId" validate:"required"` NotifyName string `query:"notifyName" validate:"required"` NotifyGroupID int64 `query:"notifyGroupId" validate:"required"` Channels []string `query:"channels" validate:"required"` Attribute map[string]string `query:"attribute"` }
func (CreateNotifyReq) CheckNotify ¶
func (c CreateNotifyReq) CheckNotify() error
type CreateUserDefineNotifyTemplate ¶
type CreateUserDefineNotifyTemplate struct { Name string `query:"name" validate:"required"` Group string `query:"group" validate:"required"` Trigger []string `query:"trigger" validate:"required"` Formats []map[string]string `query:"formats" validate:"required"` Title []string `query:"title" validate:"required"` Template []string `query:"template" validate:"required"` Scope string `query:"scope" validate:"required"` ScopeID string `query:"scopeId" validate:"required"` Targets []string `query:"targets" validate:"required"` }
func (CreateUserDefineNotifyTemplate) CheckCustomizeNotify ¶
func (c CreateUserDefineNotifyTemplate) CheckCustomizeNotify() error
type GetAllGroupData ¶
type GetNotifyRes ¶
type Model ¶
type Model struct { ID string `json:"id" yaml:"id"` //id is not the database generated auto id Metadata Metadata `json:"metadata" yaml:"metadata"` Behavior Behavior `json:"behavior" yaml:"behavior"` Templates []Templates `json:"templates" yaml:"templates"` }
the complete template,ID just like addon_elasticsearch_cpu
type NotifyDetailResponse ¶
type NotifyRecord ¶
type NotifyRecord struct { NotifyId string `json:"notify_id" gorm:"column:notify_id"` NotifyName string `json:"notify_name" gorm:"column:notify_name"` ScopeType string `json:"scope_type" gorm:"column:scope_type"` ScopeId int64 `json:"scope_id" gorm:"column:scope_id"` GroupId string `json:"group_id" gorm:"column:group_id"` NotifyGroup string `json:"notify_group" gorm:"column:notify_group"` Title string `json:"title" gorm:"column:title"` NotifyTime int64 `json:"notify_time" gorm:"column:notify_time"` CreateTime int64 `json:"create_time" gorm:"column:create_time"` UpdateTime int64 `json:"update_time" gorm:"column:update_time"` }
type NotifyTarget ¶
type NotifyTarget struct { Type string `json:"type"` Values []TargetValue `json:"values"` }
type QueryNotifyListReq ¶
type QueryNotifyListRes ¶
type QueryNotifyListRes struct {
List []NotifyRes
}
type TargetValue ¶
type UpdateNotifyReq ¶
type UpdateNotifyReq struct { ID int64 `param:"id" validate:"required"` Scope string `query:"scope" validate:"required"` ScopeID string `query:"scopeId" validate:"required"` Channels []string `query:"channels" validate:"required"` NotifyGroupID int64 `query:"notifyGroupId" validate:"required"` TemplateId []string `query:"templateId" validate:"required"` Attribute map[string]string `query:"attribute"` }
func (UpdateNotifyReq) CheckNotify ¶
func (c UpdateNotifyReq) CheckNotify() error
Click to show internal directories.
Click to hide internal directories.