job

package
v0.0.0-...-85596be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Title            string                 `json:"title"`
	URL              string                 `json:"url"`
	HTTPMethod       string                 `json:"httpMethod"`
	Headers          map[string]interface{} `json:"headers"`
	Frequency        int                    `json:"frequency"`
	Success          bool                   `json:"passing"`
	ExpectedResponse Response               `json:"expectedResponse"`
	RequestBody      map[string]interface{} `json:"requestBody"`
}

func (Job) HandleResponse

func (j Job) HandleResponse(res result) (datastore.Record, bool)

verify if the request got the expected result and format the data for writing to the database

func (Job) Schedule

func (j Job) Schedule(recChan chan<- datastore.Record, blocker chan struct{}, n notification.Notification)

Create a ticker for a job to trigger it periodically

type Response

type Response struct {
	StatusCode int         `json:"statusCode"`
	Body       interface{} `json:"body"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL