global

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

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:更新时间;"`
}

type TTime added in v0.10.2

type TTime time.Time

func CreateTime added in v0.0.3

func CreateTime() TTime

CreateTime *

  • @Description: 创建一个时间戳
  • @return Time

Jump to

Keyboard shortcuts

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