Documentation
¶
Index ¶
- Constants
- Variables
- func AddController(echoMux *echo.Echo, c Controller)
- func GetCache(alias string) *cache.Cache
- func GetEcho() *echo.Echo
- func Getwd(path string) string
- func NewLogger() *logger.Logger
- func RegisterController(c Controller)
- func RegisterModels(orm *Orm, modelItems ...interface{})
- func Run()
- func Version() string
- type CacheConfig
- type Config
- type Controller
- type DatabaseConfig
- type Namespace
- type Orm
- type PongorOption
- type Renderer
- type Ripple
Constants ¶
const VersionName = "0.4.0"
Variables ¶
var Logger *logger.Logger
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 RegisterController ¶
func RegisterController(c Controller)
RegisterControllers register a controller for ripple App
func RegisterModels ¶
func RegisterModels(orm *Orm, modelItems ...interface{})
RegisterModels registers models in the global ripple App.
Types ¶
type CacheConfig ¶
type CacheConfig struct {
Alias string `json:"alias"` // alias=forum
Section string `json:"section"` // section=forum
Adapter string `json:"adapter"` // adapter=redis
Host string `json:"host"` // host=127.0.0.1
Port int `json:"port"` // port=6379
Password string `json:"password"` // password=123456
}
func (CacheConfig) GetCacheAdapterConfig ¶
func (cacheConfig CacheConfig) GetCacheAdapterConfig() cache.AdapterConfig
GetCacheConfig return cache config
type Config ¶
type Config struct {
DebugOn bool `json:"debugOn"` // debugOn
AutoMigrate bool `json:"autoMigrate"` // autoMigrate
Domain string `json:"domain"` // domain=127.0.0.1:8090
Static string `json:"static"` // static=frontend/static
Templates string `json:"templates"` // templates=frontend/templates
Databases []DatabaseConfig `json:"databases,omitempty"` // databases
Caches []CacheConfig `json:"caches,omitempty"` // caches
}
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 `json:"alias"` // alias=forum
Dialect string `json:"dialect"` // dialect=mysql
Host string `json:"host"` // host=127.0.0.1
Port int `json:"port"` // port=3306
Name string `json:"name"` // name=forum
Username string `json:"username"` // username=root
Password string `json:"password"` // password=123456
}
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 *Config, options ...PongorOption) *Renderer
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ripple
command
|
|
|
ripple/templates
command
|
|
|
fixtures
|
|
|
forum
command
|
|
|
middleware
|
|