Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(ctx *TaskerContext, th TaskerHandler) http.HandlerFunc
func TasksHandler ¶
func TasksHandler(c *TaskerContext, w http.ResponseWriter, r *http.Request) (interface{}, int, error)
TasksHandler handles management of tasks.
Types ¶
type ErrResponse ¶
type ErrResponse struct {
Message string `json:"message"`
}
type Task ¶
type Task struct { ID int64 `json:"id"` Name string `json:"name"` Action string `json:"action"` ScheduledTime string `json:"time"` Created time.Time `json:"created"` }
Task encapsulates a named, scheduled task action.
func CreateTask ¶
CreateTask simply creates a task with provided parmaters and generates a psuedo random number.
type TaskerContext ¶
type TaskerContext struct {
Tasks *TaskStore
}
type TaskerHandler ¶
type TaskerHandler func(*TaskerContext, http.ResponseWriter, *http.Request) (interface{}, int, error)
Click to show internal directories.
Click to hide internal directories.