net

package
v0.44.0-rc.13 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 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