Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Databases Databases `json:"databases"` System System `json:"system"` Gin Gin `json:"gin"` SQL SQL `json:"sql"` }
Config 配置
var ( // Conf 配置 Conf *Config // DefConf 默认配置 DefConf Config // Cookie 配置 // @since 0.0.2 Cookie = cookie{ MaxAge: 1 * 60 * 60, Path: "/", Domain: "", Secure: false, HTTPOnly: false, } )
@since 0.0.1
func DefaultConf ¶
func DefaultConf() Config
DefaultConf 默认配置 这里待考虑 是写在内存里还是流出配置文件 考虑的结果是为了防止文件缺失的问题写到内存里 conf.default.json 依旧在包里供查阅 @since 0.0.1
type Database ¶
type Database struct { DBID string `json:"db_id"` Driver string `json:"driver"` Name string `json:"name"` User string `json:"user"` Password string `json:"password"` Host string `json:"host"` Port string `json:"port"` Charset string `json:"charset"` TablePrefix string `json:"table_prefix"` DB *sql.DB `json:"-"` }
Database 数据库配置 @since 0.0.1
func (Database) DataSourceName ¶
DataSourceName 获取数据库连接字符串 @since 0.0.1
func (Database) DataSourceNameGORM ¶
DataSourceNameGORM 因为系统 SQL 和 GORM DNS 不一样 见下连接 详细原因待查 @since 0.0.1
Click to show internal directories.
Click to hide internal directories.