Documentation ¶
Index ¶
- type Server
- func (s *Server) CreateJob(rw http.ResponseWriter, req *http.Request)
- func (s *Server) DeleteJob(rw http.ResponseWriter, req *http.Request)
- func (s *Server) GetJob(rw http.ResponseWriter, req *http.Request)
- func (s *Server) GetJobs(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) Start(ctx context.Context, listenPort int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an http handler serving the puppet-master api
func NewServer ¶
func NewServer(db db, queue queue, logger *logrus.Entry, apiToken string, enableAPI, enableJobs bool) (*Server, error)
NewServer creates a new server
func (*Server) CreateJob ¶
func (s *Server) CreateJob(rw http.ResponseWriter, req *http.Request)
CreateJob stores a job in the database and starts a job worker for it
func (*Server) DeleteJob ¶
func (s *Server) DeleteJob(rw http.ResponseWriter, req *http.Request)
DeleteJob deletes a job from the database
func (*Server) GetJob ¶
func (s *Server) GetJob(rw http.ResponseWriter, req *http.Request)
GetJob reads the job from the database and returns it
func (*Server) GetJobs ¶
func (s *Server) GetJobs(rw http.ResponseWriter, req *http.Request)
GetJobs returns a paginated list of jobs
Click to show internal directories.
Click to hide internal directories.