net

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled       bool
	Subnets       []Subnet
	Balancer      string
	Restrict      bool
	FallbackDelay time.Duration
	EventHandler  multinet.EventHandler
}

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) Update

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

type LogEventHandler

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

func NewLogEventHandler

func NewLogEventHandler(logger *zap.Logger) LogEventHandler

func (LogEventHandler) DialPerformed

func (l LogEventHandler) DialPerformed(sourceIP net.Addr, _, address string, err 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