Documentation
¶
Index ¶
- Constants
- func AddController(echoMux *echo.Echo, c Controller)
- func GetConfig() *viper.Viper
- func GetEnv() string
- func InitConfig(env string)
- func NewLogger() *logger.Logger
- func RunScript(commands []string)
- func Version() string
- type BaseConfig
- type CacheConfig
- type Controller
- type DatabaseConfig
- type Namespace
- type Orm
- type PongorOption
- type Renderer
- type Ripple
Constants ¶
const VersionName = "0.8.5"
VersionName 0.8.2以后使用yaml配置文件
Variables ¶
This section is empty.
Functions ¶
func AddController ¶
func AddController(echoMux *echo.Echo, c Controller)
AddControllers applies the Controller to the echo via a new Group using the Controller's ripple tags as a manifest to properly associate methods/path and handler.
func InitConfig ¶ added in v0.7.0
func InitConfig(env string)
Types ¶
type BaseConfig ¶ added in v0.7.0
type BaseConfig struct {
AutoMigrate bool `mapstructure:"autoMigrate,omitempty"` // autoMigrate
Domain string `mapstructure:"domain,omitempty"` // domain=127.0.0.1:8090
Static string `mapstructure:"static,omitempty"` // static=frontend/static
Templates string `mapstructure:"templates,omitempty"` // templates=frontend/templates
Databases []DatabaseConfig `mapstructure:"databases,omitempty"` // databases
Caches []CacheConfig `mapstructure:"caches,omitempty"` // caches
}
func GetBaseConfig ¶ added in v0.7.0
func GetBaseConfig() *BaseConfig
type CacheConfig ¶
type CacheConfig struct {
Alias string `mapstructure:"alias"` // alias=forum
Section string `mapstructure:"section"` // section=forum
Adapter string `mapstructure:"adapter"` // adapter=redis
Host string `mapstructure:"host"` // host=127.0.0.1
Port int `mapstructure:"port"` // port=6379
Password string `mapstructure:"password"` // password=123456
DB int `mapstructure:"db"` // db, select db
}
func (CacheConfig) GetCacheAdapterConfig ¶
func (cacheConfig CacheConfig) GetCacheAdapterConfig() cache.AdapterConfig
type Controller ¶
type Controller interface {
// Path is the namespace ripple will create the Group at, eg /posts
Path() string
}
Controller is the interface for a Controller to be applied to an echo Group
type DatabaseConfig ¶
type DatabaseConfig struct {
Alias string `mapstructure:"alias"` // alias=forum
Dialect string `mapstructure:"dialect"` // dialect=mysql
Host string `mapstructure:"host"` // host=127.0.0.1
Port int `mapstructure:"port"` // port=3306
Name string `mapstructure:"name"` // name=forum
Username string `mapstructure:"username"` // username=root
Password string `mapstructure:"password"` // password=123456
MaxIdleConns int `mapstructure:"maxIdleConns"` // maxIdleConns
MaxOpenConns int `mapstructure:"maxOpenConns"` // maxOpenConns
}
type Namespace ¶
type Namespace string
===========================Namespace================================= Namespace provides an embeddable type that will allow a struct to implement Controller.
type Orm ¶
Orm facilitate database interactions, support mysql
func NewOrm ¶
func NewOrm(database DatabaseConfig, debug bool) *Orm
NewOrm creates a new model, and opens database connection based on cfg settings
func (*Orm) AutoMigrateAll ¶
func (orm *Orm) AutoMigrateAll()
AutoMigrateAll runs migrations for all the registered models
type PongorOption ¶
type Renderer ¶
type Renderer struct {
PongorOption
// contains filtered or unexported fields
}
func NewRenderer ¶
func NewRenderer(config *BaseConfig, options ...PongorOption) *Renderer
type Ripple ¶
type Ripple struct {
Logger *logger.Logger
Echo *echo.Echo
Orms map[string]*Orm
Caches map[string]*cache.Cache
}
Ripple ripple struct
func (*Ripple) GetEcho ¶ added in v0.5.8
================================================================
Ripple func
================================================================ GetEcho return echo
func (*Ripple) RegisterController ¶ added in v0.5.8
func (this *Ripple) RegisterController(c Controller)
RegisterControllers register a controller for ripple App
func (*Ripple) RegisterModels ¶ added in v0.5.8
RegisterModels registers models in the global ripple App.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ripple
command
|
|
|
ripple/templates
command
|
|
|
fixtures
|
|
|
forum
command
|
|
|
middleware
|
|