web

package
v0.0.0-...-645cc30 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2013 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SupportLog                bool                   `json:"SupportLog"`
	LogWriteTo                string                 `json:"LogWriteTo"`
	LogLevel                  string                 `json:"LogLevel"`
	SupportTemplate           bool                   `json:"SupportTemplate"`
	SupportSession            bool                   `json:"SupportSession"`
	SupportCookieSession      bool                   `json:"SupportCookieSession"`
	SupportI18n               bool                   `json:"SupportI18n"`
	SupportStatic             bool                   `json:"SupportStatic"`
	SupportUrlManage          bool                   `json:"SupportUrlManage"`
	SupportUrlManageWithCache bool                   `json:"SupportUrlManageWithCache"`
	SessionType               string                 `json:"SessionType"`
	RootStaticFiles           string                 `json:"RootStaticFiles"`
	DefaultLocalePath         string                 `json:"DefaultLocalePath"`
	DefaultLanguage           string                 `json:"DefaultLanguage"`
	AutoGenerateHtml          bool                   `json:"AutoGenerateHtml"`
	AutoGenerateHtmlCycleTime int64                  `json:"AutoGenerateHtmlCycleTime"`
	AutoLoadStaticHtml        bool                   `json:"AutoLoadStaticHtml"`
	LoadStaticHtmlWithLogic   bool                   `json:"LoadStaticHtmlWithLogic"`
	ChangeSiteRoot            bool                   `json:"ChangeSiteRoot"`
	AccessHtml                bool                   `json:"AccessHtml"`
	AutoJumpToHtml            bool                   `json:"AutoJumpToHtml"`
	AssetsDirectory           string                 `json:"AssetsDirectory"`
	StaticDirectory           string                 `json:"StaticDirectory"`
	ThemeDirectory            string                 `json:"ThemeDirectory"`
	Theme                     string                 `json:"Theme"`
	StaticCssDirectory        string                 `json:"StaticCssDirectory"`
	StaticJsDirectory         string                 `json:"StaticJsDirectory"`
	StaticImgDirectory        string                 `json:"StaticImgDirectory"`
	HtmlDirectory             string                 `json:"HtmlDirectory"`
	TemplateDirectory         string                 `json:"TemplateDirectory"`
	TemplateGlobalDirectory   string                 `json:"TemplateGlobalDirectory"`
	TemplateGlobalFile        string                 `json:"TemplateGlobalFile"`
	TemporaryDirectory        string                 `json:"TemporaryDirectory"`
	UploadDirectory           string                 `json:"UploadDirectory"`
	IndexDirectory            string                 `json:"IndexDirectory"`
	IndexPage                 string                 `json:"IndexPage"`
	SiteRoot                  string                 `json:"SiteRoot"`
	Environment               map[string]string      `json:"Environment"`
	Database                  map[string]string      `json:"Database"`
	UrlManageRule             []string               `json:"UrlManageRule"`
	M                         map[string]interface{} `json:"Custom"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() Config

func (Config) Init

func (c Config) Init() Config

func (*Config) Load

func (c *Config) Load(configDir string)

func (*Config) LoadData

func (c *Config) LoadData(data string)

func (*Config) Reload

func (c *Config) Reload() bool

type Document

type Document struct {
	Close              bool
	GenerateHtml       bool
	Static             string
	Theme              string
	Attr               map[string]string
	Css                map[string]string
	Js                 map[string]string
	Img                map[string]string
	GlobalCssFile      string
	GlobalJsFile       string
	GlobalIndexCssFile string
	GlobalIndexJsFile  string
	IndexCssFile       string
	IndexJsFile        string
	Hide               bool
	Func               template.FuncMap
	Title              string
	Body               interface{}
}

type Page

type Page struct {
	Config
	Document
	Controller          map[string]interface{}
	DefaultController   interface{}
	NotFoundtController interface{}
	CurrentController   string
	CurrentAction       string
	Template            string
	MAX_FORM_SIZE       int64
	GET                 map[string]string
	POST                map[string]string
	COOKIE              map[string]string
	SESSION             map[string]interface{}
	ONCE_SESSION        interface{}
	COOKIE_SESSION      map[string]interface{}
	LANG                map[string]string
	TARGET_LANG         string
	MemorySession       *memorysession.SessionManager
	FileSession         *filesession.SessionManager
	CookieSession       *cookiesession.SessionManager
	I18n                *i18n.I18nManager
	Validation          validate.Validation
	UrlManage           *urlmanage.UrlManage
	// contains filtered or unexported fields
}

func NewPage

func NewPage(param PageParam) Page

func (Page) AddTemplateFunc

func (s Page) AddTemplateFunc(name string, i interface{})

func (Page) DelTemplateCache

func (s Page) DelTemplateCache(tmplKey string)

func (Page) DelTemplateFunc

func (s Page) DelTemplateFunc(name string)

func (*Page) GetController

func (p *Page) GetController(urlPath string) interface{}

func (Page) GetTemplateCache

func (s Page) GetTemplateCache(tmplKey string) templateCache

func (*Page) Init

func (p *Page) Init(w http.ResponseWriter, r *http.Request)

func (*Page) ListenAndServe

func (p *Page) ListenAndServe(addr string, i interface{})

func (*Page) Load

func (p *Page) Load(configPath string)

func (*Page) LoadData

func (p *Page) LoadData(data string)

func (*Page) RegisterController

func (p *Page) RegisterController(relUrlPath string, i interface{}) *Page

func (*Page) SetDefaultController

func (p *Page) SetDefaultController(i interface{}) *Page

func (*Page) SetNotFoundController

func (p *Page) SetNotFoundController(i interface{}) *Page

func (Page) SetTemplateCache

func (s Page) SetTemplateCache(tmplKey, tmplPath string)

func (Page) SetTemplateCacheObject

func (s Page) SetTemplateCacheObject(tmplKey, content string, modTime int64)

func (*Page) UpdateController

func (p *Page) UpdateController(oldUrlPath, relUrlPath string, i interface{}) *Page

type PageParam

type PageParam struct {
	MaxFormSize       int64
	SessionDir        string
	CookieName        string
	CookieSessionName string
	CookieSessionKey  string
	I18nName          string
	Expires           int
	TimerDuration     string
}

Jump to

Keyboard shortcuts

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