api

package
v0.0.0-...-b2a739b Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is a Berlin Strength API.

func New

func New(config *Config, reg prometheus.Registerer, gat prometheus.Gatherer) *API

New returns a new ServeMux with app routes.

func (*API) ServeHTTP

func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface.

type Config

type Config struct {
	// OAuth ID
	ClientID string
	// OAuth secret
	ClientSecret string
	// Allowed emails
	Emails []string
	// File descriptor for the RFID scanner; defaults to os.Stdin
	File *os.File
	// URL at which to listen
	URL *url.URL
}

Config represents the configuration for the Berlin Strength API.

Jump to

Keyboard shortcuts

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