Help us shape the future of Go! Take the 2026 Go Developer Survey

net

package
v0.46.12 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DialContextTCP

func DialContextTCP(ctx context.Context, address string, d Dialer) (net.Conn, error)

Types

type Config

type Config struct {
	Enabled       bool
	Subnets       []Subnet
	Balancer      string
	Restrict      bool
	FallbackDelay time.Duration
	Metrics       metrics.MultinetMetrics
}

type Dialer

type Dialer interface {
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

type DialerSource

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

func NewDialerSource

func NewDialerSource(c Config) (*DialerSource, error)

func (*DialerSource) GrpcContextDialer

func (s *DialerSource) GrpcContextDialer() func(context.Context, string) (net.Conn, error)

GrpcContextDialer returns grpc.WithContextDialer func. Returns nil if multinet disabled.

func (*DialerSource) NetContextDialer

func (s *DialerSource) NetContextDialer() func(context.Context, string, string) (net.Conn, error)

NetContextDialer returns net.DialContext dial function. Returns nil if multinet disabled.

func (*DialerSource) Update

func (s *DialerSource) Update(c Config) error

type Subnet

type Subnet struct {
	Prefix    string
	SourceIPs []string
}

Jump to

Keyboard shortcuts

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