policy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package policy implements server-side relay authorization policy.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTarget indicates a noncanonical, missing, or zero-port UDP target.
	ErrInvalidTarget = errors.New("invalid UDP target")
	// ErrEmptyTargetSet indicates a server policy that permits no explicit targets.
	ErrEmptyTargetSet = errors.New("empty target allowlist")
)

Functions

This section is empty.

Types

type TargetSet

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

TargetSet is an immutable exact-match logical target allowlist.

func NewTargetSet

func NewTargetSet(targets []target.Endpoint) (TargetSet, error)

NewTargetSet validates and copies an exact target allowlist.

func (TargetSet) Allows

func (s TargetSet) Allows(endpoint target.Endpoint) bool

Allows reports whether target is an exact member of the allowlist.

func (TargetSet) Len

func (s TargetSet) Len() int

Len returns the number of distinct allowed targets.

Jump to

Keyboard shortcuts

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