v2

package
v0.0.0-...-c84f994 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package v2 implements version 2 of the public API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteError

func WriteError(w http.ResponseWriter, status int, err error)

WriteError is a utility function for logging a request error and writing a response all in one.

func WriteErrors

func WriteErrors(w http.ResponseWriter, status int, errs []error)

WriteErrors does the same but for groups of errors

Types

type V2

type V2 struct {
	Storage *storage.Manager
	Scraper *scraper.Scraper
	Config  types.Config
}

V2 represents an API endpoint handler

func Init

func Init(Storage *storage.Manager, Scraper *scraper.Scraper, Config types.Config) *V2

Init initialises and returns a handler group

func (*V2) Routes

func (v *V2) Routes() []types.Route

Routes returns the version routes nolint:lll

func (*V2) Version

func (v *V2) Version() string

Version returns the route group version name

Jump to

Keyboard shortcuts

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