Documentation ¶
Index ¶
- Variables
- func AcceptTaskHandler(c *gin.Context)
- func AddJob(db *sqlx.DB, jd JobData, s *sched.Scheduler) (string, error)
- func AddJobHandler(c *gin.Context)
- func CollectorsHandler(c *gin.Context)
- func DeleteJob(jobID string, db *sqlx.DB, s *sched.Scheduler) error
- func DeleteJobHandler(c *gin.Context)
- func DoneTaskHandler(c *gin.Context)
- func GetTaskHandler(c *gin.Context)
- func GetTasksForUser(uID string, since string, db *sqlx.DB) ([]sched.TaskData, error)
- func ListJobsHandler(c *gin.Context)
- func ListTasksHandler(c *gin.Context)
- func PsiphonConfigHandler(c *gin.Context)
- func RejectTaskHandler(c *gin.Context)
- func TestHelpersHandler(c *gin.Context)
- func TorTargetsHandler(c *gin.Context)
- func URLsHandler(c *gin.Context)
- type CollectorInfo
- type DomainFrontedCollector
- type JobData
- type Target
- type TestHelperInfo
- type URLInfo
- type URLTestArg
- type URLsQuery
Constants ¶
This section is empty.
Variables ¶
var ErrJobNotFound = errors.New("job not found")
ErrJobNotFound did not found the job in the DB
Functions ¶
func AcceptTaskHandler ¶
AcceptTaskHandler mark a task as accepted
func CollectorsHandler ¶
CollectorsHandler returns the list of requested collectors
func DoneTaskHandler ¶
DoneTaskHandler mark a certain task as done
func GetTasksForUser ¶
GetTasksForUser lists all the tasks a user has
func ListJobsHandler ¶
ListJobsHandler lists the jobs in the database
func ListTasksHandler ¶
ListTasksHandler lists all the tasks for a user
func PsiphonConfigHandler ¶ added in v0.3.1
PsiphonConfigHandler returns the psiphon configuration.
func RejectTaskHandler ¶
RejectTaskHandler reject a certain task
func TestHelpersHandler ¶
TestHelpersHandler returns the list of requested test helpers
func TorTargetsHandler ¶ added in v0.3.2
TorTargetsHandler returns the targets for the tor nettest.
Types ¶
type CollectorInfo ¶
CollectorInfo holds the type and address of a collector
func GetCollectors ¶
func GetCollectors(types string, db *sqlx.DB) ([]CollectorInfo, error)
GetCollectors returns the list of collectors available
type DomainFrontedCollector ¶
DomainFrontedCollector is a {"domain": "a", "front": "b"} map
type JobData ¶
type JobData struct { ID string `json:"id"` Schedule string `json:"schedule" binding:"required"` Delay int64 `json:"delay"` Comment string `json:"comment" binding:"required"` TaskData *sched.TaskData `json:"task"` AlertData *sched.AlertData `json:"alert"` Target Target `json:"target"` State string `json:"state"` CreationTime time.Time `json:"creation_time"` }
JobData struct for containing all Job metadata (both alert and tasks)
type TestHelperInfo ¶
type TestHelperInfo struct { Name string `json:"name"` Type string `json:"type"` Address string `json:"address"` }
TestHelperInfo holds the name, type and address of a test helper
func GetTestHelpers ¶
func GetTestHelpers(names string, db *sqlx.DB) ([]TestHelperInfo, error)
GetTestHelpers returns a list of test helpers
type URLInfo ¶
type URLInfo struct { CategoryCode string `json:"category_code"` URL string `json:"url"` CountryCode string `json:"country_code"` }
URLInfo holds the name, type and address of a test helper
type URLTestArg ¶
type URLTestArg struct { GlobalCategories []string `json:"global_categories"` CountryCategories []string `json:"country_categories"` URLs []string `json:"urls"` }
URLTestArg are the URL arguments for the test