Documentation ¶
Index ¶
- Constants
- func CloseRead(c net.Conn) error
- func CloseWrite(c net.Conn) error
- func CreateBarebonesTLSConfig(proto string) (*tls.Config, error)
- func MakePipe() (pipe [2]net.Conn)
- func RunSimpleSwitch(p0, p1 Port)
- func SyncMapSize(m *sync.Map) int
- func Tr(err error) error
- type AcceptResult
- type Backend
- type Codec
- type DialResult
- type EventRecorder
- type Frontend
- type GobRPC
- type IoVec
- func (self IoVec) At(i int) (byte, error)
- func (self IoVec) Concat() []byte
- func (self *IoVec) Consume() []byte
- func (self *IoVec) Drop(s int) error
- func (self IoVec) LastByte() (byte, error)
- func (self IoVec) Len() (l int)
- func (self *IoVec) Read(p []byte) (int, error)
- func (self *IoVec) Split(i int) (tail IoVec)
- func (self *IoVec) Take(s []byte) *IoVec
- func (self *IoVec) Write(s []byte) (n int, err error)
- func (self *IoVec) WriteTo(w io.Writer) (int64, error)
- type JsonRPC
- type Map
- func (self *Map[K, V]) Delete(key K)
- func (self *Map[K, V]) Load(key K) (value V, ok bool)
- func (self *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (self *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (self *Map[K, V]) Range(f func(K, V) bool)
- func (self *Map[K, V]) Size() int
- func (self *Map[K, V]) Store(key K, value V)
- type MonoActor
- type NetPort
- type PackUnpackPassManagerBuilder
- type Pass
- type PassManager
- type Port
- type PortCreator
- type RawNetPort
- func (self *RawNetPort) Close() error
- func (self *RawNetPort) CloseRead() error
- func (self *RawNetPort) CloseWrite() error
- func (self *RawNetPort) LocalAddr() net.Addr
- func (self *RawNetPort) Pack(b *IoVec) error
- func (self *RawNetPort) RemoteAddr() net.Addr
- func (self *RawNetPort) Unpack(b *IoVec) (err error)
- type ReadWriterWithTimeout
- type Relayer
- type RouteId
- type RouteInfo
- type Set
- type SimpleRouter
- type SimpleSwitch
- type SyncPort
Constants ¶
View Source
const DEFAULT_BUFFER_LIMIT = 64 << 20
View Source
const DEFAULT_BUFFER_SIZE = 256 << 10
View Source
const DEFAULT_TIMEOUT = 60 * 60
View Source
const DEFAULT_UDP_BUFFER_SIZE = 2 << 10
View Source
const DEFAULT_UDP_TIMEOUT = 60
Variables ¶
This section is empty.
Functions ¶
func CloseWrite ¶
func MakePipe ¶
From the implementation, if p[0].Read(b0) and p[1].Write(b1), len(b1) <= len(b0), it can be served as PacketConn.
func RunSimpleSwitch ¶
func RunSimpleSwitch(p0, p1 Port)
func SyncMapSize ¶
Types ¶
type AcceptResult ¶
type Backend ¶
type Backend interface {
Dial(addr string) chan DialResult
}
type DialResult ¶
type DialResult struct {
Port
}
type EventRecorder ¶
type EventRecorder struct {
// contains filtered or unexported fields
}
func (*EventRecorder) AddRecord ¶
func (self *EventRecorder) AddRecord(e string) uint64
func (*EventRecorder) HappenedBefore ¶
func (self *EventRecorder) HappenedBefore(a, b string) bool
type Frontend ¶
type Frontend interface {
Accept() chan AcceptResult
}
type GobRPC ¶
type GobRPC struct {
P Port
}
func (*GobRPC) ReadRequest ¶
func (*GobRPC) SendResponse ¶
type JsonRPC ¶
type JsonRPC struct {
P Port
}
func (*JsonRPC) ReadRequest ¶
func (*JsonRPC) SendResponse ¶
type Map ¶
type Map[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Map[K, V]) LoadAndDelete ¶
func (*Map[K, V]) LoadOrStore ¶
type MonoActor ¶
type MonoActor struct {
// contains filtered or unexported fields
}
func NewMonoActor ¶
func NewMonoActor() *MonoActor
type NetPort ¶
type NetPort struct {
// contains filtered or unexported fields
}
func NewNetPortWithTimeout ¶
func (*NetPort) CloseWrite ¶
func (*NetPort) RemoteAddr ¶
type PackUnpackPassManagerBuilder ¶
type PackUnpackPassManagerBuilder struct {
// contains filtered or unexported fields
}
func (*PackUnpackPassManagerBuilder) AddPairedPasses ¶
func (self *PackUnpackPassManagerBuilder) AddPairedPasses(pack Pass, unpack Pass)
func (*PackUnpackPassManagerBuilder) BuildPackPassManager ¶
func (self *PackUnpackPassManagerBuilder) BuildPackPassManager() *PassManager
func (*PackUnpackPassManagerBuilder) BuildUnpackPassManager ¶
func (self *PackUnpackPassManagerBuilder) BuildUnpackPassManager() *PassManager
type PassManager ¶
type PassManager struct {
// contains filtered or unexported fields
}
func NewPassManager ¶
func NewPassManager(passes []Pass) *PassManager
func (*PassManager) AddPass ¶
func (self *PassManager) AddPass(p Pass) *PassManager
func (*PassManager) Run ¶
func (self *PassManager) Run(b *IoVec) (err error)
type Port ¶
type Port interface { Pack(*IoVec) error Unpack(*IoVec) error CloseRead() error CloseWrite() error Close() error LocalAddr() net.Addr RemoteAddr() net.Addr }
func AsSyncPort ¶
type PortCreator ¶
type RawNetPort ¶
type RawNetPort struct {
// contains filtered or unexported fields
}
func NewRawNetPort ¶
func NewRawNetPort(c net.Conn) *RawNetPort
func NewRawNetPortWithTimeout ¶
func NewRawNetPortWithTimeout(c net.Conn, timeout int) *RawNetPort
func (*RawNetPort) Close ¶
func (self *RawNetPort) Close() error
func (*RawNetPort) CloseRead ¶
func (self *RawNetPort) CloseRead() error
func (*RawNetPort) CloseWrite ¶
func (self *RawNetPort) CloseWrite() error
func (*RawNetPort) LocalAddr ¶
func (self *RawNetPort) LocalAddr() net.Addr
func (*RawNetPort) Pack ¶
func (self *RawNetPort) Pack(b *IoVec) error
func (*RawNetPort) RemoteAddr ¶
func (self *RawNetPort) RemoteAddr() net.Addr
func (*RawNetPort) Unpack ¶
func (self *RawNetPort) Unpack(b *IoVec) (err error)
type ReadWriterWithTimeout ¶
type Set ¶
type Set[V comparable] struct { // contains filtered or unexported fields }
type SimpleRouter ¶
func (*SimpleRouter) NewRoute ¶
func (self *SimpleRouter) NewRoute(id RouteId, P *SyncPort) (*RouteInfo, error)
func (*SimpleRouter) Run ¶
func (self *SimpleRouter) Run()
type SimpleSwitch ¶
type SimpleSwitch struct {
// contains filtered or unexported fields
}
SimpleSwitch is not responsible to close ports.
func NewSimpleSwitch ¶
func NewSimpleSwitch(p0, p1 Port) *SimpleSwitch
func (*SimpleSwitch) Run ¶
func (self *SimpleSwitch) Run()
type SyncPort ¶
type SyncPort struct { Port // contains filtered or unexported fields }
func NewSyncPortWithTimeout ¶
Click to show internal directories.
Click to hide internal directories.