horizon

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package horizon provides the implementation for Penne Horizons

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHorizons

func MakeHorizons(conf []Config,
	_ map[string]resolver.Exchanger) ([]string, map[string]*Horizon, error)

MakeHorizons builds Horizons from a Config slice

func NewContextKey

func NewContextKey(name string) *core.ContextKey[horizon.Match]

NewContextKey returns a core.ContextKey to be used to store the horizon.Match in horizon.Horizons

Types

type Config

type Config struct {
	Name string `yaml:"name"`
	Next string `yaml:"next,omitempty" toml:",omitempty" json:",omitempty"`

	AllowForwarding bool `yaml:"allow_forwarding,omitempty" toml:",omitempty" json:",omitempty"`

	Networks []netip.Prefix `yaml:"networks,omitempty" toml:",omitempty" json:",omitempty"`
	Resolver string         `yaml:"resolver,omitempty" toml:",omitempty" json:",omitempty"`
}

Config describes a Horizon

type Error

type Error struct {
	Horizon string
	Reason  string
	Err     error
}

Error is an error that references the name of a Horizon

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type Horizon

type Horizon struct {
	resolver.Exchanger
}

A Horizon is a resolver.Exchanger for a particular set of networks

Jump to

Keyboard shortcuts

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