utils

package
v0.0.0-...-f53a7f7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IntervalForever int
View Source
var XlsxMgr xlsxManager

Functions

func DecodeObject

func DecodeObject(data []byte, to interface{}) error

func EncodeObject

func EncodeObject(data interface{}) ([]byte, error)

func GetFileLineCount

func GetFileLineCount(filePath string) int

func PathExists

func PathExists(path string) (bool, error)

判断一个文件是否存在

Types

type ClientConfig

type ClientConfig struct {
	RemoteHost    string //远程服务器主机ip
	RemoteTcpPort int    //远程服务器主机端口号
	ClientName    string
	ClientId      string
}

type Config

type Config struct {
	Host       string //当前服务器主机IP
	TcpPort    int    //当前服务器主机监听端口号
	ServerName string //当前服务器名称
	ServerId   string //服务器id
	LogFile    string //日志文件名称

	Master   ClientConfig
	DataBase DBConfig
	Http     HttpConfig

	MaxPacketSize    uint32 //都需数据包的最大值
	MaxConn          int    //当前服务器主机允许的最大链接个数
	ServerWorkerSize uint32 //业务工作Worker池的数量
	MaxWorkerTaskLen uint32 //业务工作Worker对应负责的任务队列最大任务存储数量
}

func NewConfig

func NewConfig() Config

type DBConfig

type DBConfig struct {
	User     string
	Password string
	Name     string
	Port     int
	IP       string
}

type GlobalObj

type GlobalObj struct {
	AppConfig Config
}

存储一切有关Zinx框架的全局参数,供其他模块使用 一些参数也可以通过 用户根据 LiFrame.json来配置

var GlobalObject *GlobalObj

定义一个全局的对象

func (*GlobalObj) Load

func (g *GlobalObj) Load(configFile string)

读取用户的配置文件

type HttpConfig

type HttpConfig struct {
	Port int
	IP   string
}

type Table

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

func (*Table) GetCnt

func (s *Table) GetCnt() int

func (*Table) GetFloat32

func (s *Table) GetFloat32(key string, idx int) (float32, error)

func (*Table) GetFloat64

func (s *Table) GetFloat64(key string, idx int) (float64, error)

func (*Table) GetInt

func (s *Table) GetInt(key string, idx int) (int, error)

func (*Table) GetString

func (s *Table) GetString(key string, idx int) (string, error)

func (*Table) ToString

func (s *Table) ToString() string

Jump to

Keyboard shortcuts

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