socket

package
v0.0.0-...-b944407 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook func(s *Stream)

type Router

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

func FindExistRouter

func FindExistRouter(path []byte) *Router

FindExistRouter 寻找一个已有路由

func (*Router) Add

func (r *Router) Add(path []byte, h Hook)

func (*Router) Exec

func (r *Router) Exec(s *Stream)

Exec 执行路由方法

func (*Router) Group

func (r *Router) Group(path []byte) *Router

func (*Router) Set

func (r *Router) Set(h Hook)

func (*Router) Use

func (r *Router) Use(h Hook)

type Server

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

func (*Server) Group

func (socket *Server) Group(path []byte) *Router

func (*Server) Init

func (socket *Server) Init()

func (*Server) Run

func (socket *Server) Run(port int)

func (*Server) SetBuffLen

func (socket *Server) SetBuffLen(l int)

type Stream

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

func (*Stream) Close

func (s *Stream) Close()

func (*Stream) End

func (s *Stream) End()

func (*Stream) GetBody

func (s *Stream) GetBody() []byte

func (*Stream) ReSend

func (s *Stream) ReSend()

func (*Stream) Rsp

func (s *Stream) Rsp(data []byte) (int, error)

func (*Stream) Track

func (s *Stream) Track(info interface{})

Jump to

Keyboard shortcuts

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