plugin

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerHTTP

type ServerHTTP struct {
	*http.Server             // HTTP
	Addr         string      // 监听地址
	Route        *vweb.Route // 路由表
	// contains filtered or unexported fields
}

ServerHTTP 服务器HTTP

func NewServerHTTP

func NewServerHTTP() *ServerHTTP

NewServerHTTP HTTP服务对象

func (*ServerHTTP) Close

func (T *ServerHTTP) Close() error

Close 判断监听的连接

error 错误

func (*ServerHTTP) ListenAndServe

func (T *ServerHTTP) ListenAndServe() error

ListenAndServe 监听并启动

error 错误

func (*ServerHTTP) LoadTLS

func (T *ServerHTTP) LoadTLS(certFile, keyFile string) error

LoadTLS 加载证书文件

certFile     证书公钥
keyFile      证书私钥

func (*ServerHTTP) Serve

func (T *ServerHTTP) Serve(l net.Listener) error

Serve 监听

error 错误

type ServerRPC

type ServerRPC struct {
	*rpc.Server        // RPC
	Addr        string // 地址
	// contains filtered or unexported fields
}

ServerRPC 服务器,这个一个RPC服务器,客户端可以调用绑定的方法。

func NewServerRPC

func NewServerRPC() *ServerRPC

NewServerRPC 服务器监听

func (*ServerRPC) Close

func (T *ServerRPC) Close() error

Close 判断监听的连接

error 错误

func (*ServerRPC) HandleHTTP

func (T *ServerRPC) HandleHTTP(rpcPath, debugPath string)

HandleHTTP 设置 RPC地址 和 调试地址

rpcPath, debugPath string       访问地址和调试地址

func (*ServerRPC) ListenAndServe

func (T *ServerRPC) ListenAndServe() error

ListenAndServe 监听并启动

error 错误

func (*ServerRPC) Register

func (T *ServerRPC) Register(value any)

Register 注册解析类型

value any     注册类型

func (*ServerRPC) RegisterName

func (T *ServerRPC) RegisterName(name string, rcvr any) error

RegisterName 注册一个struct,让客户端进行访问。

name string       包名
rcvr any  结构对象
error             错误

func (*ServerRPC) Serve

func (T *ServerRPC) Serve(l net.Listener) error

Serve 监听客户端连接

error 错误

Jump to

Keyboard shortcuts

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