Documentation ¶
Index ¶
- type Service
- func (s *Service) AgentAdd(uid string, info *types.AgentBasic) (*types.Agent, error)
- func (s *Service) AgentAvailable(aid string)
- func (s *Service) AgentDelete(aid string) error
- func (s *Service) AgentOffline(aid string)
- func (s *Service) AgentOnline(aid, uid, ip string)
- func (s *Service) AgentSecret(aid string) (string, error)
- func (s *Service) AgentSecretReset(aid string) (string, error)
- func (s *Service) AgentUnavailable(aid string)
- func (s *Service) AuthValidator(key string, c echo.Context) (bool, error)
- func (s *Service) DelayedJobAdd(aid, uid string, job *types.DelayedJobInput) error
- func (s *Service) DelayedJobCheck()
- func (s *Service) FindAgent(aid string) (*types.Agent, error)
- func (s *Service) FindUserAgentByName(uid, name string) (id string, ok bool, err error)
- func (s *Service) IsAgentOnline(aid string) bool
- func (s *Service) Job(id string) (*types.Job, error)
- func (s *Service) JobAdd(uid, text, source, callback string) error
- func (s *Service) JobCancel(id string)
- func (s *Service) JobExpire(id string)
- func (s *Service) JobFail(id string, result string) error
- func (s *Service) JobPop(aid string) *types.JobBasic
- func (s *Service) JobPush(input *types.JobInput) error
- func (s *Service) JobRunning(id string, message string) error
- func (s *Service) JobSucceed(id string, result string) error
- func (s *Service) UserAgents(uid string) ([]*types.Agent, error)
- func (s *Service) UserSetting(uid string) (*types.UserSetting, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(kv *redis.Client, db *gorm.DB, rest *resty.Client, log *zap.SugaredLogger) *Service
New create a job service instance
func (*Service) AgentAvailable ¶ added in v1.2.5
func (*Service) AgentDelete ¶
func (*Service) AgentOffline ¶
AgentOffline will call after the watcher found agent status switch to offline
func (*Service) AgentOnline ¶
AgentOnline will call after every agent job pull
func (*Service) AgentUnavailable ¶ added in v1.2.5
func (*Service) AuthValidator ¶
func (*Service) DelayedJobAdd ¶ added in v1.2.0
func (s *Service) DelayedJobAdd(aid, uid string, job *types.DelayedJobInput) error
func (*Service) DelayedJobCheck ¶ added in v1.2.0
func (s *Service) DelayedJobCheck()
DelayedJobCheck find jobs need to run, put the to cloud
func (*Service) FindUserAgentByName ¶
func (*Service) IsAgentOnline ¶
func (*Service) JobAdd ¶ added in v0.8.2
JobAdd is different from JobPush, text contain agent name as first field.
func (*Service) JobPop ¶
JobPop call by agent, so will not return errors, notify the error to admin.
func (*Service) JobRunning ¶ added in v0.6.0
func (*Service) UserAgents ¶
UserAgents return user's all agent
func (*Service) UserSetting ¶ added in v1.2.4
func (s *Service) UserSetting(uid string) (*types.UserSetting, error)
Click to show internal directories.
Click to hide internal directories.