server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultServer = NewServer()

Functions

func Accept

func Accept(lis net.Listener)

func HandleHTTP

func HandleHTTP()

func Register

func Register(obj interface{}) error

Types

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Accept

func (s *Server) Accept(lis net.Listener)

直接使用 TCP 协议

func (*Server) HandleHTTP

func (s *Server) HandleHTTP()

使用 HTTP 协议

func (*Server) Register

func (s *Server) Register(obj interface{}) error

服务注册为 Service 实例,对外支持 RPC 调用

func (*Server) ServeConn

func (s *Server) ServeConn(conn io.ReadWriteCloser)

一次连接可以包含多次调用,报文格式:| Option | Header1 | Body1 | Header2 | Body2 | ...

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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