Documentation ¶
Index ¶
Constants ¶
View Source
const ( Version = "0.1.0" // Version admin version OK = "10001" ERR = "10002" RETRY = "10003" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminBootstrap ¶
type AdminBootstrap struct { Server ServerConfig `yaml:"server" json:"server" mapstructure:"server"` EtcdConfig EtcdConfig `yaml:"etcd" json:"etcd" mapstructure:"etcd"` MysqlConfig MysqlConfig `yaml:"mysql" json:"mysql" mapstructure:"mysql"` }
AdminBootstrap admin bootstrap config
var ( Client *etcdv3.Client Bootstrap *AdminBootstrap )
func LoadAPIConfigFromFile ¶
func LoadAPIConfigFromFile(path string) (*AdminBootstrap, error)
LoadAPIConfigFromFile load config from file
func (*AdminBootstrap) GetAddress ¶
func (a *AdminBootstrap) GetAddress() string
GetAddress get etcd server address
func (*AdminBootstrap) GetPath ¶
func (a *AdminBootstrap) GetPath() string
GetPath get etcd config root path
type Autocode ¶
type Autocode struct { TransferRestart bool `mapstructure:"transfer-restart" json:"transferRestart" yaml:"transfer-restart"` Root string `mapstructure:"root" json:"root" yaml:"root"` Server string `mapstructure:"server" json:"server" yaml:"server"` SApi string `mapstructure:"server-api" json:"serverApi" yaml:"server-api"` SInitialize string `mapstructure:"server-initialize" json:"serverInitialize" yaml:"server-initialize"` SModel string `mapstructure:"server-model" json:"serverModel" yaml:"server-model"` SRequest string `mapstructure:"server-request" json:"serverRequest" yaml:"server-request"` SRouter string `mapstructure:"server-router" json:"serverRouter" yaml:"server-router"` SService string `mapstructure:"server-service" json:"serverService" yaml:"server-service"` Web string `mapstructure:"web" json:"web" yaml:"web"` WApi string `mapstructure:"web-api" json:"webApi" yaml:"web-api"` WForm string `mapstructure:"web-form" json:"webForm" yaml:"web-form"` WTable string `mapstructure:"web-table" json:"webTable" yaml:"web-table"` WFlow string `mapstructure:"web-flow" json:"webFlow" yaml:"web-flow"` }
type BaseInfo ¶
type BaseInfo struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` PluginFilePath string `json:"pluginFilePath" yaml:"pluginFilePath"` }
BaseInfo base info
type EtcdConfig ¶
type EtcdConfig struct { Address string `yaml:"address" json:"admin" mapstructure:"admin"` Path string `yaml:"path" json:"path" mapstructure:"path"` }
EtcdConfig admin etcd client config
type Mysql ¶
type Mysql struct { Address string `mapstructure:"address" json:"address" yaml:"address"` // host:port Config string `mapstructure:"config" json:"config" yaml:"config"` Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"` Username string `mapstructure:"username" json:"username" yaml:"username"` Password string `mapstructure:"password" json:"password" yaml:"password"` MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"` MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"` LogMode string `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"` LogZap bool `mapstructure:"log-zap" json:"logZap" yaml:"log-zap"` }
type MysqlConfig ¶
type MysqlConfig struct { Username string `yaml:"username" json:"username" mapstructure:"username"` Password string `yaml:"password" json:"password" mapstructure:"password"` Host string `yaml:"host" json:"host" mapstructure:"host"` Port string `yaml:"port" json:"port" mapstructure:"port"` Dbname string `yaml:"dbname" json:"dbname" mapstructure:"dbname"` }
MysqlConfig admin mysql database config
type RetData ¶
type RetData struct { Code string `json:"code" yaml:"code"` Data interface{} `json:"data" yaml:"data"` }
RetData response data
type Server ¶
type Server struct { Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"` Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"` System System `mapstructure:"system" json:"system" yaml:"system"` AutoCode Autocode `mapstructure:"autoCode" json:"autoCode" yaml:"autoCode"` // gorm Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"` }
type ServerConfig ¶
type ServerConfig struct {
Address string `yaml:"address" json:"address" mapstructure:"address"`
}
ServerConfig admin http server config
type Zap ¶
type Zap struct { Level string `mapstructure:"level" json:"level" yaml:"level"` Format string `mapstructure:"format" json:"format" yaml:"format"` Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` Director string `mapstructure:"director" json:"director" yaml:"director"` LinkName string `mapstructure:"link-name" json:"linkName" yaml:"link-name"` ShowLine bool `mapstructure:"show-line" json:"showLine" yaml:"showLine"` EncodeLevel string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"` StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"` LogInConsole bool `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.