Versions in this module Expand all Collapse all v0 v0.2.1 Dec 6, 2014 Changes in this version + const Debug + const Product + const Version + const XSRF_TAG + var ServerNumber uint = 0 + func Abort(code int, content ...string) error + func Add(left interface{}, right interface{}) interface + func AddAction(c ...interface{}) + func AddApp(a *App) + func AddConfig(name string, value interface{}) + func AddFilter(filter Filter) + func AddHook(name string, fns ...interface{}) + func AddRouter(url string, c interface{}) + func AddTmplVar(name string, varOrFun interface{}) + func AddTmplVars(t *T) + func AutoAction(c ...interface{}) + func AvgTime(items []time.Duration) time.Duration + func Close() + func CloseZWriter(zwriter io.Writer) + func Download(w http.ResponseWriter, fpath string) error + func Eq(left interface{}, right interface{}) bool + func Error(w http.ResponseWriter, status int, content string) error + func Forbidden(content ...string) error + func FormatDate(t time.Time, format string) string + func FriendlyBytes(bytes uint64) string + func FriendlyTime(d time.Duration) string + func GetAcceptEncodingZip(r *http.Request) string + func Html(raw string) template.HTML + func InternalServerError(content ...string) error + func IsNil(a interface{}) bool + func JoinPath(paths ...string) string + func Js(raw string) template.JS + func NewCookie(name string, value string, age int64) *http.Cookie + func NotFound(content ...string) error + func NotSupported(content ...string) error + func Now() time.Time + func PageSize(total, limit int) int + func PrintGCSummary(w io.Writer) + func Process(c http.ResponseWriter, req *http.Request) + func Run(addr string) + func RunFcgi(addr string) + func RunScgi(addr string) + func RunTLS(addr string, config *tls.Config) + func SetLogger(logger *log.Logger) + func SetStaticDir(dir string) + func SetTemplateDir(dir string) + func SimpleParse(data string) map[string]string + func SimpleTLSConfig(certFile, keyFile string) (*tls.Config, error) + func Slug(s string, sep string) string + func SplitJson(s string) ([]string, error) + func StartCPUProfile() + func StopCPUProfile() + func Subtract(left interface{}, right interface{}) interface + func Ternary(express bool, trueVal interface{}, falseVal interface{}) interface + func UnTitle(s string) string + func Unauthorized(content ...string) error + func UrlFor(args ...string) string + func Urlencode(data map[string]string) string + func XsrfName() string + type AbortError struct + Code int + Content string + func (a *AbortError) Error() string + type Action struct + App *App + C reflect.Value + Option *ActionOption + Request *http.Request + RequestBody []byte + RootTemplate *template.Template + StatusCode int + T T + func (c *Action) Abort(status int, body string) error + func (c *Action) AddTmplVar(name string, varOrFunc interface{}) + func (c *Action) AddTmplVars(t *T) + func (c *Action) BasePath() string + func (c *Action) Body() []byte + func (c *Action) Cookie(key string) string + func (c *Action) Debug(params ...interface{}) + func (c *Action) Debugf(format string, params ...interface{}) + func (c *Action) DelSession(key string) + func (c *Action) DisableHttpCache() + func (c *Action) Domain() string + func (c *Action) Error(params ...interface{}) + func (c *Action) Errorf(format string, params ...interface{}) + func (c *Action) Fatal(params ...interface{}) + func (c *Action) Fatalf(format string, params ...interface{}) + func (c *Action) Flush() + func (c *Action) GetBool(key string) (bool, error) + func (c *Action) GetConfig(name string) interface{} + func (c *Action) GetCookie(cookieName string) (*http.Cookie, error) + func (c *Action) GetFile(key string) (multipart.File, *multipart.FileHeader, error) + func (c *Action) GetFloat(key string) (float64, error) + func (c *Action) GetForm() url.Values + func (c *Action) GetFuncs() template.FuncMap + func (c *Action) GetInt(key string) (int64, error) + func (c *Action) GetLogger() *log.Logger + func (c *Action) GetSecureCookie(name string) (string, bool) + func (c *Action) GetSession(key string) interface{} + func (c *Action) GetSlice(key string) []string + func (c *Action) GetString(key string) string + func (c *Action) Go(m string, anotherc ...interface{}) error + func (c *Action) Header(key string) string + func (c *Action) Host() string + func (c *Action) HttpCache(content []byte) bool + func (c *Action) IP() string + func (c *Action) Include(tmplName string) interface{} + func (c *Action) Info(params ...interface{}) + func (c *Action) Infof(format string, params ...interface{}) + func (c *Action) Is(method string) bool + func (c *Action) IsAjax() bool + func (c *Action) IsSecure() bool + func (c *Action) IsUpload() bool + func (c *Action) IsWebsocket() bool + func (c *Action) MapForm(st interface{}, names ...string) error + func (c *Action) Method() string + func (c *Action) NamedRender(name, content string, params ...*T) error + func (c *Action) Namespace() string + func (c *Action) NotFound(message string) error + func (c *Action) NotModified() + func (c *Action) Panic(params ...interface{}) + func (c *Action) Panicf(format string, params ...interface{}) + func (c *Action) Port() int + func (c *Action) Protocol() string + func (c *Action) Proxy() []string + func (c *Action) Query(key string) string + func (c *Action) Redirect(url string, status ...int) error + func (c *Action) Refer() string + func (c *Action) Render(tmpl string, params ...*T) error + func (c *Action) RenderString(content string, params ...*T) error + func (c *Action) SaveToFile(fromfile, tofile string) error + func (c *Action) Scheme() string + func (c *Action) ServeFile(fpath string) + func (c *Action) ServeJson(obj interface{}) + func (c *Action) ServeXml(obj interface{}) + func (c *Action) Session() *httpsession.Session + func (c *Action) SetBody(content []byte) error + func (c *Action) SetConfig(name string, value interface{}) + func (c *Action) SetContentType(val string) string + func (c *Action) SetCookie(cookie *http.Cookie) + func (c *Action) SetHeader(key string, value string) + func (c *Action) SetSecureCookie(name string, val string, age int64) + func (c *Action) SetSession(key string, value interface{}) + func (c *Action) Site() string + func (c *Action) SubDomains() string + func (c *Action) Uri() string + func (c *Action) Url() string + func (c *Action) UserAgent() string + func (c *Action) Warn(params ...interface{}) + func (c *Action) Warnf(format string, params ...interface{}) + func (c *Action) Write(content string, values ...interface{}) error + func (c *Action) WriteBytes(bytes []byte) error + func (c *Action) XsrfFormHtml() template.HTML + func (c *Action) XsrfValue() string + type ActionOption struct + AutoMapForm bool + CheckXsrf bool + type App struct + Actions map[string]interface{} + ActionsNamePath map[string]string + ActionsPath map[reflect.Type]string + AppConfig *AppConfig + BasePath string + Config map[string]interface{} + ContentEncoding string + ErrorTemplate *template.Template + FuncMaps template.FuncMap + Logger *log.Logger + Name string + RootTemplate *template.Template + Routes []Route + RoutesEq map[string]map[string]Route + Server *Server + SessionManager *httpsession.Manager + StaticVerMgr *StaticVerMgr + TemplateMgr *TemplateMgr + VarMaps T + func NewApp(args ...string) *App + func RootApp() *App + func (a *App) InitHeadContent(w http.ResponseWriter, contentLength int64) + func (a *App) SafelyCall(vc reflect.Value, method string, args []reflect.Value) (resp []reflect.Value, err error) + func (a *App) SetStaticDir(dir string) + func (a *App) SetTemplateDir(path string) + func (a *App) StaticUrl(url string) string + func (a *App) StructMap(vc reflect.Value, r *http.Request) error + func (a *App) TryServingFile(name string, req *http.Request, w http.ResponseWriter) bool + func (app *App) Action(name string) interface{} + func (app *App) AddAction(cs ...interface{}) + func (app *App) AddFilter(filter Filter) + func (app *App) AddRouter(url string, c interface{}) + func (app *App) AddTmplVar(name string, varOrFun interface{}) + func (app *App) AddTmplVars(t *T) + func (app *App) AutoAction(cs ...interface{}) + func (app *App) Debug(params ...interface{}) + func (app *App) Debugf(format string, params ...interface{}) + func (app *App) Error(params ...interface{}) + func (app *App) Errorf(format string, params ...interface{}) + func (app *App) Fatal(params ...interface{}) + func (app *App) Fatalf(format string, params ...interface{}) + func (app *App) GetConfig(name string) interface{} + func (app *App) Info(params ...interface{}) + func (app *App) Infof(format string, params ...interface{}) + func (app *App) Nodes() (r map[string]map[string][]string) + func (app *App) Panic(params ...interface{}) + func (app *App) Panicf(format string, params ...interface{}) + func (app *App) Redirect(w http.ResponseWriter, requestPath, url string, status ...int) error + func (app *App) SetConfig(name string, val interface{}) + func (app *App) Warn(params ...interface{}) + func (app *App) Warnf(format string, params ...interface{}) + type AppConfig struct + CacheTemplates bool + CheckXsrf bool + CookieSecret string + EnableHttpCache bool + FormMapToStruct bool + MaxUploadSize int64 + Mode int + ReloadTemplates bool + SessionOn bool + SessionTimeout time.Duration + StaticDir string + StaticFileVersion bool + TemplateDir string + type Filter interface + Do func(http.ResponseWriter, *http.Request) bool + type FromConversion interface + FromString func(content string) error + type Hook []reflect.Value + type HookEngine struct + Hooks map[string]Hook + Index map[string]uint + var ErrParamsNotAdapted = errors.New("The number of params is not adapted.") + var XHook *HookEngine = NewHookEngine(10) + func NewHookEngine(size int) *HookEngine + func (f *HookEngine) Bind(name string, fns ...interface{}) (err error) + func (f *HookEngine) Call(name string, params ...interface{}) (result []reflect.Value, err error) + func (f *HookEngine) String(c reflect.Value) string + func (f *HookEngine) Value(c []reflect.Value, index int) (r interface{}) + type LoginFilter struct + AnonymousUrls []*regexp.Regexp + App *App + AskLoginUrls []*regexp.Regexp + OriUrlName string + Redirect string + SessionName string + func NewLoginFilter(app *App, name string, redirect string) *LoginFilter + func (s *LoginFilter) AddAnonymousUrls(urls ...string) + func (s *LoginFilter) AddAskLoginUrls(urls ...string) + func (s *LoginFilter) Do(w http.ResponseWriter, req *http.Request) bool + type Mapper struct + type MemFile struct + func OpenMemZipFile(path string, zip string) (*MemFile, error) + func (f *MemFile) Close() error + func (f *MemFile) Read(p []byte) (n int, err error) + func (f *MemFile) Readdir(count int) ([]os.FileInfo, error) + func (f *MemFile) Seek(offset int64, whence int) (ret int64, err error) + func (f *MemFile) Stat() (os.FileInfo, error) + type MemFileInfo struct + func (fi *MemFileInfo) IsDir() bool + func (fi *MemFileInfo) ModTime() time.Time + func (fi *MemFileInfo) Mode() os.FileMode + func (fi *MemFileInfo) Name() string + func (fi *MemFileInfo) Size() int64 + func (fi *MemFileInfo) Sys() interface{} + type Route struct + CompiledRegexp *regexp.Regexp + HandlerElement reflect.Type + HandlerMethod string + HttpMethods map[string]bool + Path string + type Server struct + Apps map[string]*App + AppsNamePath map[string]string + Config *ServerConfig + Env map[string]interface{} + Logger *log.Logger + Name string + RootApp *App + SessionManager *httpsession.Manager + func MainServer() *Server + func NewServer(args ...string) *Server + func Serv(name string) *Server + func (s *Server) AddAction(cs ...interface{}) + func (s *Server) AddApp(a *App) + func (s *Server) AddConfig(name string, value interface{}) + func (s *Server) AddFilter(filter Filter) + func (s *Server) AddRouter(url string, c interface{}) + func (s *Server) AddTmplVar(name string, varOrFun interface{}) + func (s *Server) AddTmplVars(t *T) + func (s *Server) App(name string) *App + func (s *Server) AutoAction(c ...interface{}) + func (s *Server) Close() + func (s *Server) GetConfig(name string) interface{} + func (s *Server) InitSession() + func (s *Server) Process(w http.ResponseWriter, req *http.Request) + func (s *Server) Run(addr string) + func (s *Server) RunFcgi(addr string) + func (s *Server) RunScgi(addr string) + func (s *Server) RunTLS(addr string, config *tls.Config) error + func (s *Server) ServeHTTP(c http.ResponseWriter, req *http.Request) + func (s *Server) SetConfig(name string, value interface{}) + func (s *Server) SetLogger(logger *log.Logger) + func (s *Server) SetStaticDir(path string) + func (s *Server) SetTemplateDir(path string) + type ServerConfig struct + Addr string + EnableGzip bool + Port int + Profiler bool + RecoverPanic bool + SessionTimeout time.Duration + StaticExtensionsToGzip []string + StaticHtmlDir string + Url string + UrlPrefix string + UrlSuffix string + var Config *ServerConfig = &ServerConfig{ ... } + var Servers map[string]*Server = make(map[string]*Server) + type StaticVerMgr struct + Caches map[string]string + Ignores map[string]bool + Path string + func (self *StaticVerMgr) CacheAll(staticPath string) error + func (self *StaticVerMgr) CacheDelete(url string) + func (self *StaticVerMgr) CacheItem(url string) + func (self *StaticVerMgr) GetVersion(url string) string + func (self *StaticVerMgr) Init(app *App, staticPath string) error + func (self *StaticVerMgr) Moniter(staticPath string) error + type T map[string]interface + type TemplateMgr struct + Caches map[string][]byte + Ignores map[string]bool + IsReload bool + Preprocessor func([]byte) []byte + RootDir string + func (self *TemplateMgr) CacheAll(rootDir string) error + func (self *TemplateMgr) CacheDelete(tmpl string) + func (self *TemplateMgr) CacheTemplate(tmpl string, content []byte) + func (self *TemplateMgr) GetTemplate(tmpl string) ([]byte, error) + func (self *TemplateMgr) Init(app *App, rootDir string, reload bool) error + func (self *TemplateMgr) Moniter(rootDir string) error + type ToConversion interface + ToString func() string