policy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainMapper

type DomainMapper interface {
	DomainOf(addr uint64) string
}

DomainMapper returns domain metadata for an address.

type FlowController

type FlowController interface {
	Check(packet *core.Packet, sourceID int, targetID int) error
}

FlowController validates whether a packet can be sent.

type Manager

type Manager interface {
	ResolveRoute(packet *core.Packet, sourceID int, defaultTarget int) (int, error)
	CheckFlowControl(packet *core.Packet, sourceID int, targetID int) error
	DomainOf(addr uint64) string
}

Manager coordinates routing, flow control, and domain lookups.

func NewDefaultManager

func NewDefaultManager() Manager

NewDefaultManager creates a manager with permissive defaults.

func WithDomainMapper

func WithDomainMapper(m Manager, dm DomainMapper) Manager

WithDomainMapper returns a copy using the provided domain mapper.

func WithFlowController

func WithFlowController(m Manager, fc FlowController) Manager

WithFlowController returns a copy using the provided flow controller.

func WithRouter

func WithRouter(m Manager, r Router) Manager

WithRouter returns a copy of the manager using the provided router.

type Router

type Router interface {
	ResolveRoute(packet *core.Packet, sourceID int, defaultTarget int) (int, error)
}

Router decides next-hop targets.

Jump to

Keyboard shortcuts

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