utils

package
v1.0.2-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 版本号
	VERSION = "v1.0.2-alpha.1"
)

Variables

View Source
var (
	Logger *logger.Logger
	// 日志文件
	Logf    *os.File
	Stdoutf *os.File
)
View Source
var (
	ErrProcessNotRunning = errors.New("process is not running")
)

Functions

func GetPid

func GetPid(path string) (int, error)

GetPid, 查询pid文件并返回pid 返回值:

pid
错误

func InitLogger

func InitLogger(stdout *os.File, level logger.LogLevel)

func PathExists

func PathExists(path string) (bool, error)

PathExists, 判断文件路径是否存在函数 参数:

path: 待判断的文件路径字符串

返回值:

true: 存在; false: 不存在
错误

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile, 读取文件函数 参数:

path: 文件路径字符串

返回值:

文件数据
错误

func Version

func Version() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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