Documentation ¶
Index ¶
- func ConfigAction(act func(*Model, *cli.Context) error) func(c *cli.Context)
- func DatabaseAction(act func(*gorm.DB, *cli.Context) error) func(c *cli.Context)
- func ElasticAction(act func(*elastic.Client, *Model, *cli.Context) error) func(c *cli.Context)
- func RedisAction(act func(*redis.Pool, *cli.Context) error) func(c *cli.Context)
- type Database
- type ElasticSearch
- type Http
- type Model
- func (p *Model) AesCipher() (cipher.Block, error)
- func (p *Model) Home() string
- func (p *Model) IsProduction() bool
- func (p *Model) OpenDatabase() (*gorm.DB, error)
- func (p *Model) OpenElastic() (*elastic.Client, error)
- func (p *Model) OpenRedis() *redis.Pool
- func (p *Model) OpenStorage() (storage.Provider, error)
- type Redis
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseAction ¶
func ElasticAction ¶
Types ¶
type Database ¶
type ElasticSearch ¶
type ElasticSearch struct { Host string `toml:"host"` Port int `toml:"port"` Index string `toml:"index"` }
func (*ElasticSearch) Url ¶
func (p *ElasticSearch) Url() string
type Model ¶
type Model struct { Env string `toml:"-"` SecretsS string `toml:"secret"` Secrets []byte `toml:"-"` Http *Http `toml:"http"` Storage *Storage `toml:"storage"` Database *Database `toml:"database"` Redis *Redis `toml:"redis"` ElasticSearch *ElasticSearch `toml:"elastic_search"` }
func (*Model) IsProduction ¶
func (*Model) OpenElastic ¶
Click to show internal directories.
Click to hide internal directories.