Documentation
¶
Index ¶
- type Config
- type CreateJobRequest
- type JobData
- type Option
- type Server
- func (s *Server) CreateJob(w http.ResponseWriter, r *http.Request)
- func (s *Server) DeleteJob(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetConfig(w http.ResponseWriter, _ *http.Request)
- func (s *Server) GetJob(w http.ResponseWriter, r *http.Request)
- func (s *Server) GetJobs(w http.ResponseWriter, _ *http.Request)
- func (s *Server) HandleWebSocket(w http.ResponseWriter, r *http.Request)
- func (s *Server) RunJob(w http.ResponseWriter, r *http.Request)
- func (s *Server) StartScheduler(w http.ResponseWriter, _ *http.Request)
- func (s *Server) StopScheduler(w http.ResponseWriter, _ *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Title string `json:"title"`
}
Config is the server configuration in which user can set the title of the UI
type CreateJobRequest ¶
type CreateJobRequest struct {
Name string `json:"name"`
Type string `json:"type"` // duration, cron, daily, weekly, monthly
Interval int64 `json:"interval,omitempty"`
CronExpression string `json:"cronExpression,omitempty"`
AtTime string `json:"atTime,omitempty"` // Format: HH:MM:SS
Tags []string `json:"tags,omitempty"`
}
CreateJobRequest represents the request to create a new job
type JobData ¶
type JobData struct {
ID string `json:"id"`
Name string `json:"name"`
Tags []string `json:"tags"`
NextRun string `json:"nextRun"`
LastRun string `json:"lastRun"`
NextRuns []string `json:"nextRuns"`
Schedule string `json:"schedule"` // human-readable schedule description
ScheduleDetail string `json:"scheduleDetail"` // technical schedule details (cron expression, interval, etc.)
}
JobData represents the job information sent to clients
type Server ¶
type Server struct {
Scheduler gocron.Scheduler
Router http.Handler
// contains filtered or unexported fields
}
Server is the main server struct which contains the scheduler, router, webSocket clients, webSocket mutex, upgrader, and config
func (*Server) CreateJob ¶
func (s *Server) CreateJob(w http.ResponseWriter, r *http.Request)
CreateJob creates a new job
func (*Server) DeleteJob ¶
func (s *Server) DeleteJob(w http.ResponseWriter, r *http.Request)
DeleteJob deletes a job
func (*Server) GetConfig ¶
func (s *Server) GetConfig(w http.ResponseWriter, _ *http.Request)
GetConfig gets server configuration
func (*Server) GetJob ¶
func (s *Server) GetJob(w http.ResponseWriter, r *http.Request)
GetJob gets a single job
func (*Server) GetJobs ¶
func (s *Server) GetJobs(w http.ResponseWriter, _ *http.Request)
GetJobs gets all jobs
func (*Server) HandleWebSocket ¶
func (s *Server) HandleWebSocket(w http.ResponseWriter, r *http.Request)
HandleWebSocket is a webSocket handler
func (*Server) RunJob ¶
func (s *Server) RunJob(w http.ResponseWriter, r *http.Request)
RunJob runs a job immediately
func (*Server) StartScheduler ¶
func (s *Server) StartScheduler(w http.ResponseWriter, _ *http.Request)
StartScheduler starts the scheduler
func (*Server) StopScheduler ¶
func (s *Server) StopScheduler(w http.ResponseWriter, _ *http.Request)
StopScheduler stops the scheduler
Click to show internal directories.
Click to hide internal directories.