Documentation ¶
Index ¶
- Variables
- func CreateRequest(method string, url string, body io.Reader) (*http.Request, *http.Client)
- func Templater(str string, data interface{}) string
- func Timerless(task string) bool
- type CleanTask
- type Hash
- type Redis
- type Result
- func Counter(args *TaskArgs) Result
- func DNS(args *TaskArgs) Result
- func DNSCIDR(args *TaskArgs) Result
- func FakeFeed(args *TaskArgs) Result
- func FakePing(args *TaskArgs) Result
- func FakePort(args *TaskArgs) Result
- func Feed(args *TaskArgs) Result
- func HTTP(args *TaskArgs) Result
- func HTTPJSON(args *TaskArgs) Result
- func HTTPREGEXP(args *TaskArgs) Result
- func HTTPStatus(args *TaskArgs) Result
- func Media(args *TaskArgs) Result
- func NewResult(task Task) Result
- func Ping(args *TaskArgs) Result
- func Port(args *TaskArgs) Result
- func RedisCounter(args *TaskArgs) Result
- type Spark
- type Task
- type TaskArgs
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Project is set at compile time, used for User-Agent in HTTP requests Project = "GoDash" // Version is set at compile time, used for User-Agent in HTTP requests Version = "0.0.0-beta.0" // TaskMapping is used to map different versions of a task to a table section // within the GoDash UI TaskMapping = map[string][]string{} // TaskRunners defines the different types of tasks for the task runner TaskRunners = map[string]Type{ "port": {Port, "port", false}, "fakeport": {FakePort, "port", false}, "ping": {Ping, "ping", false}, "http": {HTTP, "http", false}, "http-json": {HTTPJSON, "http", false}, "http-status": {HTTPStatus, "http", false}, "http-regex": {HTTPREGEXP, "http", false}, "http-regexp": {HTTPREGEXP, "http", false}, "fakeping": {FakePing, "ping", false}, "media": {Media, "media", false}, "iframe": {Media, "media", false}, "feed": {Feed, "feed", false}, "fakefeed": {FakeFeed, "feed", false}, "dns": {DNS, "dns", false}, "dns-cidr": {DNSCIDR, "dns", false}, "counter": {Counter, "counter", true}, "redis-counter": {RedisCounter, "counter", true}, } )
Functions ¶
func CreateRequest ¶
CreateRequest generates HTTP requests for tasks
Types ¶
type CleanTask ¶
type CleanTask struct { Label string `json:"label"` Interval string `json:"interval"` Task string `json:"task"` ID string `json:"id"` Date int64 `json:"date"` Location string `json:"location,omitempty"` Once bool `json:"once,omitempty"` Spark *Spark `json:"spark,omitempty"` Warn bool `json:"warn,omitempty"` Last interface{} `json:"last,omitempty"` Cancelled bool `json:"cancelled,omitempty"` Params map[string]interface{} `json:"-"` CTX context.Context `json:"-"` Cancel func() bool `json:"-"` }
CleanTask is for JSON marshaling, removing hidden params
type Hash ¶
type Hash struct { Label string `json:"label"` Interval string `json:"interval"` Task string `json:"task"` ID string `json:"id,omitempty"` Once bool `json:"once,omitempty"` Machine string `json:"machine,omitempty"` }
Hash is used to create task hashes for task IDs
type Result ¶
type Result struct { Task string `json:"task"` Label string `json:"label"` ID string `json:"id"` Date int64 `json:"date"` Notification string `json:"notification,omitempty"` Location string `json:"location,omitempty"` Spark *Spark `json:"spark,omitempty"` Warn bool `json:"warn,omitempty"` Update interface{} `json:"update,omitempty"` Error error `json:"error"` ErrorString string `json:"errormsg,omitempty"` Event string `json:"event,omitempty"` Cancelled bool `json:"-"` }
Result is the results from a task execution
func HTTPStatus ¶
HTTPStatus gets the status code from a web server
func RedisCounter ¶
RedisCounter uses Radis for tracking counts
type Spark ¶
type Spark struct { Value interface{} `json:"value,omitempty"` Warn bool `json:"warn,omitempty"` }
Spark is a sparkline number and warn flag for the UI
type Task ¶
type Task struct { Label string `json:"label"` Interval string `json:"interval"` Task string `json:"task"` ID string `json:"id"` Date int64 `json:"date"` Location string `json:"location,omitempty"` Once bool `json:"once,omitempty"` Spark *Spark `json:"spark"` Warn bool `json:"warn,omitempty"` Last interface{} `json:"last,omitempty"` Cancelled bool `json:"cancelled,omitempty"` Params map[string]interface{} `json:"params,omitempty"` CTX context.Context `json:"-"` Cancel func() bool `json:"-"` }
Task defines each job passed to the task runner
Source Files ¶
Click to show internal directories.
Click to hide internal directories.