conf

package
v0.0.0-...-08c5772 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MYSQL_HOST            string
	REDIS_HOST            string
	ELASTICSEARCH_ADDRESS string
)
View Source
var (
	GlobalAdminServerConfigProperties  = ServerConfigProperties{}
	GlobalPortalServerConfigProperties = ServerConfigProperties{}
	GlobalSearchServerConfigProperties = ServerConfigProperties{}
	GlobalJwtConfigProperties          = JwtConfigProperties{}
	// GlobalDatabaseConfigProperties 如果不同服务的数据库配置不同,可以在这里分别定义
	GlobalDatabaseConfigProperties = DatabaseConfigProperties{}
)

全局配置属性

Functions

func InitAdminConfigProperties

func InitAdminConfigProperties()

InitAdminConfigProperties 初始化配置属性

func InitPortalConfigProperties

func InitPortalConfigProperties()

func InitSearchConfigProperties

func InitSearchConfigProperties()

Types

type DatabaseConfigProperties

type DatabaseConfigProperties struct {
	GormMysqlConfigProperties     GormMysqlConfigProperties
	RedisConfigProperties         RedisConfigProperties
	ElasticSearchConfigProperties ElasticSearchConfigProperties
}

type ElasticSearchConfigProperties

type ElasticSearchConfigProperties struct {
	// host:port
	Addresses []string
	Username  string
	Password  string
	// http_ca证书路径 (http_ca.crt)
	CACertPath string
}

type GormMysqlConfigProperties

type GormMysqlConfigProperties struct {
	Host      string
	Port      string
	Database  string
	Username  string
	Password  string
	Charset   string
	ParseTime bool
	// 时区
	Loc string

	GormSlowThreshold             time.Duration
	GormColorful                  bool
	GormIgnoreRecordNotFoundError bool
	GormParameterizedQueries      bool
	// Gorm 日志级别
	// 1 Silent,2 Error,3 Warn,4 Info
	GormLogLevel int
}

GormMysqlConfigProperties gorm mysql 配置属性

type JwtConfigProperties

type JwtConfigProperties struct {
	TokenHeader string
	TokenHead   string
	Secret      string
	Expiration  int
}

JwtConfigProperties security 配置属性

type RedisConfigProperties

type RedisConfigProperties struct {
	Host     string
	Port     string
	Password string
	Database int
}

RedisConfigProperties redis 配置属性

type ServerConfigProperties

type ServerConfigProperties struct {
	// 启动
	Enable bool
	// release, debug, test
	GinRunMode      string
	Port            string
	ApplicationName string
	ReadTimeout     int
}

ServerConfigProperties 服务配置属性

Jump to

Keyboard shortcuts

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