Documentation ¶ Index ¶ type Option func WithDefaultRoute(r *Route) Option func WithDialer(d proxy.Dialer) Option func WithRoutes(routes []Route) Option type Proxy type Route type Router func New(ops ...Option) *Router func (r *Router) Dial(ctx context.Context, dstAddr *addr.Addr) (net.Conn, error) 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) Source Files ¶ View all Source files router.go Click to show internal directories. Click to hide internal directories.