coreUtils

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RuntimePath = "" //运行路径
)

Functions

func Get

func Get(uri string) (string, error)

func GetClientIP

func GetClientIP(c *gin.Context) string

GetClientIP 获取用户真实 IP

func GetLocationByIp

func GetLocationByIp(ip string) (location *qqwry.Location, err error)

func GetSimpleArea

func GetSimpleArea(val string) string

GetSimpleArea 获取地区简写

func InitChunZhenIp

func InitChunZhenIp()

func InitConfig

func InitConfig(cfg *Config)

func InitOrderGenerator

func InitOrderGenerator(workerId int64)

InitOrderGenerator 初始化订单编号生成器

func Post

func Post(uri string, params map[string]any) (string, error)

func ResizeByBase64

func ResizeByBase64(base64Str string, percent int) (string, error)

ResizeByBase64 压缩图片(原始图片数据是base64)

Types

type Config added in v0.0.19

type Config struct {
	AppName          string   //应用名称
	ConfigFilePath   string   // 配置文件目录
	ConfigType       string   // 配置文件类型 json yaml toml
	EnvFile          string   // 环境配置文件
	ExtConfigFiles   []string //配置文件
	OpenConfigPath   string   //开放配置文件所在目录
	OpenConfigFields []string //开放配置字段 (只能存在 EnvFile 中)
}

type OrderNoGenerator

type OrderNoGenerator struct {
	// contains filtered or unexported fields
}
var OrderGenerator *OrderNoGenerator

func NewOrderNoGenerator

func NewOrderNoGenerator(workerId int64) (*OrderNoGenerator, error)

NewOrderNoGenerator 创建订单号生成器实例

func (*OrderNoGenerator) Generate

func (g *OrderNoGenerator) Generate(pre string, length int) (string, error)

Generate 生成订单号

Jump to

Keyboard shortcuts

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