router

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 37 Imported by: 1

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")
	ErrRouterNotAvailable = errors.New("router not available")
	ErrUnauthorized       = errors.New("unauthorized")
	ErrTunnelRoute        = errors.New("no route to host")
)

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