Documentation
¶
Overview ¶
Package types defines common types used across the proxy package.
Index ¶
- func DialTimeoutFromContext(ctx context.Context) (time.Duration, bool)
- func IsOverlayOrigin(ctx context.Context) bool
- func WithDialTimeout(ctx context.Context, d time.Duration) context.Context
- func WithOverlayOrigin(ctx context.Context) context.Context
- type AccountID
- type DialContextFunc
- type RelayDirection
- type ServiceID
- type ServiceMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialTimeoutFromContext ¶ added in v0.67.0
DialTimeoutFromContext returns the dial timeout from the context, if set.
func IsOverlayOrigin ¶ added in v0.72.0
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
WithDialTimeout returns a context carrying a dial timeout that DialContext wrappers can use to scope the timeout to just the connection establishment phase.
Types ¶
type AccountID ¶
type AccountID string
AccountID represents a unique identifier for a NetBird account.
type DialContextFunc ¶ added in v0.67.0
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.