manager

package
v0.4.30 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HttpAddress http服务监听端口配置
	HttpAddress = ":8000"

	// ConnIndexTable 连接关系索引表
	ConnIndexTable sync.Map

	// Logger 接管系统log t log类型 info log信息
	Logger func(types, info string) = log
	// LogLevel 日志打印级别
	LogLevel = "INFO"
	// DefaultWriter 正常日志的默认写入方式
	DefaultWriter io.Writer = os.Stdout
	// DefaultErrorWriter 错误日志的默认写入方式
	DefaultErrorWriter io.Writer = os.Stderr
)

Functions

func HttpDashboard

func HttpDashboard()

HttpDashboard dashboard http 服务

Types

type Manager

type Manager struct{}

Manager topic管理中心结构体 为了绑定一些专属的操作方法 所以创建了一个空的结构体

func (*Manager) StartGrpcService

func (m *Manager) StartGrpcService(port string)

StartGrpcService 启动grpc服务 包含 话题订阅 与 取消订阅 推送等

func (*Manager) StartSocketService

func (m *Manager) StartSocketService(addr string)

StartSocketService 启动tcp服务 主要用来接收gateway的推送消息

type Meta

type Meta struct {
	Code  int    `json:"code"`
	Error string `json:"error"`
}

Meta http response 状态标识

type Response

type Response struct {
	Meta *Meta  `json:"meta"`
	Data string `json:"data"`
}

web service Response webservice 返回数据结构体

type TopicWebRes

type TopicWebRes struct {
	Title      string `json:"title"`
	ConnectNum int64  `json:"connect_num"`
}

TopicWebRes topic信息面板结构体

Jump to

Keyboard shortcuts

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