web

package
v0.0.0-...-934cb64 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr            string
	ShutdownTimeout time.Duration
}

type Pages

type Pages struct {
	HomePage       *template.Template
	DeprecatedPage *template.Template
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	cfg Config,
	m *metrics.Metrics,
	data *scraper.Data,
	fs embed.FS,
	log logrus.FieldLogger,
) (*Server, error)

func (*Server) APIRequest

func (s *Server) APIRequest(next http.Handler) http.Handler

func (*Server) HTTPError

func (s *Server) HTTPError(w io.Writer, errString string) error

func (*Server) LogRequest

func (s *Server) LogRequest(next http.Handler) http.Handler

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Start

func (s *Server) Start() error

nolint

func (*Server) WriteJSONResponse

func (s *Server) WriteJSONResponse(w http.ResponseWriter, jsonResponse interface{})

Jump to

Keyboard shortcuts

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