Versions in this module Expand all Collapse all v0 v0.5.1 Oct 11, 2015 v0.5.0 Oct 9, 2015 Changes in this version + func HtmlAttr(raw string) template.HTMLAttr + func ToHtmlAttrs(raw map[string]interface{}) (r map[template.HTMLAttr]interface{}) type Action + func (c *Action) GetConfigString(name string) string + func (c *Action) SetConfigString(name string, value string) type App + func (a *App) Close() + func (app *App) GetConfigString(name string) string + func (app *App) SetConfigString(name string, val string) + type CONF struct + Bool map[string]bool + Byte map[string][]byte + Conf map[string]*CONF + Float map[string]float64 + Int map[string]int64 + Interface map[string]interface{} + String map[string]string + func (a *CONF) DelBool(k string) + func (a *CONF) DelByte(k string) + func (a *CONF) DelConf(k string) + func (a *CONF) DelFloat(k string) + func (a *CONF) DelInt(k string) + func (a *CONF) DelInterface(k string) + func (a *CONF) DelString(k string) + func (a *CONF) GetBool(k string) bool + func (a *CONF) GetByte(k string) []byte + func (a *CONF) GetConf(k string) *CONF + func (a *CONF) GetFloat(k string) float64 + func (a *CONF) GetInt(k string) int64 + func (a *CONF) GetInterface(k string) interface{} + func (a *CONF) GetString(k string) string + func (a *CONF) Init() + func (a *CONF) InitBool() + func (a *CONF) InitByte() + func (a *CONF) InitConf() + func (a *CONF) InitFloat() + func (a *CONF) InitInt() + func (a *CONF) InitInterface() + func (a *CONF) InitString() + func (a *CONF) SetBool(k string, v bool) + func (a *CONF) SetByte(k string, v []byte) + func (a *CONF) SetConf(k string, v *CONF) + func (a *CONF) SetFloat(k string, v float64) + func (a *CONF) SetInt(k string, v int64) + func (a *CONF) SetInterface(k string, v interface{}) + func (a *CONF) SetString(k string, v string) type Server + func (s *Server) IsRunning() bool type ServerConfig + Debug bool + GracefulShutdown bool + MaxConnections int + TlsConfig *tls.Config + UseSSL bool type StaticVerMgr + TimerCallback func() bool + func (self *StaticVerMgr) Close() type TemplateMgr + TimerCallback func() bool + func (self *TemplateMgr) Close() v0.4.0 Sep 3, 2015 Changes in this version + var DefaultHtmlFilter = func(v string) (r string) + func Assign(name string, varOrFun interface{}) + func FixDirSeparator(dir string) string + func MultiAssign(t *T) + func Url(args ...string) string type Action + JsonpCallback string + func (c *Action) Assign(name string, varOrFunc interface{}) + func (c *Action) MultiAssign(t *T) + func (c *Action) ServeJsonp(obj interface{}, callback string) + type ActionInformation struct + ContentByte *[]byte + ContentString *string type App + Domain string + RequestTime time.Time + func (a *App) DelDomain() + func (a *App) IsRootApp() bool + func (a *App) SetDomain(domain string) + func (a *App) VisitedLog(req *http.Request, statusCode int, requestPath string, responseSize int64) + func (app *App) Assign(name string, varOrFun interface{}) + func (app *App) MultiAssign(t *T) + type FILE struct + Data string + type JSON struct + Data interface{} + type JSONP struct + Callback string + Data interface{} type Server + App2Domain map[string]string + Domain2App map[string]string + func (s *Server) Assign(name string, varOrFun interface{}) + func (s *Server) MultiAssign(t *T) + type ServerInformation struct type StaticVerMgr + Combined map[string][]string + Combines map[string]bool + func (self *StaticVerMgr) DeleteCombined(url string) + func (self *StaticVerMgr) IsCombined(combineUrl string) (ok bool) + func (self *StaticVerMgr) RecordCombined(fromUrl string, combineUrl string) + func (self *StaticVerMgr) RecordCombines(combineUrl string) + type XML struct + Data interface{} v0.3.0 Jul 4, 2015 Changes in this version + const Debug + const ForeBlack + const ForeBlue + const ForeCyan + const ForeGreen + const ForePurple + const ForeRed + const ForeWhite + const ForeYellow + const LevelCritical + const LevelDebug + const LevelError + const LevelInfo + const LevelTrace + const LevelWarn + 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 AddEvent(eventName string, handler func(interface{}, func(bool))) + func AddFilter(filter Filter) + 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 Base64Decode(val string) string + func Base64Encode(val string) string + func Close() + func CloseZWriter(zwriter io.Writer) + func Css(raw string) template.CSS + 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 Event(eventName string, session interface{}, next func(bool)) + 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 GoEvent(eventName string, session interface{}, next func(bool)) + 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, args ...interface{}) *http.Cookie + func NotFound(content ...string) error + func NotSupported(content ...string) error + func Now() time.Time + func PKCS5Padding(ciphertext []byte, blockSize int) []byte + func PKCS5UnPadding(origData []byte) []byte + func PageSize(total, limit int) int + func PrintGCSummary(w io.Writer) + func Process(w 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 + func ZeroPadding(ciphertext []byte, blockSize int) []byte + func ZeroUnPadding(origData []byte) []byte + 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 + ResponseSize int64 + 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(keys ...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) NewCookie(name string, value string, args ...interface{}) *http.Cookie + 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, args ...interface{}) + 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 AesCrypto struct + func (c *AesCrypto) Decode(cryptedData, authKey string) string + func (c *AesCrypto) Encode(rawData, authKey string) string + type App struct + Actions map[string]interface{} + ActionsMethodRoute map[string]map[string]string + 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(path string, args ...string) *App + func RootApp() *App + func (a *App) ElapsedTime() float64 + func (a *App) ElapsedTimeString() string + 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, int64) + 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 + AuthBasedOnCookie bool + CacheTemplates bool + CheckXsrf bool + CookieDomain string + CookieLimitIP bool + CookieLimitUA bool + CookiePrefix string + CookieSecret string + EnableHttpCache bool + FormMapToStruct bool + MaxUploadSize int64 + Mode int + ReloadTemplates bool + SessionOn bool + SessionTimeout time.Duration + StaticDir string + StaticFileVersion bool + TemplateDir string + type AutoResponse struct + func (s *AutoResponse) Do(c *Action, ret []reflect.Value) error + type Cryptor interface + Decode func(cryptedData, authKey string) string + Encode func(rawData, authKey string) string + var DefaultCryptor Cryptor = &AesCrypto{ ... } + type EventsInstance struct + var Events *EventsInstance = NewEvents() + func NewEvents() *EventsInstance + func (e *EventsInstance) Execute(eventName string, session interface{}, next func(bool)) + func (e *EventsInstance) GoExecute(eventName string, session interface{}, next func(bool)) + func (e *EventsInstance) Register(eventName string, handler func(interface{}, func(bool))) + type Filter interface + Do func(http.ResponseWriter, *http.Request) bool + type FromConversion interface + FromString func(content string) error + type JSONResponse struct + func (j *JSONResponse) Do(c *Action, ret []reflect.Value) error + type LoginFilter struct + AnonymousUrls []*regexp.Regexp + App *App + AskLoginUrls []*regexp.Regexp + 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 Response interface + Do func(ret []reflect.Value) + 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() + 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(w 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 + var DefaultStaticVerMgr *StaticVerMgr = new(StaticVerMgr) + 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 + var DefaultFuncs template.FuncMap = template.FuncMap{ ... } + var DefaultTemplateMgr *TemplateMgr = new(TemplateMgr) + 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 + type XMLResponse struct + func (x *XMLResponse) Do(c *Action, ret []reflect.Value) error + type XsrfCookieStorage struct + func (c *XsrfCookieStorage) Get(key string) string + func (c *XsrfCookieStorage) Init(a *Action) + func (c *XsrfCookieStorage) Set(key, val string) + func (c *XsrfCookieStorage) Valid(key, val string) bool + type XsrfManager interface + Get func(key string) string + Init func(*Action) + Set func(key, val string) + Valid func(key, val string) bool + var DefaultXsrfManager XsrfManager = &XsrfCookieStorage{} + type XsrfSessionStorage struct + func (c *XsrfSessionStorage) Get(key string) string + func (c *XsrfSessionStorage) Init(a *Action) + func (c *XsrfSessionStorage) Set(key, val string) + func (c *XsrfSessionStorage) Valid(key, val string) bool