server

package
v1.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxBytesReaderMiddleware

func MaxBytesReaderMiddleware(maxSize int64) func(h http.Handler) http.Handler

Types

type AppHandler

type AppHandler func(http.ResponseWriter, *http.Request) error

AppHandler adds generic error handling to a handler func.

A catch all error response writer handler for convinience.

A handler func that writes it's own error response should typically not return an error.

func (AppHandler) ServeHTTP

func (fn AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server

type Server struct {
	MonClients  *mon.Clients
	NmapEnabled bool
	OUILookup   func(s string) (string, error)
}

Server contains the web page and JSON API routes.

func (*Server) Clients

func (s *Server) Clients() AppHandler

Clients serves the list of clients web page.

func (*Server) Conntrack

func (s *Server) Conntrack() AppHandler

Clients serves the connection tracking web page.

func (*Server) NmapV0

func (s *Server) NmapV0() AppHandler

NmapV0 runs a predefined nmap qiery against a single IP address.

func (*Server) Routes

func (s *Server) Routes() *http.ServeMux

Routes returns a *http.ServeMux with all the application request handlers.

func (*Server) StatsV1

func (s *Server) StatsV1() AppHandler

StatsV1 is an API resource that returns a JSON encoded respons with the current list of identified network devices and their current bandwidth rate.

Jump to

Keyboard shortcuts

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