server

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package server contains the HTTP authorization server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.5.1

func New(
	address string,
	engine *rules.Engine,
	resolver *ipinfo.Resolver,
	collector RequestCollector,
	metricsHandler http.Handler,
) *http.Server

New creates a new HTTP server that listens on the given address.

Types

type RequestCollector added in v0.5.2

type RequestCollector interface {
	RecordRequest(
		status string,
		country string,
		method string,
		duration time.Duration,
		ruleIndex int,
		action string,
		isDefaultPolicy bool,
	)
	RecordInvalidRequest(duration time.Duration)
}

RequestCollector collects metrics for HTTP requests.

Jump to

Keyboard shortcuts

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