router

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 39 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxWeight uint8 = 0xff
)

Variables

View Source
var (
	ErrBadVersion   = errors.New("bad version")
	ErrUnknownCmd   = errors.New("unknown command")
	ErrRouterID     = errors.New("invalid router ID")
	ErrUnauthorized = errors.New("unauthorized")
)

Functions

func LockWriter

func LockWriter(w io.Writer) io.Writer

func NewHandler

func NewHandler(opts ...handler.Option) handler.Handler

Types

type Connector

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

func NewConnector

func NewConnector(rid relay.TunnelID, cid relay.ConnectorID, host string, w io.Writer, opts *ConnectorOptions) *Connector

func (*Connector) Close

func (c *Connector) Close() error

func (*Connector) ID

func (c *Connector) ID() relay.ConnectorID

func (*Connector) Writer

func (c *Connector) Writer() io.Writer

type ConnectorOptions

type ConnectorOptions struct{}

type ConnectorPool

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

func NewConnectorPool

func NewConnectorPool(node string) *ConnectorPool

func (*ConnectorPool) Add

func (p *ConnectorPool) Add(rid relay.TunnelID, c *Connector)

func (*ConnectorPool) Close

func (p *ConnectorPool) Close() error

func (*ConnectorPool) Del

func (p *ConnectorPool) Del(rid relay.TunnelID, host string, cid relay.ConnectorID)

func (*ConnectorPool) Get

func (p *ConnectorPool) Get(rid relay.TunnelID, host string) *Connector

type Router

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

func NewRouter

func NewRouter(node string, rid relay.TunnelID) *Router

func (*Router) AddConnector

func (r *Router) AddConnector(c *Connector)

func (*Router) Close

func (r *Router) Close() error

func (*Router) DelConnector

func (r *Router) DelConnector(host string, cid relay.ConnectorID)

func (*Router) GetConnector

func (r *Router) GetConnector(host string) *Connector

func (*Router) ID

func (r *Router) ID() relay.TunnelID

Jump to

Keyboard shortcuts

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