Documentation ¶
Index ¶
- type Connector
- func (c *Connector) DeleteJobCollection(name string)
- func (c *Connector) GetJobCollection() ([]JobCollection, error)
- func (c *Connector) GetOneJobCollection(name string) (JobCollection, error)
- func (c *Connector) GetTasks(id primitive.ObjectID) ([]TaskCollection, error)
- func (c *Connector) InsertJobCollection(payload *JobCollection) (primitive.ObjectID, error)
- func (c *Connector) InsertTask(id primitive.ObjectID, params ...interface{}) error
- func (c *Connector) Ping() error
- func (c *Connector) UpdateJobCollection(id primitive.ObjectID, payload *JobCollection, e int)
- type JobCollection
- type TaskCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct { DB string // The MongoDB uri DBName string // Database name from MongoDB // contains filtered or unexported fields }
Connector mongodb instance
func (*Connector) DeleteJobCollection ¶
func (*Connector) GetJobCollection ¶
func (c *Connector) GetJobCollection() ([]JobCollection, error)
func (*Connector) GetOneJobCollection ¶
func (c *Connector) GetOneJobCollection(name string) (JobCollection, error)
func (*Connector) GetTasks ¶
func (c *Connector) GetTasks(id primitive.ObjectID) ([]TaskCollection, error)
func (*Connector) InsertJobCollection ¶
func (c *Connector) InsertJobCollection(payload *JobCollection) (primitive.ObjectID, error)
func (*Connector) InsertTask ¶
func (*Connector) UpdateJobCollection ¶
func (c *Connector) UpdateJobCollection(id primitive.ObjectID, payload *JobCollection, e int)
type JobCollection ¶
type JobCollection struct { ID primitive.ObjectID `bson:"_id"` JobName string `bson:"job_name"` FuncName string `bson:"func_name"` CronFormat []string `bson:"cron_format"` NextDate time.Time `bson:"next_date"` TotalTask int `bson:"total_task"` TotalRun int `bson:"total_run"` TotalError int `bson:"total_error"` SuccessRate float64 `bson:"success_rate"` ErrorRate float64 `bson:"error_rate"` }
type TaskCollection ¶
Click to show internal directories.
Click to hide internal directories.