gateway

package
v0.0.0-...-36fcf6a Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 13 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 {
	// 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

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown closes the http server

func (*Server) Start

func (s *Server) Start(ctx context.Context, listenPort int) error

Start opens the http port and handles the requests

Jump to

Keyboard shortcuts

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