Versions in this module Expand all Collapse all v1 v1.0.0 Dec 28, 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 DefaultFuncs template.FuncMap = template.FuncMap + var DefaultHtmlFilter = func(v string) (r string) + var ExtensionValidator = make(map[string]func(*App, http.ResponseWriter, *http.Request) bool) + 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 Assign(name string, varOrFun interface{}) + func AutoAction(c ...interface{}) + func AvgTime(items []time.Duration) time.Duration + func BuildUrl(route, appName, servName string, size int) string + func Close() + func CloseZWriter(zwriter io.Writer) + func Css(raw string) template.CSS + func DelEvent(eventName string) + 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 FixDirSeparator(dir string) string + 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 HtmlAttr(raw string) template.HTMLAttr + func InternalServerError(content ...string) error + func IsNil(a interface{}) bool + func JoinPath(paths ...string) string + func Js(raw string) template.JS + func MultiAssign(t *T) + 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 ToHtmlAttrs(raw map[string]interface{}) (r map[template.HTMLAttr]interface{}) + func UnTitle(s string) string + func Unauthorized(content ...string) error + func Url(args ...string) string + 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 + Exit bool + ExtensionName string + JsonpCallback string + Option *ActionOption + Request *http.Request + RequestBody []byte + ResponseSize int64 + StatusCode int + T T + func (c *Action) Abort(status int, body string) error + func (c *Action) Arg(k int) string + func (c *Action) Args() []string + func (c *Action) Assign(name string, varOrFunc interface{}) + func (c *Action) BasePath() string + func (c *Action) Body() []byte + func (c *Action) BuildUrl(m string, obj interface{}) (jurl string) + func (c *Action) Cookie(key string) string + func (c *Action) CookieAuthKey() 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) GetConfigString(name string) string + 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, args ...interface{}) 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) MultiAssign(t *T) + 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) (err 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) Self() interface{} + func (c *Action) ServeFile(fpath string) + func (c *Action) ServeJson(obj interface{}) + func (c *Action) ServeJsonp(obj interface{}, callback string) + func (c *Action) ServeXml(obj interface{}) + func (c *Action) Session() *httpsession.Session + func (c *Action) SetArg(k int, v string) bool + func (c *Action) SetBody(content []byte) error + func (c *Action) SetConfig(name string, value interface{}) + func (c *Action) SetConfigString(name string, value string) + 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 ActionInformation struct + ContentByte *[]byte + ContentString *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 + ActionValidator func(*App, reflect.Type, reflect.Value) bool + Actions map[string]interface{} + AppConfig *AppConfig + BasePath string + Config *CONF + ContentEncoding string + Controllers map[reflect.Type]*sync.Pool + Domain string + ErrorTemplate *template.Template + FuncMaps template.FuncMap + Logger *log.Logger + Name string + ReflectedType map[string]reflect.Type + RequestTime time.Time + RootTemplate *template.Template + Route *route.Route + RouteValidator func(*App, string) (string, error) + Server *Server + SessionManager *httpsession.Manager + StaticVerMgr *StaticVerMgr + TemplateEx *tplex.TemplateEx + Urls map[reflect.Type]map[string]*TagMapper + VarMaps T + func NewApp(path string, name string) *App + func RootApp() *App + func (a *App) Close() + func (a *App) DelDomain() + func (a *App) ElapsedTime() float64 + func (a *App) ElapsedTimeString() string + func (a *App) InitHeadContent(w http.ResponseWriter, contentLength int64) + func (a *App) IsRootApp() bool + func (a *App) SafelyCall(fn reflect.Value, args []reflect.Value) (resp []reflect.Value, err error) + func (a *App) SetDomain(domain string) + func (a *App) SetStaticDir(dir string) + func (a *App) SetTemplateDir(path string) + func (a *App) StaticUrl(url string) string + func (a *App) StructMap(m interface{}, r *http.Request) error + func (a *App) TryServingFile(name string, req *http.Request, w http.ResponseWriter) (bool, int64) + func (a *App) VisitedLog(req *http.Request, statusCode int, requestPath string, responseSize 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) Assign(name string, varOrFun interface{}) + 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) GetConfigString(name string) string + func (app *App) Info(params ...interface{}) + func (app *App) Infof(format string, params ...interface{}) + func (app *App) MultiAssign(t *T) + 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) SetConfigString(name string, val string) + 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 + StaticFileParser map[string]func(string, *http.Request, http.ResponseWriter) (bool, int64) + StaticFileVersion bool + TemplateDir string + TemplateStyle string + TemplateTheme string + func NewAppConfig() *AppConfig + type AutoResponse struct + func (s *AutoResponse) Do(c *Action, ret []reflect.Value) error + 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 NewCONF() *CONF + 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 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) Delete(eventName string) + 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 FILE struct + Data string + type Filter interface + Do func(http.ResponseWriter, *http.Request) bool + type FromConversion interface + FromString func(content string) error + type JSON struct + Data interface{} + type JSONP struct + Callback string + Data interface{} + type JSONResponse struct + Data interface{} + Message interface{} + Status int + func (j *JSONResponse) Do(c *Action, ret []reflect.Value) error + type JUMP struct + Code int + Url string + 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 Reflected struct + FieldAction reflect.Value + HasFieldAction bool + HasMethodAfter bool + HasMethodBefore bool + HasMethodInit bool + MethodAfter reflect.Value + MethodBefore reflect.Value + MethodByPath map[string]reflect.Value + MethodInit reflect.Value + NameV reflect.Value + StructV reflect.Value + type Response interface + Do func(ret []reflect.Value) + type SHOW struct + Tmpl string + type Server struct + App2Domain map[string]string + Apps map[string]*App + AppsNamePath map[string]string + Config *ServerConfig + Domain2App map[string]string + Env map[string]interface{} + Logger *log.Logger + Mux *http.ServeMux + Name string + RootApp *App + SessionManager *httpsession.Manager + func MainServer() *Server + func NewServer(name string, args ...*ServerConfig) *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) App(name string) *App + func (s *Server) Assign(name string, varOrFun interface{}) + func (s *Server) AutoAction(c ...interface{}) + func (s *Server) Close() + func (s *Server) GetConfig(name string) interface{} + func (s *Server) InitSession() + func (s *Server) IsRunning() bool + func (s *Server) MultiAssign(t *T) + func (s *Server) Process(w http.ResponseWriter, req *http.Request) + func (s *Server) Run(addr string) error + 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 + Debug bool + EnableGzip bool + GracefulShutdown bool + MaxConnections int + Port int + Profiler bool + RecoverPanic bool + SessionTimeout time.Duration + StaticExtensionsToGzip []string + StaticHtmlDir string + TlsConfig *tls.Config + Url string + UrlPrefix string + UrlSuffix string + UseSSL bool + var Config *ServerConfig = &ServerConfig{ ... } + var Servers map[string]*Server = make(map[string]*Server) + type ServerInformation struct + type StaticVerMgr struct + Caches map[string]string + Combined map[string][]string + Combines map[string]bool + Ignores map[string]bool + Path string + TimerCallback func() bool + 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) Close() + func (self *StaticVerMgr) DeleteCombined(url string) + func (self *StaticVerMgr) GetVersion(url string) string + func (self *StaticVerMgr) Init(app *App, staticPath string) error + func (self *StaticVerMgr) IsCombined(combineUrl string) (ok bool) + func (self *StaticVerMgr) Moniter(staticPath string) error + func (self *StaticVerMgr) RecordCombined(fromUrl string, combineUrl string) + func (self *StaticVerMgr) RecordCombines(combineUrl string) + type T map[string]interface + type TagMapper struct + Mapper map[string][2]string + Memo string + RawUrl string + func NewTagMapper(rawUrl string) *TagMapper + func (m *TagMapper) GenUrl(vals interface{}) (r string) + func (m *TagMapper) Replace(r string, v string, mapper [2]string) string + type ToConversion interface + ToString func() string + type XML struct + Data interface{} + type XMLResponse struct + Data interface{} + Message interface{} + Status int + 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