Versions in this module Expand all Collapse all v1 v1.12.2 Dec 24, 2020 v1.12.1 Dec 8, 2020 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 *beegoAppConfig + var AppPath string + var BConfig *Config + var BeeLogger = logs.GetBeeLogger() + 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 InitBeegoBeforeTest(appConfigPath string) + func LoadAppConfig(adapterName, configPath string) error + func LogAccess(ctx *beecontext.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 TestBeegoInit(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 BeeApp *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{} + CruSession session.Store + Ctx *context.Context + Data map[interface{}]interface{} + EnableRender bool + EnableXSRF bool + Layout string + LayoutSections map[string]string + TplExt string + TplName string + TplPrefix string + ViewPath string + XSRFExpire int + func (c *Controller) Abort(code string) + func (c *Controller) CheckXSRFCookie() bool + func (c *Controller) CustomAbort(status int, body string) + func (c *Controller) DelSession(name interface{}) + func (c *Controller) Delete() + func (c *Controller) DestroySession() + func (c *Controller) Finish() + func (c *Controller) Get() + func (c *Controller) GetBool(key string, def ...bool) (bool, error) + func (c *Controller) GetControllerAndAction() (string, string) + func (c *Controller) GetFile(key string) (multipart.File, *multipart.FileHeader, error) + func (c *Controller) GetFiles(key string) ([]*multipart.FileHeader, error) + func (c *Controller) GetFloat(key string, def ...float64) (float64, error) + func (c *Controller) GetInt(key string, def ...int) (int, error) + func (c *Controller) GetInt16(key string, def ...int16) (int16, error) + func (c *Controller) GetInt32(key string, def ...int32) (int32, error) + func (c *Controller) GetInt64(key string, def ...int64) (int64, error) + func (c *Controller) GetInt8(key string, def ...int8) (int8, error) + func (c *Controller) GetSecureCookie(Secret, key string) (string, bool) + func (c *Controller) GetSession(name interface{}) interface{} + func (c *Controller) GetString(key string, def ...string) string + func (c *Controller) GetStrings(key string, def ...[]string) []string + func (c *Controller) GetUint16(key string, def ...uint16) (uint16, error) + func (c *Controller) GetUint32(key string, def ...uint32) (uint32, error) + func (c *Controller) GetUint64(key string, def ...uint64) (uint64, error) + func (c *Controller) GetUint8(key string, def ...uint8) (uint8, error) + 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) Input() url.Values + func (c *Controller) IsAjax() bool + func (c *Controller) Mapping(method string, fn func()) + func (c *Controller) Options() + 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, code int) + func (c *Controller) Render() error + func (c *Controller) RenderBytes() ([]byte, error) + func (c *Controller) RenderString() (string, error) + func (c *Controller) SaveToFile(fromfile, tofile string) error + func (c *Controller) ServeFormatted(encoding ...bool) + func (c *Controller) ServeJSON(encoding ...bool) + func (c *Controller) ServeJSONP() + func (c *Controller) ServeXML() + func (c *Controller) ServeYAML() + func (c *Controller) SessionRegenerateID() + func (c *Controller) SetData(data interface{}) + func (c *Controller) SetSecureCookie(Secret, name, value string, others ...interface{}) + func (c *Controller) SetSession(name interface{}, value interface{}) + func (c *Controller) StartSession() session.Store + func (c *Controller) StopRun() + func (c *Controller) Trace() + func (c *Controller) URLFor(endpoint string, values ...interface{}) string + func (c *Controller) URLMapping() + func (c *Controller) XSRFFormHTML() string + func (c *Controller) XSRFToken() string + 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 *beecontext.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(*beecontext.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