Documentation ¶
Index ¶
Constants ¶
const ( // StatusDisabled means this item is disabled StatusDisabled Status = iota // StatusEnabled means this item is enabled StatusEnabled // StatusDisabledString means this item is disabled (used for graphql) StatusDisabledString string = "DISABLED" // StatusEnabledString means this item is enabled (used for graphql) StatusEnabledString string = "ENABLED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { // gorm base model gorm.Model // TaskID indicates the task ID associated with the Job TaskID uint // Task indicates the task associated with the Job Task Task // TaskRuleID indicates the task rule ID associated with the Job TaskRuleID uint // TaskRule indicates the task rule associated with the Job TaskRule TaskRule // Stdout stores the standard output of the Job Stdout string // Stderr stores the standard error output of the Job Stderr string // StartAt stores the start time of the Job StartAt time.Time // StopAt stores the stop time of the Job StopAt time.Time // Flags store multiple flag values to indicate Job status Flags uint64 }
Job define the data structure of a task execution
func (Job) GetCreatedAt ¶
GetCreatedAt is a function to get the field value of GraphQL Model
func (Job) GetUpdatedAt ¶
GetUpdatedAt is a function to get the field value of GraphQL Model
func (Job) IsModel ¶
func (job Job) IsModel()
IsModel is a flag field of the GraphQL Model interface
func (*Job) RemoveFlag ¶
RemoveFlag helps the caller to remove the flags from the Job record
type JobFlag ¶
type JobFlag uint64
JobFlag is a unique type of flag in Job, which is used as bitmask
type Status ¶
type Status uint8
Status indicates the current item status
func (Status) MarshalGQL ¶
MarshalGQL implements GQLGEN dependent encoding function
func (*Status) UnmarshalGQL ¶
UnmarshalGQL implements GQLGEN dependent decoding function
type Task ¶
type Task struct { // gorm base model gorm.Model // Name of task Name string // Type indicates the type of this task Type TaskType // Configuration Configuration datatypes.JSON // Rules of task Rules []TaskRule // LastRunningAt indicates the last running time of the current task LastRunningAt sql.NullTime // LastRunningTime indicates the time consumed for the last run of the current task LastRunningTime int64 // Status indicates the current task status Status Status }
Task define the data structure of a timed task
func (Task) GetCreatedAt ¶
GetCreatedAt is a function to get the field value of GraphQL Model
func (Task) GetUpdatedAt ¶
GetUpdatedAt is a function to get the field value of GraphQL Model
type TaskConfigurationShell ¶
type TaskConfigurationShell struct { Command string `json:"command"` Timeout time.Duration `json:"timeout"` }
TaskConfigurationShell define the data structure of shell task configuration
func (TaskConfigurationShell) IsTaskConfiguration ¶
func (tcs TaskConfigurationShell) IsTaskConfiguration()
IsTaskConfiguration is a flag function for task configuration
type TaskConfigurationWebhook ¶
TaskConfigurationWebhook define the data structure of webhook task configuration
func (TaskConfigurationWebhook) IsTaskConfiguration ¶
func (tcw TaskConfigurationWebhook) IsTaskConfiguration()
IsTaskConfiguration is a flag function for task configuration
type TaskRule ¶
type TaskRule struct { // gorm base model gorm.Model // TaskID indicates the task ID associated with the rule TaskID uint // Task indicates the task associated with the Job Task Task // Description of task rule Description sql.NullString // Rule of task Rule string // LastRunningAt indicates the last running time of the current task rule LastRunningAt sql.NullTime // LastRunningTime indicates the time consumed for the last run of the current task rule LastRunningTime int64 // Status indicates the current task rule status Status Status }
TaskRule define the data structure of task running rule
func (TaskRule) GetCreatedAt ¶
GetCreatedAt is a function to get the field value of GraphQL Model
func (TaskRule) GetUpdatedAt ¶
GetUpdatedAt is a function to get the field value of GraphQL Model