scion

package module
v0.0.0-...-fd1ea41 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

README

scion-caddy

Repository for the SCION IETF 118 hackathon

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct{}

func (Middleware) CaddyModule

func (Middleware) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (Middleware) ServeHTTP

ServeHTTP implements caddyhttp.MiddlewareHandler.

type Network

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

Network is a custom network that allows to listen on SCION addresses.

func (*Network) Listen

func (n *Network) Listen(
	ctx context.Context,
	network string,
	address string,
	cfg net.ListenConfig,
) (any, error)

Listen returns a net.PacketConn that listens on the given address. It is used by caddyhttp to create a HTTP3 listener.

func (*Network) ListenBlocked

func (n *Network) ListenBlocked(
	ctx context.Context,
	network string,
	address string,
	cfg net.ListenConfig,
) (any, error)

ListenBlocked returns a blocked net.Listener that will never accept a connection. It is used to fake a net.Listener for caddyhttp HTTP1.1 and HTTP2. It is required such that we can create a HTTP3 listener.

func (*Network) Logger

func (n *Network) Logger() *zap.Logger

Logger gets the logger.

func (*Network) SetLogger

func (n *Network) SetLogger(logger *zap.Logger)

SetLogger sets the logger for the network. It is safe to access concurrently.

type SCION

type SCION struct {
	Network *Network
}

SCION implements a caddy module. Currently, it is used to initialize the logger for the global network. In the future, additional configuration can be parsed with this component.

func (SCION) CaddyModule

func (SCION) CaddyModule() caddy.ModuleInfo

func (*SCION) Provision

func (s *SCION) Provision(ctx caddy.Context) error

type UsagePool

type UsagePool[K comparable, V any] struct {
	// contains filtered or unexported fields
}

UsagePool is a type safe caddy.UsagePool

func NewUsagePool

func NewUsagePool[K comparable, V any]() *UsagePool[K, V]

func (*UsagePool[K, T]) Delete

func (p *UsagePool[K, T]) Delete(key K) (bool, error)

func (*UsagePool[K, V]) LoadOrNew

func (p *UsagePool[K, V]) LoadOrNew(key K, construct caddy.Constructor) (V, bool, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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