Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPermission(u interface{}, sys string) bool
- func Init()
- type DepsTree
- type JobResult
- type LogResult
- type Machine
- type Node
- type Query
- type Queue
- func (m Queue) Create() error
- func (m Queue) Delete() (err error)
- func (m Queue) FindAllByIds(ids []int) ([]*Queue, error)
- func (m Queue) FindAllByNames(names []string) ([]*Queue, error)
- func (m Queue) FindBlankQueue() ([]*Queue, error)
- func (m Queue) Get(id uint64) (v *Queue, err error)
- func (m Queue) GetByName(name string) (v *Queue, err error)
- func (m Queue) Query(query *Query) (v []*Queue, err error)
- func (m Queue) TableName() string
- func (m Queue) Update() error
- type QueueHistory
- type RunType
- type Storage
- func (m Storage) Create() (err error)
- func (m Storage) FindAll() (v []*Storage, err error)
- func (m *Storage) FindOne(query map[string]string) error
- func (m Storage) Get(id uint64) (v *Storage, err error)
- func (m Storage) Query(query *Query) (v []*Storage, err error)
- func (m Storage) TableName() string
- func (m Storage) Update() error
- type System
- type Task
- func (t *Task) Create() error
- func (t *Task) Get(id int64) *Task
- func (t Task) GetAllWork() []*Task
- func (t *Task) GetDepends() []string
- func (t Task) GetDepsTree() *DepsTree
- func (t *Task) GetEtcdJobName() string
- func (t *Task) Query() (v []*Task, err error)
- func (t Task) TableName() string
- func (t *Task) Update() error
- type TaskDetail
- type TaskTest
- type Topic
- func (m Topic) Create() (err error)
- func (m Topic) Delete() (err error)
- func (m Topic) FindAllByQueues(queueNames []string) ([]TransModelTopic, error)
- func (m *Topic) FindOne(query map[string]string) error
- func (m Topic) Get(id uint64) (v *Topic, err error)
- func (m Topic) GetQueueTopic() string
- func (m Topic) Query(query *Query) (v []*Topic, err error)
- func (m Topic) Search(system, queue, topic string, con string) (v []*Topic, err error)
- func (m Topic) TableName() string
- func (m Topic) Update() error
- type TopicHistory
- type TransModelQueue
- type TransModelStorage
- type TransModelTopic
- type User
Constants ¶
View Source
const ( HourData = iota DayData MonthData )
View Source
const ( Cron = iota Dur )
View Source
const ( TaskWorking = iota TaskStop TaskRemove )
View Source
const ( TopicStatusEnable = iota TopicStatusDisable )
View Source
const (
LdapUser = 1
)
Variables ¶
View Source
var ( UserNotExist = errors.New("user not exist") InvalidCredential = errors.New("invalid username or password") Administration = "administration" )
Functions ¶
func CheckPermission ¶
Types ¶
type JobResult ¶
type JobResult struct { Id uint `gorm:"primary_key"` JobName string `json:"job_name"` DispatchID string `json:"dispatch_id"` JobCompleted bool GroupID float64 `json:"group_id"` AgentNode string `json:"agent_node"` StartedAt time.Time `json:"started_at"` FinishedAt time.Time `json:"finished_at"` Status int `json:"status"` Output string `json:"output,omitempty" gorm:"column:output_data"` }
type Machine ¶
type Machine struct { ginp.Model System string `binding:"required" json:"system" gorm:"unique_index:idx_ip_system"` IP string `json:"ip" gorm:"unique_index:idx_ip_system"` Status int `json:"status"` // operator Comment string `binding:"required" json:"comment"` Operator string `json:"author"` // only for request form Cron bool `json:"cron" gorm:"-"` IPs string `binding:"required" json:"ips" gorm:"-"` }
type Queue ¶
type Queue struct { ginp.Model Name string `binding:"required" json:"name" gorm:"unique_index"` Describe string `binding:"required" json:"desc" gorm:"column:description"` Password string `binding:"required" json:"password"` TopicCount int `json:"topics"` // operator Comment string `binding:"required" json:"comment"` Operator string `json:"author"` }
func (Queue) FindBlankQueue ¶
type QueueHistory ¶
type QueueHistory struct { ginp.Model Queue string `json:"queue" gorm:"index:idx_queue"` SuccessCount int64 `json:"success_count"` FailCount int64 `json:"fail_count"` AddQps float64 `json:"add_qps"` // DataType int `binding:"required" json:"type" form:"type" gorm:"-"` }
func (QueueHistory) CreateBatch ¶
func (m QueueHistory) CreateBatch(data map[string]*QueueHistory) error
func (QueueHistory) TableName ¶
func (m QueueHistory) TableName() string
type Storage ¶
type Storage struct { ginp.Model System string `json:"system" gorm:"unique_index:idx_system_host_port"` Type string `json:"type" gorm:"default:'redis'"` Host string `json:"host" gorm:"unique_index:idx_system_host_port"` Port int `json:"port" gorm:"unique_index:idx_system_host_port"` Password string `json:"password"` MaxConnNum int `json:"max_conn_num" gorm:"default:'100'"` MaxIdleNum int `json:"max_idle_num" gorm:"default:'100'"` MaxIdleSeconds time.Duration `json:"max_idle_seconds" gorm:"default:'3000000000'"` Status int `json:"status"` Describe string `json:"desc" gorm:"column:description"` // operator Comment string `form:"comment"` Operator string `form:"author"` }
type System ¶
type System struct { ginp.Model Name string `binding:"required" form:"name" json:"name" gorm:"unique_index"` Describe string `binding:"required" form:"desc" json:"desc" gorm:"column:description"` MachineCount int `json:"machines"` StorageCount int `json:"storages"` TopicCount int `json:"topics"` CronMachineCount int `json:"cron_machines"` JobCount int `json:"jobs"` // operator Comment string `form:"comment"` Operator string `form:"author"` // cron job count JobSuccessCount uint64 `json:"job_success_count" gorm:"-"` JobFailCount uint64 `json:"job_fail_count" gorm:"-"` }
type Task ¶
type Task struct { ginp.Model System string `binding:"required" json:"system"` Name string `binding:"required" json:"name" gorm:"unique_index:task_name"` Describe string `binding:"required" json:"desc" gorm:"column:description"` TimeOut int `json:"timeout" gorm:"default:500"` Concurrency int `json:"concurrency" gorm:"default:'1'"` Executor int `json:"executor" gorm:"default:0"` GRPCHost string `json:"grpc_host" gorm:"column:grpc_host"` Exec string `json:"command"` RunType string `json:"scheduler"` Status int `json:"status" gorm:"default:0"` // 0表示开启 NodeStatus int `json:"nodeStatus" gorm:"column:node_status;default:0"` // 0表示正常,1表示无可用节点 DependOn string `json:"dependents"` Children string `json:"children"` Operator string `json:"author"` EnvVar string `json:"envs"` }
func (Task) GetAllWork ¶
func (Task) GetDepsTree ¶
func (*Task) GetEtcdJobName ¶
type TaskDetail ¶
type TaskTest ¶
type Topic ¶
type Topic struct { ginp.Model System string `binding:"required" json:"system"` Queue string `binding:"required" json:"queue" gorm:"unique_index:uix_name_queue_name"` Name string `binding:"required" json:"name" gorm:"unique_index:uix_name_queue_name"` Describe string `binding:"required" json:"desc" gorm:"column:description"` ConsumeFile string `binding:"required" json:"consume"` RetryTimes int `json:"retry_times" gorm:"default:'3'"` MaxQueueLength int `json:"max_queue_length" gorm:"default:'1000'"` RunType int `json:"run_type" gorm:"default:'0'"` Password string `json:"password"` NumOfWorkers int `json:"num_of_workers" gorm:"default:'10'"` CgiConfig string `json:"cgi_config" gorm:"default:'local'"` Storage uint64 `binding:"required" json:"storage"` Status uint8 `json:"status" gorm:"default:0"` Alarm int `json:"alarm" gorm:"default:200"` AlarmRetry int `json:"alarm_retry" gorm:"default:100"` HttpConfig string `json:"http_config" gorm:"default:''"` TopicConfig string `json:"topic_config" gorm:"default:''"` // operator Comment string `binding:"required" json:"comment"` Operator string `json:"author"` }
func (Topic) FindAllByQueues ¶
func (m Topic) FindAllByQueues(queueNames []string) ([]TransModelTopic, error)
func (Topic) GetQueueTopic ¶
type TopicHistory ¶
type TopicHistory struct { ginp.Model Queue string `json:"queue" gorm:"unique_index:uix_queue_topic"` Topic string `json:"topic" gorm:"unique_index:uix_queue_topic"` Length int64 `json:"length"` RetryLength int64 `json:"retry_length"` TimeoutLength int64 `json:"timeout_length"` // DataType int `binding:"required" json:"type" form:"type" gorm:"-"` }
func (TopicHistory) CreateBatch ¶
func (m TopicHistory) CreateBatch(data map[string]*TopicHistory) error
func (TopicHistory) GetQueueTopic ¶
func (m TopicHistory) GetQueueTopic() string
func (TopicHistory) TableName ¶
func (m TopicHistory) TableName() string
type TransModelQueue ¶
type TransModelQueue struct { Name string `json:"name"` Desc string `json:"desc"` Password string `json:"password"` Comment string `json:"comment"` Topics []TransModelTopic }
type TransModelStorage ¶
type TransModelTopic ¶
type TransModelTopic struct { System string `json:"system"` Queue string `json:"queue"` Name string `json:"name"` Desc string `json:"desc"` Password string `json:"password"` Consume string `json:"consume"` Comment string `json:"comment"` Status string `json:"status"` Storage TransModelStorage `json:"storage"` }
Click to show internal directories.
Click to hide internal directories.