Versions in this module Expand all Collapse all v1 v1.14.0 May 11, 2020 v1.13.2 Mar 6, 2020 v1.13.1 Mar 6, 2020 v1.13.0 Mar 5, 2020 v1.2.0 May 16, 2014 Changes in this version + const AfterStatic + const FDKey + const LevelInfo + const LevelTrace + var AdminHttpAddr string + var AdminHttpPort int + var AppConfigPath string + var AppName string + var AutoRender bool + var BeeApp *App + var BeeLogger *logs.BeeLogger + var BeeTemplateExt []string + var BeeTemplates map[string]*template.Template + var BeegoServerName string + var CopyRequestBody bool + var DirectoryIndex bool + var EnableAdmin bool + var EnableGzip bool + var EnableHotUpdate bool + var EnableXSRF bool + var ErrClosing = errors.New("use of closed network connection") + var ErrInitStart = errors.New("init from") + var ErrorsShow bool + var FlashName string + var FlashSeperator string + var FormType = map[string]bool + var HttpAddr string + var HttpCertFile string + var HttpKeyFile string + var HttpPort int + var HttpServerTimeOut int64 + var HttpTLS bool + var MaxMemory int64 + var RecoverPanic bool + var RunMode string + var SessionAutoSetCookie bool + var SessionCookieLifeTime int + var SessionGCMaxLifetime int64 + var SessionHashFunc string + var SessionHashKey string + var SessionName string + var SessionOn bool + var SessionProvider string + var SessionSavePath string + var StaticDir map[string]string + var StaticExtensionsToGzip []string + var TemplateCache map[string]*template.Template + var TemplateLeft string + var TemplateRight string + var USERSTOPRUN = errors.New("User stop run") + var UseFcgi bool + var ViewsPath string + var XSRFExpire int + var XSRFKEY string + func AssetsCss(src string) template.HTML + func CloseSelf() error + func GetInitListener(tcpaddr *net.TCPAddr) (l net.Listener, err error) + func Html2str(html string) string + func ParseConfig() (err error) + func Restart(l net.Listener) error + func TestBeegoInit(apppath string) + func UrlFor(endpoint string, values ...string) string + func WaitSignal(l net.Listener) error type App + func AddFilter(pattern, action string, filter FilterFunc) *App + func AddGroupRouter(prefix string, groups GroupRouters) *App + func Errorhandler(err string, h http.HandlerFunc) *App + func (app *App) Any(rootpath string, f FilterFunc) *App + func (app *App) AutoRouter(c ControllerInterface) *App + func (app *App) AutoRouterWithPrefix(prefix string, c ControllerInterface) *App + func (app *App) DelStaticPath(url string) *App + func (app *App) Delete(rootpath string, f FilterFunc) *App + func (app *App) Filter(pattern, action string, filter FilterFunc) *App + func (app *App) Get(rootpath string, f FilterFunc) *App + func (app *App) Handler(rootpath string, h http.Handler, options ...interface{}) *App + func (app *App) Head(rootpath string, f FilterFunc) *App + func (app *App) InsertFilter(pattern string, pos int, filter FilterFunc) *App + func (app *App) Options(rootpath string, f FilterFunc) *App + func (app *App) Patch(rootpath string, f FilterFunc) *App + func (app *App) Post(rootpath string, f FilterFunc) *App + func (app *App) Put(rootpath string, f FilterFunc) *App + func (app *App) Router(path string, c ControllerInterface, mappingMethods ...string) *App + func (app *App) SetStaticPath(url string, path string) *App + func (app *App) SetViewsPath(path string) *App + func (app *App) UrlFor(endpoint string, values ...string) string type Controller + CruSession session.SessionStore + Ctx *context.Context + Data map[interface{}]interface{} + EnableXSRF bool + TplNames string + XSRFExpire int + func (c *Controller) Abort(code string) + func (c *Controller) CheckXsrfCookie() bool + func (c *Controller) DelSession(name interface{}) + func (c *Controller) GetBool(key string) (bool, error) + func (c *Controller) GetControllerAndAction() (controllerName, actionName string) + func (c *Controller) GetFile(key string) (multipart.File, *multipart.FileHeader, error) + func (c *Controller) GetFloat(key string) (float64, error) + func (c *Controller) GetInt(key string) (int64, error) + func (c *Controller) GetSecureCookie(Secret, key string) (string, bool) + func (c *Controller) GetSession(name interface{}) interface{} + func (c *Controller) GetString(key string) string + func (c *Controller) GetStrings(key string) []string + func (c *Controller) Input() url.Values + func (c *Controller) IsAjax() bool + func (c *Controller) SaveToFile(fromfile, tofile string) error + func (c *Controller) ServeFormatted() + func (c *Controller) ServeJson(encoding ...bool) + func (c *Controller) ServeJsonp() + func (c *Controller) ServeXml() + func (c *Controller) SetSecureCookie(Secret, name, value string, others ...interface{}) + func (c *Controller) SetSession(name interface{}, value interface{}) + func (c *Controller) StartSession() session.SessionStore + func (c *Controller) UrlFor(endpoint string, values ...string) string + func (c *Controller) XsrfFormHtml() string + func (c *Controller) XsrfToken() string type ControllerInterface + CheckXsrfCookie func() bool + XsrfToken func() string + type ControllerRegistor struct + func NewControllerRegistor() *ControllerRegistor + func (p *ControllerRegistor) Add(pattern string, c ControllerInterface, mappingMethods ...string) + func (p *ControllerRegistor) AddAuto(c ControllerInterface) + func (p *ControllerRegistor) AddAutoPrefix(prefix string, c ControllerInterface) + func (p *ControllerRegistor) AddFilter(pattern, action string, filter FilterFunc) error + func (p *ControllerRegistor) AddMethod(method, pattern string, f FilterFunc) + func (p *ControllerRegistor) Any(pattern string, f FilterFunc) + func (p *ControllerRegistor) Delete(pattern string, f FilterFunc) + func (p *ControllerRegistor) Get(pattern string, f FilterFunc) + func (p *ControllerRegistor) Handler(pattern string, h http.Handler, options ...interface{}) + func (p *ControllerRegistor) Head(pattern string, f FilterFunc) + func (p *ControllerRegistor) InsertFilter(pattern string, pos int, filter FilterFunc) error + func (p *ControllerRegistor) Options(pattern string, f FilterFunc) + func (p *ControllerRegistor) Patch(pattern string, f FilterFunc) + func (p *ControllerRegistor) Post(pattern string, f FilterFunc) + func (p *ControllerRegistor) Put(pattern string, f FilterFunc) + func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) + func (p *ControllerRegistor) UrlFor(endpoint string, values ...string) string + type GroupRouters []groupRouter + func NewGroupRouters() GroupRouters + func (gr *GroupRouters) AddAuto(c ControllerInterface) + func (gr *GroupRouters) AddRouter(pattern string, c ControllerInterface, mappingMethod ...string) type Namespace + func (n *Namespace) ServeHTTP(rw http.ResponseWriter, r *http.Request) v1.1.1 Feb 23, 2020 v1.1.0 Aug 29, 2019 v1.0.0 Jul 22, 2019 Changes in this version + const AfterExec + const BeforeExec + const BeforeRouter + const BeforeStatic + const DEV + const FinishRouter + const LevelAlert + const LevelCritical + const LevelDebug + const LevelEmergency + const LevelError + const LevelInformational + const LevelNotice + const LevelWarning + const PROD + const VERSION + var AppConfig *asanaAppConfig + var AppPath string + var AsanaLogger = logs.GetAsanaLogger() + var BConfig *Config + var ErrAbort = errors.New("user stop run") + var ErrorMaps = make(map[string]*errorInfo, 10) + var FilterMonitorFunc func(string, string, time.Duration, string, int) bool + var GlobalControllerRouter = make(map[string][]ControllerComments) + var GlobalSessions *session.Manager + func AddAPPStartHook(hf ...hookFunc) + func AddFuncMap(key string, fn interface{}) error + func AddNamespace(nl ...*Namespace) + func AddTemplateExt(ext string) + func AddViewPath(viewPath string) error + func Alert(v ...interface{}) + func AssetsCSS(text string) template.HTML + func AssetsJs(text string) template.HTML + func BuildTemplate(dir string, files ...string) error + func Compare(a, b interface{}) (equal bool) + func CompareNot(a, b interface{}) (equal bool) + func Critical(v ...interface{}) + func Date(t time.Time, format string) string + func DateFormat(t time.Time, layout string) (dateString string) + func DateParse(dateString, format string) (time.Time, error) + func Debug(v ...interface{}) + func Emergency(v ...interface{}) + func Error(v ...interface{}) + func ExceptMethodAppend(action string) + func Exception(errCode uint64, ctx *context.Context) + func ExecuteTemplate(wr io.Writer, name string, data interface{}) error + func ExecuteViewPathTemplate(wr io.Writer, name string, viewPath string, data interface{}) error + func GetConfig(returnType, key string, defaultVal interface{}) (value interface{}, err error) + func HTML2str(html string) string + func HasTemplateExt(paths string) bool + func Htmlquote(text string) string + func Htmlunquote(text string) string + func Info(v ...interface{}) + func Informational(v ...interface{}) + func InitAsanaBeforeTest(appConfigPath string) + func LoadAppConfig(source source.Source) error + func LogAccess(ctx *context.Context, startTime *time.Time, statusCode int) + func MapGet(arg1 interface{}, arg2 ...interface{}) (interface{}, error) + func NotNil(a interface{}) (isNil bool) + func Notice(v ...interface{}) + func ParseForm(form url.Values, obj interface{}) error + func Policy(pattern, method string, policy ...PolicyFunc) + func RenderForm(obj interface{}) template.HTML + func Run(params ...string) + func RunWithMiddleWares(addr string, mws ...MiddleWare) + func SetLevel(l int) + func SetLogFuncCall(b bool) + func SetLogger(adapterName string, config string) error + func SetTemplateFSFunc(fnt templateFSFunc) + func Str2html(raw string) template.HTML + func Substr(s string, start, length int) string + func TestAsanaInit(ap string) + func Trace(v ...interface{}) + func URLFor(endpoint string, values ...interface{}) string + func Walk(fs http.FileSystem, root string, walkFn filepath.WalkFunc) error + func Warn(v ...interface{}) + func Warning(v ...interface{}) + type App struct + Handlers *ControllerRegister + Server *http.Server + var AsanaApp *App + func AddTemplateEngine(extension string, fn templatePreProcessor) *App + func Any(rootPath string, f FilterFunc) *App + func AutoPrefix(prefix string, c ControllerInterface) *App + func AutoRouter(c ControllerInterface) *App + func DelStaticPath(url string) *App + func Delete(rootPath string, f FilterFunc) *App + func ErrorController(c ControllerInterface) *App + func ErrorHandler(code string, h http.HandlerFunc) *App + func Get(rootPath string, f FilterFunc) *App + func Handler(rootPath string, h http.Handler, options ...interface{}) *App + func Head(rootPath string, f FilterFunc) *App + func Include(cList ...ControllerInterface) *App + func InsertFilter(pattern string, pos int, filter FilterFunc, params ...bool) *App + func NewApp() *App + func Options(rootPath string, f FilterFunc) *App + func Patch(rootPath string, f FilterFunc) *App + func Post(rootPath string, f FilterFunc) *App + func Put(rootPath string, f FilterFunc) *App + func RESTRouter(rootPath string, c ControllerInterface) *App + func Router(rootPath string, c ControllerInterface, mappingMethods ...string) *App + func SetStaticPath(url string, path string) *App + func SetViewsPath(path string) *App + func UnregisterFixedRoute(fixedRoute string, method string) *App + func (app *App) Run(mws ...MiddleWare) + type Config struct + AppName string + CopyRequestBody bool + EnableErrorsRender bool + EnableErrorsShow bool + EnableGzip bool + Listen Listen + Log LogConfig + MaxMemory int64 + RecoverFunc func(*context.Context) + RecoverPanic bool + RouterCaseSensitive bool + RunMode string + ServerName string + WebConfig WebConfig + type Controller struct + AppController interface{} + EnableRender bool + Layout string + LayoutSections map[string]string + TplExt string + TplName string + TplPrefix string + ViewPath string + func (c *Controller) CustomAbort(status int, body string) + func (c *Controller) Delete() + func (c *Controller) DestroySession() + func (c *Controller) Finish() + func (c *Controller) Get() + func (c *Controller) GetXSRFToken() string + func (c *Controller) HandlerFunc(fnName string) bool + func (c *Controller) Head() + func (c *Controller) Init(ctx *context.Context, controllerName, actionName string, app interface{}) + func (c *Controller) Mapping(method string, fn func()) + func (c *Controller) Options() + func (c *Controller) ParseBody(obj interface{}) error + func (c *Controller) ParseForm(obj interface{}) error + func (c *Controller) Patch() + func (c *Controller) Post() + func (c *Controller) Prepare() + func (c *Controller) Put() + func (c *Controller) Redirect(url string) error + func (c *Controller) Render() error + func (c *Controller) RenderBytes() ([]byte, error) + func (c *Controller) RenderString() (string, error) + func (c *Controller) SessionRegenerateID() + func (c *Controller) StopRun() + func (c *Controller) Trace() + func (c *Controller) URLFor(endpoint string, values ...interface{}) string + func (c *Controller) URLMapping() + type ControllerComments struct + AllowHTTPMethods []string + FilterComments []*ControllerFilterComments + Filters []*ControllerFilter + ImportComments []*ControllerImportComments + Method string + MethodParams []*param.MethodParam + Params []map[string]string + Router string + type ControllerCommentsSlice []ControllerComments + func (p ControllerCommentsSlice) Len() int + func (p ControllerCommentsSlice) Less(i, j int) bool + func (p ControllerCommentsSlice) Swap(i, j int) + type ControllerFilter struct + Filter FilterFunc + Pattern string + Pos int + ResetParams bool + ReturnOnOutput bool + type ControllerFilterComments struct + Filter string + Pattern string + Pos int + ResetParams bool + ReturnOnOutput bool + type ControllerImportComments struct + ImportAlias string + ImportPath string + type ControllerInfo struct + type ControllerInterface interface + CheckXSRFCookie func() bool + Delete func() + Finish func() + Get func() + HandlerFunc func(fn string) bool + Head func() + Init func(ct *context.Context, controllerName, actionName string, app interface{}) + Options func() + Patch func() + Post func() + Prepare func() + Put func() + Render func() error + Trace func() + URLMapping func() + XSRFToken func() string + type ControllerRegister struct + func NewControllerRegister() *ControllerRegister + func (p *ControllerRegister) Add(pattern string, c ControllerInterface, mappingMethods ...string) + func (p *ControllerRegister) AddAuto(c ControllerInterface) + func (p *ControllerRegister) AddAutoPrefix(prefix string, c ControllerInterface) + func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) + func (p *ControllerRegister) Any(pattern string, f FilterFunc) + func (p *ControllerRegister) Delete(pattern string, f FilterFunc) + func (p *ControllerRegister) FindPolicy(cont *context.Context) []PolicyFunc + func (p *ControllerRegister) FindRouter(context *context.Context) (routerInfo *ControllerInfo, isFind bool) + func (p *ControllerRegister) Get(pattern string, f FilterFunc) + func (p *ControllerRegister) Handler(pattern string, h http.Handler, options ...interface{}) + func (p *ControllerRegister) Head(pattern string, f FilterFunc) + func (p *ControllerRegister) Include(cList ...ControllerInterface) + func (p *ControllerRegister) InsertFilter(pattern string, pos int, filter FilterFunc, params ...bool) error + func (p *ControllerRegister) Options(pattern string, f FilterFunc) + func (p *ControllerRegister) Patch(pattern string, f FilterFunc) + func (p *ControllerRegister) Post(pattern string, f FilterFunc) + func (p *ControllerRegister) Put(pattern string, f FilterFunc) + func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request) + func (p *ControllerRegister) URLFor(endpoint string, values ...interface{}) string + type FileSystem struct + func (d FileSystem) Open(name string) (http.File, error) + type FilterFunc func(*context.Context) + type FilterHandler interface + Filter func(*context.Context) bool + var DefaultAccessLogFilter FilterHandler = &logFilter{} + var HTTPMETHOD = map[string]bool{ ... } + type FilterRouter struct + func (f *FilterRouter) ValidRouter(url string, ctx *context.Context) bool + type FlashData struct + Data map[string]string + func NewFlash() *FlashData + func ReadFromRequest(c *Controller) *FlashData + func (fd *FlashData) Error(msg string, args ...interface{}) + func (fd *FlashData) Notice(msg string, args ...interface{}) + func (fd *FlashData) Set(key string, msg string, args ...interface{}) + func (fd *FlashData) Store(c *Controller) + func (fd *FlashData) Success(msg string, args ...interface{}) + func (fd *FlashData) Warning(msg string, args ...interface{}) + type LinkNamespace func(*Namespace) + func NSAfter(filterList ...FilterFunc) LinkNamespace + func NSAny(rootPath string, f FilterFunc) LinkNamespace + func NSAutoPrefix(prefix string, c ControllerInterface) LinkNamespace + func NSAutoRouter(c ControllerInterface) LinkNamespace + func NSBefore(filterList ...FilterFunc) LinkNamespace + func NSCond(cond namespaceCond) LinkNamespace + func NSDelete(rootPath string, f FilterFunc) LinkNamespace + func NSGet(rootPath string, f FilterFunc) LinkNamespace + func NSHandler(rootPath string, h http.Handler) LinkNamespace + func NSHead(rootPath string, f FilterFunc) LinkNamespace + func NSInclude(cList ...ControllerInterface) LinkNamespace + func NSNamespace(prefix string, params ...LinkNamespace) LinkNamespace + func NSOptions(rootPath string, f FilterFunc) LinkNamespace + func NSPatch(rootPath string, f FilterFunc) LinkNamespace + func NSPost(rootPath string, f FilterFunc) LinkNamespace + func NSPut(rootPath string, f FilterFunc) LinkNamespace + func NSRouter(rootPath string, c ControllerInterface, mappingMethods ...string) LinkNamespace + type Listen struct + AdminAddr string + AdminPort int + AutoTLS bool + Domains []string + EnableAdmin bool + EnableFcgi bool + EnableHTTP bool + EnableHTTPS bool + EnableMutualHTTPS bool + EnableStdIo bool + Graceful bool + HTTPAddr string + HTTPPort int + HTTPSAddr string + HTTPSCertFile string + HTTPSKeyFile string + HTTPSPort int + ListenTCP4 bool + ServerTimeOut int64 + TLSCacheDir string + TrustCaFile string + type LogConfig struct + AccessLogs bool + AccessLogsFormat string + EnableStaticLogs bool + FileLineNum bool + Outputs map[string]string + type M map[string]interface + func PrintTree() M + type MiddleWare func(http.Handler) http.Handler + type Namespace struct + func NewNamespace(prefix string, params ...LinkNamespace) *Namespace + func (n *Namespace) Any(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) AutoPrefix(prefix string, c ControllerInterface) *Namespace + func (n *Namespace) AutoRouter(c ControllerInterface) *Namespace + func (n *Namespace) Cond(cond namespaceCond) *Namespace + func (n *Namespace) Delete(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Filter(action string, filter ...FilterFunc) *Namespace + func (n *Namespace) Get(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Handler(rootPath string, h http.Handler) *Namespace + func (n *Namespace) Head(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Include(cList ...ControllerInterface) *Namespace + func (n *Namespace) Namespace(ns ...*Namespace) *Namespace + func (n *Namespace) Options(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Patch(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Post(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Put(rootPath string, f FilterFunc) *Namespace + func (n *Namespace) Router(rootPath string, c ControllerInterface, mappingMethods ...string) *Namespace + type PolicyFunc func(*context.Context) + type SessionConfig struct + SessionAutoSetCookie bool + SessionCookieLifeTime int + SessionDisableHTTPOnly bool + SessionDomain string + SessionEnableSidInHTTPHeader bool + SessionEnableSidInURLQuery bool + SessionGCMaxLifetime int64 + SessionName string + SessionNameInHTTPHeader string + SessionOn bool + SessionProvider string + SessionProviderConfig string + type Tree struct + func NewTree() *Tree + func (t *Tree) AddRouter(pattern string, runObject interface{}) + func (t *Tree) AddTree(prefix string, tree *Tree) + func (t *Tree) Match(pattern string, ctx *context.Context) (runObject interface{}) + type WebConfig struct + AutoRender bool + DirectoryIndex bool + EnableDocs bool + EnableXSRF bool + FlashName string + FlashSeparator string + Session SessionConfig + StaticDir map[string]string + StaticExtensionsToGzip []string + TemplateLeft string + TemplateRight string + ViewsPath string + XSRFExpire int + XSRFKey string