vtcp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseConn

func CloseConn(conn *Conn) (err error)

func LoadKeyCrt

func LoadKeyCrt(crtFile, keyFile string) (*tls.Config, error)

Types

type AddrMock

type AddrMock struct {
}

func (*AddrMock) Network

func (a *AddrMock) Network() string

func (*AddrMock) String

func (a *AddrMock) String() string

type Conn

type Conn = gtcp.Conn

func NewConn

func NewConn(addr string, timeout ...time.Duration) (*Conn, error)

func NewConnTLS

func NewConnTLS(addr string, tlsConfig *tls.Config) (*Conn, error)

type ConnCloseErrMock

type ConnCloseErrMock struct {
	ConnMock
}

func (*ConnCloseErrMock) Close

func (c *ConnCloseErrMock) Close() error

type ConnMock

type ConnMock struct {
}

func (*ConnMock) Close

func (c *ConnMock) Close() error

func (*ConnMock) LocalAddr

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

func (*ConnMock) Read

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

func (*ConnMock) RemoteAddr

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

func (*ConnMock) SetDeadline

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

func (*ConnMock) SetReadDeadline

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

func (*ConnMock) SetWriteDeadline

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

func (*ConnMock) Write

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

type IHandler

type IHandler interface {
	Handle(conn *Conn)
}

type PkgOption

type PkgOption = gtcp.PkgOption

type Server

type Server struct {
	Address     string `mapstructure:",omitempty"`
	CrtFile     string `mapstructure:",omitempty"`
	Handler     func(conn *Conn)
	KeyFile     string `mapstructure:",omitempty"`
	StopHandler func()
}

func NewServer

func NewServer(lifecycle vfx.Lifecycle, s *Server) *Server

NewServer new server

func (*Server) NewServer

func (s *Server) NewServer(lifecycle vfx.Lifecycle) *Server

NewServer new server

type ServerGtcp

type ServerGtcp = gtcp.Server

func NewServerKeyCrt

func NewServerKeyCrt(address, crtFile, keyFile string, handler func(*Conn), name ...string) (*ServerGtcp, error)

Jump to

Keyboard shortcuts

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