internal

package
v0.0.0-...-bec70bb Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedChunk

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

type CloseObserver

type CloseObserver func(*ConnObserver, net.Conn)

type ConnObserver

type ConnObserver struct {
	WriteObserver WriteFormatter
	ReadObserver  ReadObserver
	CloseObserver CloseObserver
	// contains filtered or unexported fields
}

func NewConnObserver

func NewConnObserver(
	fd net.Conn,
	sz int,
	write WriteFormatter,
	read ReadObserver,
	cl CloseObserver,
) *ConnObserver

func (*ConnObserver) Close

func (c *ConnObserver) Close() error

func (*ConnObserver) Fd

func (c *ConnObserver) Fd() net.Conn

func (*ConnObserver) LocalAddr

func (c *ConnObserver) LocalAddr() net.Addr

func (*ConnObserver) RemoteAddr

func (c *ConnObserver) RemoteAddr() net.Addr

func (*ConnObserver) Write

func (c *ConnObserver) Write(buf []byte)

type EndServer

type EndServer struct {
	protos.UnimplementedEsiServer
}

func (*EndServer) Test

func (s *EndServer) Test(
	ctx context.Context,
	req *protos.TestRequest,
) (*protos.TestResponse, error)

type NKNConn

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

func Dial

func Dial(addr string) (*NKNConn, error)

func (*NKNConn) Close

func (c *NKNConn) Close() error

func (*NKNConn) LocalAddr

func (c *NKNConn) LocalAddr() net.Addr

func (*NKNConn) Read

func (c *NKNConn) Read(b []byte) (n int, err error)

func (*NKNConn) RemoteAddr

func (c *NKNConn) RemoteAddr() net.Addr

func (*NKNConn) SetDeadline

func (c *NKNConn) SetDeadline(t time.Time) error

func (*NKNConn) SetReadDeadline

func (c *NKNConn) SetReadDeadline(t time.Time) error

func (*NKNConn) SetWriteDeadline

func (c *NKNConn) SetWriteDeadline(t time.Time) error

func (*NKNConn) Write

func (c *NKNConn) Write(b []byte) (n int, err error)

type NKNListener

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

func NewNKNListener

func NewNKNListener(seed string) (*NKNListener, error)

func (*NKNListener) Accept

func (l *NKNListener) Accept() (net.Conn, error)

func (*NKNListener) Addr

func (l *NKNListener) Addr() net.Addr

func (*NKNListener) Close

func (l *NKNListener) Close() error

type ReadObserver

type ReadObserver func(*ConnObserver, []byte) ([]byte, error)

type ReadStatus

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

type RedunantAddr

type RedunantAddr struct {
	Tcp net.Addr
	Nkn net.Addr
}

type RedundantClient

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

func RedundantDial

func RedundantDial(addr RedunantAddr) (*RedundantClient, error)

func (*RedundantClient) Addrs

func (c *RedundantClient) Addrs() []net.Addr

func (*RedundantClient) Inner

func (c *RedundantClient) Inner() protos.EsiClient

type ResiListener

type ResiListener struct {
	protos.UnimplementedEsiServer
	// contains filtered or unexported fields
}

func NewResiListener

func NewResiListener(options ResiListenerOptions) (*ResiListener, error)

func (*ResiListener) Connected

func (l *ResiListener) Connected(fd *Socket)

func (*ResiListener) GetSocket

func (l *ResiListener) GetSocket(ctx context.Context) (*Socket, error)

func (*ResiListener) Modify

func (*ResiListener) NKNAddr

func (l *ResiListener) NKNAddr() net.Addr

func (*ResiListener) Serve

func (l *ResiListener) Serve()

func (*ResiListener) Stop

func (l *ResiListener) Stop()

func (*ResiListener) TcpAddr

func (l *ResiListener) TcpAddr() net.Addr

func (*ResiListener) Test

type ResiListenerOptions

type ResiListenerOptions struct {
	Tcp        net.Addr
	NknSeed    string
	TcpForward net.Addr
	NknForward net.Addr
}

type Socket

type Socket struct {
	Debug bool
	// contains filtered or unexported fields
}

func NewSocket

func NewSocket(sockets []net.Conn) *Socket

func (*Socket) Absorb

func (a *Socket) Absorb(b *Socket)

func (*Socket) AddSocket

func (a *Socket) AddSocket(fd net.Conn)

func (*Socket) Close

func (a *Socket) Close() error

func (*Socket) DropSocket

func (a *Socket) DropSocket(fd net.Conn) error

func (*Socket) LocalAddr

func (a *Socket) LocalAddr() net.Addr

func (*Socket) LocalAddrs

func (a *Socket) LocalAddrs() []net.Addr

func (*Socket) Read

func (a *Socket) Read(b []byte) (n int, err error)

func (*Socket) RemoteAddr

func (a *Socket) RemoteAddr() net.Addr

func (*Socket) SetDeadline

func (a *Socket) SetDeadline(t time.Time) error

func (*Socket) SetReadDeadline

func (a *Socket) SetReadDeadline(t time.Time) error

func (*Socket) SetWriteDeadline

func (a *Socket) SetWriteDeadline(t time.Time) error

func (*Socket) Write

func (a *Socket) Write(b []byte) (n int, err error)

type SocketAddr

type SocketAddr struct {
	Net string
	Str string
}

func (SocketAddr) Network

func (addr SocketAddr) Network() string

func (SocketAddr) String

func (addr SocketAddr) String() string

type SocketListener

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

func NewSocketListener

func NewSocketListener(listeners []net.Listener) *SocketListener

func (*SocketListener) Accept

func (l *SocketListener) Accept() (net.Conn, error)

func (*SocketListener) Addr

func (l *SocketListener) Addr() net.Addr

func (*SocketListener) Close

func (l *SocketListener) Close() error

func (*SocketListener) SetAcceptObserver

func (l *SocketListener) SetAcceptObserver(ch chan net.Conn)

type WriteFormatter

type WriteFormatter func(*ConnObserver, []byte) []byte

type WriteOperation

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

type WriteStatus

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

Jump to

Keyboard shortcuts

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