server

package
v0.0.0-...-71953a4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 9 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 {
	Middleware      *negroni.Negroni
	ScheduleCreator schedules.ScheduleCreator
	AutoCompleter   schedules.AutoCompleter
}

Server runs the backend server.

func NewServer

func NewServer() Server

NewServer constructs a Server to listen on the given port.

func (*Server) AutocompleteHandler

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

AutocompleteHandler handles the autocomplete endpoint

func (*Server) Run

func (s *Server) Run()

Run starts the server on $PORT or 8080 by default.

func (*Server) SchedulesHandler

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

SchedulesHandler handles the schedule endpoint

type StandardResponse

type StandardResponse struct {
	OK     bool        `json:"OK"`
	Status int         `json:"status"`
	Body   interface{} `json:"body"`
}

StandardResponse is the default response from the server.

Jump to

Keyboard shortcuts

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