util

package
v0.0.0-...-ceb20fc Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEmail

func CheckEmail(email string) bool

func CheckPassword

func CheckPassword(password string) bool

func CheckUserName

func CheckUserName(userName string) bool

func CountLine

func CountLine(path string) (count int64, err error)

统计文件行数

func FileIsExist

func FileIsExist(path string) bool

判断所给路径文件/文件夹是否存在

func GetFilenameOfPath

func GetFilenameOfPath(fullPath string) string

get filename from path. eg /var/www/xx.log -> xx.log

func GetFullPath

func GetFullPath(path string) string

Get Full Path of a file or directory.

func GetJsonTime

func GetJsonTime(js []byte) time.Time

获取json中日志的时间

func GetLineInByte

func GetLineInByte(text []byte, s int) (line []byte, i int, err error)

Get a line in []byte.

func GetToken

func GetToken(r *http.Request) string

func MkDir

func MkDir(path string) error

新建目录

func ReadDir

func ReadDir(path string) ([]os.FileInfo, error)

获取目录下的所有文件和目录

func RemoteIp

func RemoteIp(req *http.Request) string

RemoteIp 返回远程客户端的 IP,如 192.168.1.1

Types

This section is empty.

Jump to

Keyboard shortcuts

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