router

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package router implements http long-season server with routing logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(config models.Config, args Args) http.Handler

NewRouter returns Handler, which contains all the handlers and routing logic for long-season http server.

Types

type Args

type Args struct {
	Opener         handlers.Opener
	Users          storage.Users
	Devices        storage.Devices
	StatusTx       storage.StatusTx
	TwoFactor      storage.TwoFactor
	OnlineUsers    storage.OnlineUsers
	UserAdapter    storage.UserAdapter
	MacsChan       chan<- []net.HardwareAddr
	PublicCors     Cors
	Adapter        *happier.Adapter
	SessionRenewer session.Renewer
	SessionSaver   session.Saver
	SessionKiller  session.Killer
}

Args contains dependencies for router.

type Cors

type Cors interface {
	// Handler is a middleware that applies CORS settings
	// to given handler.
	Handler(http.Handler) http.Handler
}

Cors interface contains Handler for setting up CORS.

Jump to

Keyboard shortcuts

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