admission

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 1 Imported by: 2 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package admission defines the Admission interface for connection admission control, determining whether to allow or deny incoming connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admission

type Admission interface {
	// Admit reports whether the connection to the given network address is allowed.
	// It returns true if the connection is permitted.
	Admit(ctx context.Context, network, addr string, opts ...Option) bool
}

Admission is the admission control interface. It decides whether a connection to the given address should be allowed or denied. Common implementations include IP whitelist/blacklist and domain-based rules.

type Option

type Option func(opts *Options)

Option is a functional option for configuring Options.

func WithNetwork added in v0.6.1

func WithNetwork(network string) Option

WithNetwork sets the network type.

func WithService added in v0.6.1

func WithService(service string) Option

WithService sets the service name.

type Options

type Options struct {
	// Service is the service name this admission rule belongs to.
	Service string
	// Network is the connection network type, e.g. "tcp", "udp".
	Network string
}

Options holds the initialization parameters for an Admission.

Jump to

Keyboard shortcuts

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