Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Success task end success Success = iota // Failed task failed Failed // Expired task not performed within epsilon time frame Expired )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { GUID string `json:"guid"` UserID string `json:"user_id"` At int64 `json:"at"` Epsilon int64 `json:"epsilon"` URN string `json:"URN"` Payload map[string]interface{} `json:"payload"` }
Job is a task execution.
func (*Job) FromKafka ¶
func (j *Job) FromKafka(msg *sarama.ConsumerMessage) error
FromKafka unserialize a Job from Kafka.
func (*Job) ToKafka ¶
func (j *Job) ToKafka() *sarama.ProducerMessage
ToKafka serialize a Job to Kafka.
type State ¶
type State struct { ID string `json:"id"` TaskGUID string `json:"taskGUID"` UserID string `json:"userID"` At int64 `json:"at"` DoneAt int64 `json:"doneAt"` Duration int64 `json:"duration"` URN string `json:"URN"` State int64 `json:"state"` }
State is a state of a task execution.
func (*State) FromKafka ¶
func (s *State) FromKafka(msg *sarama.ConsumerMessage) error
FromKafka unserialize a State from Kafka.
func (*State) ToKafka ¶
func (s *State) ToKafka() *sarama.ProducerMessage
ToKafka serialize a State to Kafka.
type Task ¶
type Task struct { GUID string `json:"guid" sql:"guid,pk"` ID string `json:"id" sql:"id"` UserID string `json:"user_id"` Name string `json:"name"` Schedule string `json:"schedule"` URN string `json:"URN"` Payload map[string]interface{} `json:"payload" sql:",notnull"` CreatedAt time.Time `json:"created_at"` }
Task holds task attributes.
func (*Task) FromKafka ¶
func (t *Task) FromKafka(msg *sarama.ConsumerMessage) error
FromKafka unserialize a Task from Kafka.
func (*Task) ToKafka ¶
func (t *Task) ToKafka() *sarama.ProducerMessage
ToKafka serialize a Task to Kafka.
Click to show internal directories.
Click to hide internal directories.