router

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(r *Router)

func WithDefaultRoute

func WithDefaultRoute(r *Route) Option

func WithDialer

func WithDialer(d proxy.Dialer) Option

func WithRoutes

func WithRoutes(routes []Route) Option

type Proxy

type Proxy struct {
	Proto proxy.Proto `mapstructure:"proto"`
	Addr  addr.Addr   `mapstructure:"addr"`
}

type Route

type Route struct {
	Hosts []string `mapstructure:"hosts"`

	Proxy Proxy `mapstructure:"proxy"`
}

type Router

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

func New

func New(ops ...Option) *Router

func (*Router) Dial

func (r *Router) Dial(ctx context.Context, dstAddr *addr.Addr) (net.Conn, error)

Jump to

Keyboard shortcuts

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