Documentation ¶
Index ¶
- type Controller
- type JobInfo
- type Params
- type Record
- type RunScriptParams
- type Script
- type Service
- func (s *Service) AddScript(script *Script) error
- func (s *Service) BatchDeleteScript(ids []uuid.UUID) error
- func (s *Service) DeleteScript(script *Script) error
- func (s *Service) DetailScript(id uuid.UUID) (*Script, error)
- func (s *Service) GetJobLog(id uuid.UUID) (map[string][]string, error)
- func (s *Service) GetScriptFile(id uuid.UUID) (string, error)
- func (s *Service) Initialize() error
- func (s *Service) PageRecord(num, size int, record *Record) (*database.Pager[*Record], error)
- func (s *Service) PageScript(num, size int, script *Script) (*database.Pager[*Script], error)
- func (s *Service) RunScriptOnHosts(rsp *RunScriptParams) error
- func (s *Service) StopScript(id uuid.UUID) error
- func (s *Service) UpdateScript(script *Script) error
- type Task
- type TaskParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) RegisterRoute ¶
func (c *Controller) RegisterRoute(group *gin.RouterGroup)
type Record ¶ added in v0.0.7
type Record struct { ID uuid.UUID `json:"id" gorm:"primary_key;type:uuid;" swaggerignore:"true"` ScriptTitle string `json:"scriptTitle"` Script string `json:"script"` Hosts string `json:"hosts"` Params string `json:"params"` Result string `json:"result"` Status string `json:"status"` Message string `json:"message"` Error string `json:"error"` database.BaseModel }
type RunScriptParams ¶ added in v0.0.7
type Script ¶
type Script struct { ID uuid.UUID `json:"id" gorm:"primary_key;type:uuid;" swaggerignore:"true"` Title string `json:"title" gorm:"not null" validate:"required"` Desc string `json:"desc"` Content string `json:"content" gorm:"not null" validate:"required"` Type string `json:"type" validate:"oneof=shell python"` database.BaseModel }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
func GetService() *Service
func (*Service) DeleteScript ¶
func (*Service) GetScriptFile ¶ added in v0.0.7
func (*Service) Initialize ¶
func (*Service) PageRecord ¶ added in v0.0.7
func (*Service) PageScript ¶
func (*Service) RunScriptOnHosts ¶ added in v0.0.7
func (s *Service) RunScriptOnHosts(rsp *RunScriptParams) error
func (*Service) UpdateScript ¶
Click to show internal directories.
Click to hide internal directories.