types

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package types defines common types used across the proxy package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialTimeoutFromContext added in v0.67.0

func DialTimeoutFromContext(ctx context.Context) (time.Duration, bool)

DialTimeoutFromContext returns the dial timeout from the context, if set.

func IsOverlayOrigin added in v0.72.0

func IsOverlayOrigin(ctx context.Context) bool

IsOverlayOrigin reports whether the request reached the proxy via the overlay listener. Middlewares that only make sense for WAN traffic (geolocation, CrowdSec IP reputation) should short-circuit when this is true.

func WithDialTimeout added in v0.67.0

func WithDialTimeout(ctx context.Context, d time.Duration) context.Context

WithDialTimeout returns a context carrying a dial timeout that DialContext wrappers can use to scope the timeout to just the connection establishment phase.

func WithOverlayOrigin added in v0.72.0

func WithOverlayOrigin(ctx context.Context) context.Context

WithOverlayOrigin marks the context as originating from the embedded NetBird overlay (tunnel-side inbound listener).

Types

type AccountID

type AccountID string

AccountID represents a unique identifier for a NetBird account.

type DialContextFunc added in v0.67.0

type DialContextFunc func(ctx context.Context, network, address string) (net.Conn, error)

DialContextFunc dials a backend through the WireGuard tunnel.

type RelayDirection added in v0.67.0

type RelayDirection string

RelayDirection indicates the direction of a relayed packet.

const (
	RelayDirectionClientToBackend RelayDirection = "client_to_backend"
	RelayDirectionBackendToClient RelayDirection = "backend_to_client"
)

type ServiceID added in v0.67.0

type ServiceID string

ServiceID represents a unique identifier for a proxy service.

type ServiceMode added in v0.67.0

type ServiceMode string

ServiceMode describes how a reverse proxy service is exposed.

const (
	ServiceModeHTTP ServiceMode = "http"
	ServiceModeTCP  ServiceMode = "tcp"
	ServiceModeUDP  ServiceMode = "udp"
	ServiceModeTLS  ServiceMode = "tls"
)

func (ServiceMode) IsL4 added in v0.67.0

func (m ServiceMode) IsL4() bool

IsL4 returns true for TCP, UDP, and TLS modes.

Jump to

Keyboard shortcuts

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