Documentation ¶
Overview ¶
* @Author: kamalyes 501893067@qq.com * @Date: 2023-07-28 00:50:58 * @LastEditors: kamalyes 501893067@qq.com * @LastEditTime: 2024-08-12 13:39:31 * @FilePath: \go-core\global\global.go * @Description: * * Copyright (c) 2024 by kamalyes, All Rights Reserved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ENV 设置环境 ENV env.Environment // DB 数据库 DB *gorm.DB // REDIS 默认客户端 REDIS *redis.Client // MQTT 客户端 MQTT *mqtt.Client // CONFIG 全局系统配置 CONFIG *goconfig.Config // VP 通过 viper 读取的yaml配置文件 VP *viper.Viper // LOG 全局日志 LOG *zap.Logger // CSBEF casbin实施者 CSBEF casbin.IEnforcer // 雪花ID节点 Node *snowflake.Node // MinIO客户端 MinIO *minio.Client // Trans 全局validate翻译器 Trans ut.Translator GPerFix = "goc_" )
单节点应用常用全局变量
Functions ¶
This section is empty.
Types ¶
type DistributedId ¶ added in v0.10.2
type DistributedId int64
func CreateId ¶ added in v0.0.3
func CreateId() DistributedId
CreateId *
- @Description: 创建一个分布式ID(雪花ID)
- @return DistributedId
type Model ¶ added in v0.0.3
type Model struct { ID DistributedId `json:"id,omitempty" gorm:"column:id;primary_key;"` CreateTime TTime `json:"createTime,omitempty" gorm:"column:create_time;comment:创建时间;"` UpdateTime TTime `json:"updateTime,omitempty" gorm:"column:update_time;comment:更新时间;"` }
Click to show internal directories.
Click to hide internal directories.