Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = ConfigStruct{ Db: DbStruct{ DriverName: "mysql", Protocol: "tcp", Host: "localhost", Port: "3306", Dbname: "dbname", Username: "root", Password: "", Charset: "utf8mb4", TablePrefix: "", }, Redis: RedisStruct{ Host: "localhost", Port: "6379", Password: "", Db: "0", }, Repository: RepositoryStruct{ Dir: "./project/app/", Branch: "master", RemoteName: "origin", RemoteURL: "git@github.com:jcbowen/jcbaseGo.git", }, }
Config 为Config添加默认数据
Functions ¶
This section is empty.
Types ¶
type ConfigOption ¶ added in v0.3.1
func New ¶ added in v0.3.1
func New(c ConfigOption) *ConfigOption
func (*ConfigOption) GetConfig ¶ added in v0.3.1
func (co *ConfigOption) GetConfig() *ConfigStruct
GetConfig 获取配置信息
func (*ConfigOption) GetConfigOption ¶ added in v0.3.1
func (co *ConfigOption) GetConfigOption() ConfigOption
type ConfigStruct ¶ added in v0.3.1
type ConfigStruct struct {
Db DbStruct `json:"db"` // 数据库配置信息
Redis RedisStruct `json:"redis"` // redis配置信息
Repository RepositoryStruct `json:"repository"` // 仓库配置信息
}
func (*ConfigStruct) Get ¶ added in v0.3.1
func (c *ConfigStruct) Get() *ConfigStruct
Get 获取配置信息(兼容旧的写法) Deprecated: 请使用
type DbStruct ¶ added in v0.2.1
type DbStruct struct {
DriverName string `json:"driverName"` // 驱动类型
Protocol string `json:"protocol"` // 协议
Host string `json:"host"` // 数据库地址
Port string `json:"port"` // 数据库端口号
Dbname string `json:"dbname"` // 表名称
Username string `json:"username"` // 用户名
Password string `json:"password"` // 密码
Charset string `json:"charset"` // 编码
TablePrefix string `json:"tablePrefix"` // 表前缀
}
type RedisStruct ¶ added in v0.2.1
Click to show internal directories.
Click to hide internal directories.