server

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	DB  db.Datastore
	Sch scheduler.Scheduler
}

Server carries context for the http handlers to work from. it keeps track of the current server's database connection pool and scheduler.

func (*Server) CampaignDescribeHandler added in v0.1.2

func (s *Server) CampaignDescribeHandler(w http.ResponseWriter, r *http.Request)

CampaignDescribeHandler takes a user-defined DB query with the campaignID, then returns the parameters of that campaign via JSON

func (*Server) CampaignHandler

func (s *Server) CampaignHandler(w http.ResponseWriter, r *http.Request)

CampaignHandler receives data from the user about the desired campaign configuration. it then inserts the associated metadata into the db and schedules the campaign.

func (*Server) CampaignListHandler added in v0.1.2

func (s *Server) CampaignListHandler(w http.ResponseWriter, r *http.Request)

CampaignListHandler accepts no parameters and returns the list of active campaigns via JSON

func (*Server) HealthzHandler

func (s *Server) HealthzHandler(w http.ResponseWriter, r *http.Request)

HealthzHandler is for k8s health checking, this always returns 200

func (*Server) ResultsHandler

func (s *Server) ResultsHandler(w http.ResponseWriter, r *http.Request)

ResultsHandler takes a user defined database query (returned fields + filter) and applies it, returning the results in JSON

func (*Server) StatusUpdateHandler added in v0.1.4

func (s *Server) StatusUpdateHandler(w http.ResponseWriter, r *http.Request)

StatusUpdateHandler takes a campaignID from the user, then sets its status based on the post body content.

Jump to

Keyboard shortcuts

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