Documentation ¶
Index ¶
- Constants
- Variables
- func GetNodeSystemInfo(uuid string) (s *utils.Server, err error)
- func RegisterTables(db *gorm.DB) error
- func RunLogCleaner(cleanPeriod time.Duration, expiration int64) (close chan struct{})
- type JobService
- func (j *JobService) AutoAllocateNode() string
- func (j *JobService) GetJobExcCount(start, end int64, success int) ([]resp.DateCount, error)
- func (j *JobService) GetNotAssignedJob() (jobs []models.Job, err error)
- func (j *JobService) GetRunningJobCount() (int64, error)
- func (j *JobService) GetTodayJobExcCount(success int) (int64, error)
- func (j *JobService) Once(once *request.ReqJobOnce) (err error)
- func (j *JobService) Search(s *request.ReqJobSearch) ([]models.Job, int64, error)
- func (j *JobService) SearchJobLog(s *request.ReqJobLogSearch) ([]models.JobLog, int64, error)
- type NodeWatcherService
- func (n *NodeWatcherService) Close() error
- func (n *NodeWatcherService) FailOver(nodeUUID string) (success Result, fail Result, err error)
- func (n *NodeWatcherService) GetJobCount(nodeUUID string) (int, error)
- func (n *NodeWatcherService) GetJobs(nodeUUID string) (jobs []models.Job, err error)
- func (n *NodeWatcherService) GetNodeCount(status int) (int64, error)
- func (n *NodeWatcherService) GetUUID(key string) string
- func (n *NodeWatcherService) List2Array() []string
- func (n *NodeWatcherService) Search(s *request.ReqNodeSearch) ([]models.Node, int64, error)
- func (n *NodeWatcherService) Watch() error
- type Result
- type ScriptService
- type UserService
- func (us *UserService) ChangePassword(userId int, oldPassword, newPassword string) error
- func (us *UserService) FindByUserName(username string) (u *models.User, err error)
- func (us *UserService) Login(username, password string) (u *models.User, err error)
- func (us *UserService) Search(s *request.ReqUserSearch) ([]models.User, int64, error)
Constants ¶
View Source
const MaxJobCount = 10000
Variables ¶
View Source
var DefaultJobService = new(JobService)
View Source
var DefaultScriptService = new(ScriptService)
View Source
var DefaultUserService = new(UserService)
Functions ¶
func RegisterTables ¶
func RunLogCleaner ¶
Types ¶
type JobService ¶
type JobService struct { }
func (*JobService) AutoAllocateNode ¶
func (j *JobService) AutoAllocateNode() string
Give priority to the node with the least number of tasks
func (*JobService) GetJobExcCount ¶
The number of tasks per day in a certain period of time
func (*JobService) GetNotAssignedJob ¶
func (j *JobService) GetNotAssignedJob() (jobs []models.Job, err error)
func (*JobService) GetRunningJobCount ¶
func (j *JobService) GetRunningJobCount() (int64, error)
func (*JobService) GetTodayJobExcCount ¶
func (j *JobService) GetTodayJobExcCount(success int) (int64, error)
Get the total number of tasks executed today 1 indicates success 0 indicates failure
func (*JobService) Once ¶
func (j *JobService) Once(once *request.ReqJobOnce) (err error)
func (*JobService) Search ¶
func (j *JobService) Search(s *request.ReqJobSearch) ([]models.Job, int64, error)
func (*JobService) SearchJobLog ¶
func (j *JobService) SearchJobLog(s *request.ReqJobLogSearch) ([]models.JobLog, int64, error)
type NodeWatcherService ¶
type NodeWatcherService struct {
// contains filtered or unexported fields
}
var DefaultNodeWatcher *NodeWatcherService
func NewNodeWatcherService ¶
func NewNodeWatcherService() *NodeWatcherService
func (*NodeWatcherService) Close ¶
func (n *NodeWatcherService) Close() error
func (*NodeWatcherService) FailOver ¶
func (n *NodeWatcherService) FailOver(nodeUUID string) (success Result, fail Result, err error)
func (*NodeWatcherService) GetJobCount ¶
func (n *NodeWatcherService) GetJobCount(nodeUUID string) (int, error)
func (*NodeWatcherService) GetJobs ¶
func (n *NodeWatcherService) GetJobs(nodeUUID string) (jobs []models.Job, err error)
get all the job under a node
func (*NodeWatcherService) GetNodeCount ¶
func (n *NodeWatcherService) GetNodeCount(status int) (int64, error)
func (*NodeWatcherService) GetUUID ¶
func (n *NodeWatcherService) GetUUID(key string) string
func (*NodeWatcherService) List2Array ¶
func (n *NodeWatcherService) List2Array() []string
func (*NodeWatcherService) Search ¶
func (n *NodeWatcherService) Search(s *request.ReqNodeSearch) ([]models.Node, int64, error)
func (*NodeWatcherService) Watch ¶
func (n *NodeWatcherService) Watch() error
type ScriptService ¶
type ScriptService struct { }
func (*ScriptService) Search ¶
func (script *ScriptService) Search(s *request.ReqScriptSearch) ([]models.Script, int64, error)
type UserService ¶
type UserService struct { }
func (*UserService) ChangePassword ¶
func (us *UserService) ChangePassword(userId int, oldPassword, newPassword string) error
func (*UserService) FindByUserName ¶
func (us *UserService) FindByUserName(username string) (u *models.User, err error)
func (*UserService) Login ¶
func (us *UserService) Login(username, password string) (u *models.User, err error)
func (*UserService) Search ¶
func (us *UserService) Search(s *request.ReqUserSearch) ([]models.User, int64, error)
Click to show internal directories.
Click to hide internal directories.