Documentation ¶
Index ¶
- Variables
- func Action(fn func(*Model, *cli.Context) error) func(*cli.Context)
- func DbAction(fn func(*gorm.DB, *cli.Context) error) func(*cli.Context)
- func EnvAction(fn func(string, *cli.Context) error) func(*cli.Context)
- func InvokeAction(hd martini.Handler) func(*cli.Context)
- func IocAction(fn func(*martini.ClassicMartini, *cli.Context) error) func(*cli.Context)
- func RedisAction(fn func(*redis.Pool, *cli.Context) error) func(*cli.Context)
- type Database
- type ElasticSearch
- type HTTP
- type Model
- type Redis
- type Workers
Constants ¶
This section is empty.
Variables ¶
View Source
var ENV = cli.StringFlag{
Name: "environment, e",
Value: "development",
Usage: "Specifies the environment to run this server under (test/development/production).",
EnvVar: "ENV",
}
ENV 运行模式
Functions ¶
func InvokeAction ¶
InvokeAction ivonke action
Types ¶
type Database ¶
Database model
type ElasticSearch ¶
type ElasticSearch struct { Host string `toml:"host"` Port int `toml:"port"` Index string `toml:"index"` }
ElasticSearch model
func (*ElasticSearch) Open ¶
func (p *ElasticSearch) Open() (*elastic.Client, error)
Open open connection
type Model ¶
type Model struct { Env string `toml:"-"` Secrets string `toml:"secrets"` HTTP HTTP `toml:"http"` Database Database `toml:"database"` Redis Redis `toml:"redis"` ElasticSearch ElasticSearch `toml:"elastic_search"` Workers Workers `toml:"workers"` }
Model model
Click to show internal directories.
Click to hide internal directories.