router

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package router declares every HTTP route and its access level in one place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(h Handlers, g Guards) *http.ServeMux

New returns the mux with all routes.

Types

type AuthHandlers

type AuthHandlers struct {
	Login, Logout, Me, Setup                   http.HandlerFunc
	Users, AddUser, DeleteUser, SetPassword    http.HandlerFunc
	Tokens, CreateToken, RevokeToken, AuditLog http.HandlerFunc
}

AuthHandlers serve sessions, setup, users, tokens and the audit log.

type ConfigHandlers

type ConfigHandlers struct {
	Overview, Settings, PutSettings, Export   http.HandlerFunc
	Object, PutObject, DeleteObject, Profiles http.HandlerFunc
	PutObjects, Probe                         http.HandlerFunc
}

ConfigHandlers serve the UI configuration and the profile list.

type DeviceHandlers

type DeviceHandlers struct {
	List, Get, Status, Overview http.HandlerFunc
}

DeviceHandlers serve the device endpoints.

type Guards

type Guards struct {
	Read, Admin func(http.Handler) http.Handler
}

Guards wrap a route with its access level (spec 9.1): Read for "read" endpoints (open when auth.public_read is set), Admin for "admin" endpoints.

type Handlers

type Handlers struct {
	Health  http.Handler
	Version http.Handler
	Site    http.Handler
	Energy  http.Handler
	Gauge   http.Handler
	Report  http.Handler
	Devices DeviceHandlers
	Auth    AuthHandlers
	Config  ConfigHandlers
	WS      http.Handler
	UI      http.Handler
}

Handlers are the handlers of all routes.

Jump to

Keyboard shortcuts

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