site

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2016 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(env string) error

func IocAction

func IocAction(act func(*config.Model, *cli.Context) error) func(c *cli.Context)

Types

type Dao

type Dao struct {
	Db  *gorm.DB  `inject:""`
	Aes *core.Aes `inject:""`
}

func (*Dao) Get

func (p *Dao) Get(key string, val interface{}) error

func (*Dao) GetSiteInfo

func (p *Dao) GetSiteInfo(key, lang string) string

func (*Dao) GetString

func (p *Dao) GetString(key string) string

func (*Dao) Languages

func (p *Dao) Languages() []string

func (*Dao) Locale

func (p *Dao) Locale(lang, code, msg string) error

func (*Dao) Set

func (p *Dao) Set(key string, val interface{}, flag bool) error

func (*Dao) SetSiteInfo

func (p *Dao) SetSiteInfo(key, lang string, val interface{}, flag bool) error

type Locale

type Locale struct {
	core.Model
	Code    string `sql:"not null;index:idx_locales_code" json:"code"`
	Lang    string `sql:"not null;default:'en-US';type:char(5);index:idx_locales_lang" json:"lang"`
	Message string `sql:"not null;type:text" json:"message"`
}

type Notice

type Notice struct {
	core.Model
	Lang    string `sql:"not null;type:char(5);index:idx_notices_lang" json:"lang"`
	Content string `sql:"not null;type:text" json:"content"`
}

type Setting

type Setting struct {
	core.Model
	Key  string `sql:"not null;unique_index"`
	Val  []byte `sql:"not null"`
	Flag bool   `sql:"not null;default:false"`
}

type SiteEngine

type SiteEngine struct {
	core.Controller

	Cfg    *config.Model   `inject:""`
	Db     *gorm.DB        `inject:""`
	Dao    *Dao            `inject:""`
	Logger *logging.Logger `inject:""`
	Render *render.Render  `inject:""`
	Cache  cache.Provider  `inject:""`
}

func (*SiteEngine) Asserts

func (p *SiteEngine) Asserts() []*core.Template

=========================================================

func (*SiteEngine) Migrate

func (p *SiteEngine) Migrate()

func (*SiteEngine) Mount

func (p *SiteEngine) Mount(rt core.Router)

func (*SiteEngine) Rss

func (p *SiteEngine) Rss() rss.Handler

func (*SiteEngine) Seed

func (p *SiteEngine) Seed() error

func (*SiteEngine) Shell

func (p *SiteEngine) Shell() []cli.Command

func (*SiteEngine) Sitemap

func (p *SiteEngine) Sitemap() sitemap.Handler

type SiteModel

type SiteModel struct {
	Lang        string
	Title       string
	SubTitle    string
	Keywords    string
	Description string
	AuthorName  string
	AuthorEmail string
	Copyright   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL