Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Validate ¶
func Validate(entity EntityValidator) error
Types ¶
type DataLog ¶
type DataLog struct { Id int `json:"id" form:"id" gorm:"primaryKey;autoIncrement"` TaskId int `json:"task_id" form:"task_id" gorm:"type:int(11);not null"` CreatedAt int64 `json:"created_at" form:"created_at" gorm:"type:int(11);not null"` Level string `json:"level" form:"level" gorm:"type:varchar(255);not null"` Message string `json:"message" form:"message" gorm:"type:text;not null"` }
type EntityValidator ¶
type EntityValidator interface {
Validate() error
}
type Task ¶
type Task struct { gorm.Model Name string `json:"name" form:"name" gorm:"type:varchar(255);not null;uniqueIndex" validate:"required"` Description string `json:"description" form:"description" gorm:"type:text"` Type string `json:"type" form:"type" gorm:"type:varchar(255);not null" validate:"required,oneof=http https ping port"` Target string `json:"target" form:"target" gorm:"type:longtext;not null" validate:"required"` HttpHost string `json:"http_host" form:"http_host" gorm:"type:varchar(255)"` SslVerify bool `json:"ssl_verify" form:"ssl_verify" gorm:"type:tinyint(1);not null;default:0"` SslExpire bool `json:"ssl_expire" form:"ssl_expire" gorm:"type:tinyint(1);not null;default:0"` Interval int64 `json:"interval" form:"interval" gorm:"type:int(11);not null;default:60" validate:"required,gte=0"` Timeout int64 `json:"timeout" form:"timeout" gorm:"type:int(11);not null;default:10000" validate:"required,gte=0"` Status string `json:"status" form:"status" gorm:"type:varchar(255);not null;default:'active'"` }
Click to show internal directories.
Click to hide internal directories.