znet

package
v0.0.0-...-d072998 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackToClient

func CallbackToClient(conn *net.TCPConn, data []byte, cnt int) error

func NewConnection

func NewConnection(conn *net.TCPConn, connID uint32, callbackAPI ziface.HandFunc) ziface.IConnection

func NewServer

func NewServer(name string) ziface.IServer

Types

type BaseRoute

type BaseRoute struct{}

func (BaseRoute) Handler

func (b BaseRoute) Handler(req ziface.IRequest)

func (BaseRoute) PostHandler

func (b BaseRoute) PostHandler(req ziface.IRequest)

func (*BaseRoute) PreHandler

func (b *BaseRoute) PreHandler(req ziface.IRequest)

type Connection

type Connection struct {
	Conn   *net.TCPConn
	ConnID uint32

	ExitBuffChan chan bool
	// contains filtered or unexported fields
}

func (*Connection) GetConnID

func (c *Connection) GetConnID() uint32

func (*Connection) GetTCPConnection

func (c *Connection) GetTCPConnection() *net.TCPConn

func (*Connection) RemoteAddr

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

func (*Connection) Start

func (c *Connection) Start()

func (*Connection) StartReader

func (c *Connection) StartReader()

func (*Connection) Stop

func (c *Connection) Stop()

type Request

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

func (*Request) GetConnection

func (r *Request) GetConnection() ziface.IConnection

func (*Request) GetData

func (r *Request) GetData() []byte

type Server

type Server struct {
	Name      string
	IPVersion string
	IP        string
	Port      int
}

func (*Server) Server

func (s *Server) Server()

func (*Server) Start

func (s *Server) Start()

func (Server) Stop

func (s Server) Stop()

Jump to

Keyboard shortcuts

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