route

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RouteCoder

func RouteCoder(r *Route) []byte

Types

type Route

type Route struct {
	Token string
	IP    ip.IP4
	Udp   []UdpAddr
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(ipAddr string, udpAddr UdpAddr, token string) *Route

func RouteDecoder

func RouteDecoder(body []byte) *Route

func (*Route) Clone

func (r *Route) Clone() *Route

func (*Route) Coder

func (r *Route) Coder() []byte

func (*Route) Decoder

func (r *Route) Decoder(body []byte) *Route

func (*Route) LocalUdpAddr

func (r *Route) LocalUdpAddr() *UdpAddr

func (*Route) String

func (r *Route) String() string

func (*Route) SyncAddr

func (r *Route) SyncAddr(newList []UdpAddr)

func (*Route) ThroughUdpAddr

func (r *Route) ThroughUdpAddr() *UdpAddr

func (*Route) TransferUdpAddr

func (r *Route) TransferUdpAddr() *UdpAddr

func (*Route) Usability

func (r *Route) Usability(dst *net.UDPAddr)

type RouteCtrl

type RouteCtrl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRouteCtrl

func NewRouteCtrl(dropTime time.Duration, udpTime time.Duration) *RouteCtrl

func (*RouteCtrl) Export

func (routes *RouteCtrl) Export() RouteList

func (*RouteCtrl) Route

func (routes *RouteCtrl) Route(ip4 ip.IP4) *Route

func (*RouteCtrl) Sync

func (routes *RouteCtrl) Sync(r Route)

func (*RouteCtrl) SyncBatch

func (routes *RouteCtrl) SyncBatch(r []Route)

type RouteList

type RouteList []Route

func RouteListDecoder

func RouteListDecoder(body []byte) RouteList

func (RouteList) Coder

func (r RouteList) Coder() []byte

func (RouteList) String

func (r RouteList) String() string

type UDP_TYPE

type UDP_TYPE int
const (
	UDP_TRANSFER_T UDP_TYPE
	UDP_THROUGH_T
	UDP_LOCALADD_T
)

type UdpAddr

type UdpAddr struct {
	Typ UDP_TYPE
	Udp net.UDPAddr
	// contains filtered or unexported fields
}

func NewUdpAddr

func NewUdpAddr(typ UDP_TYPE, addr net.UDPAddr) UdpAddr

func (*UdpAddr) Usability

func (u *UdpAddr) Usability() int

func (*UdpAddr) UsabilitySet

func (u *UdpAddr) UsabilitySet(used int)

Jump to

Keyboard shortcuts

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