libUtils

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncryptPassword

func EncryptPassword(password, salt string) string

EncryptPassword 密码加密

func FileIsExisted

func FileIsExisted(filename string) bool

文件或文件夹是否存在

func GetCityByIp

func GetCityByIp(ip string) string

GetCityByIp 获取ip所属城市

func GetClientIp

func GetClientIp(ctx context.Context) string

GetClientIp 获取客户端IP

func GetDomain

func GetDomain(ctx context.Context) string

GetDomain 获取当前请求接口域名

func GetLocalIP

func GetLocalIP() (ip string, err error)

GetLocalIP 服务端ip

func GetPid

func GetPid() int

func GetRandomUUID

func GetRandomUUID() string

func GetUserAgent

func GetUserAgent(ctx context.Context) string

GetUserAgent 获取user-agent

func ParseFilePath

func ParseFilePath(pathStr string) (fileName string, fileType string)

解析路径获取文件名称及后缀

func ReadMachineID

func ReadMachineID() []byte

func WriteToFile

func WriteToFile(fileName string, content string) error

写入文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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