Releases: devfeel/dotweb
Releases · devfeel/dotweb
Add DotWeb.ReSetConfig & NotifyPlugin
Version 1.7.0
- New Feature: 新增NotifyPlugin插件,默认集成监控配置文件变化热重启
- New Feature: 新增DotWeb.ReSetConfig用于运行时重载配置
- About NotifyPlugin:
- 通过NewDefaultNotifyPlugin创建默认集成的NotifyPlugin
- 仅当Dotweb通过配置文件启动方式下有效,监测默认的配置文件
- 当热重启配置文件时,Dotweb本身监听端口以及pprod设置不会重载
- 感谢@地蛋对该插件的支持
- 2019-07-22 14:00 at ShangHai
增加插件机制,修正重要类型命名错误(兼容到2.0版本之前)
Version 1.6.9
- New Feature: 增加插件机制-Plugin,随App启动一起执行,不会阻塞App启动过程,如需持续运行,在Plugin的Run中自行处理即可。
- Architecture: 修正BaseMiddlware命名错误,增加BaseMiddleware,保留BaseMiddlware至2.0版本前
- About Plugin:
- 通过dotweb.UsePlugin注册插件
- 自定义插件需事先Plugin接口
- 即将发布集成插件 - 监控配置文件变化热重启插件
- 2019-07-12 12:00 at ShangHai
Remove OfflineServer & Remove render\developmode\start examples
Version 1.6.8
- Architecture: Remove OfflineServer
- Example: Remove render\developmode\start examples
- Bug fix: update latest tag to v1.6.8 for go modules
- About examples:
- You can visit https://github.com/devfeel/dotweb-example to know more examples for dotweb.
- 2019-06-29 21:00 at ShangHai.Home
Add Go Module Support & Remove vendor
Version 1.6.7
- New Feature: Add Go Module Support
- Architecture: Remove vendor
- 2019-06-29 15:00 at ShangHai.Home
Architecture & New Feature
Version 1.6.6
- New Feature: Add AccessLog middleware for logging HTTP requests in the Apache Common Log Format.
- New Feature: Add Raw() in dotweb.Logger
- About AccessLog:
- implement the Apache Common Log Format
- log file name like "dotweb_accesslog_2017_06_09.log"
- log-example: 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
- How to use AccessLog middleware:
app.Use(accesslog.Middleware())
server.GET("/", Index).Use(accesslog.Middleware())- 2019-06-27 23:00 at 深圳华安大酒店
Version 1.6.5
- Architecture: move core.GlobalState to dotweb.StateInfo()
- Architecture: add HttpServer.StateInfo() who is a shortcut for DotWeb.StateInfo()
- Remove: remove unused property valueNodePool in router
- About dotweb.StateInfo:
- you can use ctx.HttpServer().StateInfo() to get this object
- you can visit /virtualPath/dotweb/state to list all state info
- 2019-06-26 08:00
Version 1.6.4
- Architecture: add dotweb_sysgroup.go to implement IncludeDotwebGroup
- New Feature: add /virtualPath/dotweb/routers to list all router express
- New Feature: add Router.GetAllRouterExpress to return router.allRouterExpress
- Bug Fixed: update example on dotweb version 1.6.4
- About dotweb.IncludeDotwebGroup:
- if use dotweb.New(), in default it will not call IncludeDotwebGroup
- if use dotweb.Classic(), in default it will call IncludeDotwebGroup
- 2019-06-22 16:00
Version 1.6.3
- Architecture: move logger.Logger() to DotWeb.Logger()
- Architecture: add HttpServer.Logger who is a shortcut for DotWeb.Logger()
- Architecture: remove logger.Logger()
- How to use dotweb.Logger in your app:
func TestLog(ctx dotweb.Context) error { ctx.HttpServer().Logger().Info(dotweb.LogTarget_Default, "test log") return ctx.WriteString("log page") }
- 2019-06-13 12:00
Version 1.6.2
- Bug fixed: cryptos.GetRandString used to returns randominzed string with given length
- Detail:
- default character set is "0123456789abcdefghijklmnopqrstuvwxyz"
- Demo:
func main() { fmt.Println(cryptos.GetRandString(10)) }
- 2019-02-20 14:00
Version 1.6.1
- New Feature: RouterNode add RouterNode.Path() to get routing path for the request
- Detail:
- you can use ctx.RouterNode().Path() to get routing path for the request
- you can use ctx.HttpServer().Router().MatchPath to match request and routing path
- Demo:
func main() { app := dotweb.Classic("/home/logs/wwwroot/") // if use this, all router will auto add "HEAD" method support // default is false app.HttpServer.SetEnabledAutoHEAD(true) app.HttpServer.GET("/index", func(ctx dotweb.Context) error{ flag := ctx.HttpServer().Router().MatchPath(ctx, "/index") return ctx.WriteString("welcome to my first web!" + ctx.RouterNode().Path() + " - " + fmt.Sprint(flag)) }) err := app.StartServer(80) fmt.Println("dotweb.StartServer error => ", err) }
- 2019-02-12 16:00
Version 1.6!
【dotweb百版大战】 - https://github.com/devfeel/dotweb
正临新年之际,dotweb百版大战捷报传来!自创立以来,顺利完成100个版本的发布,感谢各位。
版本正式升级为1.6!
Version 1.6
- New Feature: HttpServer add SetIndexPage used to config default index-page name, default is "index.html"
- New Feature: Fix UT and add scripts for UT
- New Feature: Add IDGenerate define the handler for create Unique Id
- New Feature: Add dotweb.DefaultUniqueIDGenerater which is default generater used to create Unique Id
- New Feature: HttpServer & Router add RegisterServerFile use to register ServerFile router with routeMethod method on http.FileServer
- Fixed Bug: Request.IsAJAX check X-Requested-With Contains XMLHttpRequest
- New Feature: Add Request.RealIP used to returns the first ip from 'X-Forwarded-For' or 'X-Real-IP' header key, fixed for #164
- New Feature: route.ServerFile support 'filepath' or '/', to simplify register static file router, fixed for #125
- New Feature: Response support http2 Push
- Fix typo and translate Chinse to English
- Translate Chinse to English
- Fix UT in cache/runtime
- Remove invalid lock in cache/runtime
- Update: ServerFile add support for EnabledAutoHEAD\EnabledAutoOPTIONS
- Update: Add "GlobalUniqueID : XXXXXXXXXXXXXXXXXXX" on state page, you can view "host/dotweb/state"
- Enabled AutoOPTIONS\AutoHEAD flag when app is on RunMode_Development mode
- Remove: remove all features in dotweb!
- Remove: remove ServerConfig().EnabledAutoCORS.
- Add: add example/README.md
- Fix Bug for #184 ServerFile不能正确获取SessionID()
- Fix Bug for HttpServer.EnabledAutoOPTIONS, use DefaultAutoOPTIONSHandler replace user-handler to bind auto-options router
- Fixed Bug: Request.IsAJAX check X-Requested-With Contains XMLHttpRequest
dotweb的每一小步成长,离不开大家的帮助,感谢。
https://github.com/devfeel/dotweb
Add TimeoutHook & Mock
Version 1.5.7
- New Feature: Add integration Timeout Middleware, support DotWeb.UseTimeoutHook to use it
- Detail:
- Provide DefaultTimeoutHookHandler to simplify use, it will auto write log the req info which time out
- Example:
app.UseTimeoutHook(dotweb.DefaultTimeoutHookHandler, time.Second * 2)
- New Feature: Add Mock module, support DotWeb.SetMock to use it
- Detail:
- Provide StandardMock to simplify use, it implement Mock interface
- also you can create custom implement
- you can register MockHandle or register return string
- register key only support route
- special: mock mode only effective in DevelopMode
- Example:
func AppMock() dotweb.Mock{ m := dotweb.NewStandardMock() m.RegisterString("/", "mock data") return m } app.SetMock(AppMock())
- 2018-08-22 10:00
Renderer Cache & Validator & Session & Hystrix
Version 1.5.6.1
- BugFixed: hystrix add doCleanHistoryCounter, used to clean history counter
- 2018-08-18 10:00
Version 1.5.6
- New feature: add hystrix module, now is used to auto switch to backup redis session store
- New feature: Session.StoreConfig support BackupServerUrl, used to store session when default ServerIP redis is not available
- Detail:
- hystrix default MaxFailedNumber is 20 per 2 minutes
- Example:
sessionConf := session.NewDefaultRedisConfig("redis://10.10.0.1:6322/1") sessionConf.BackupServerUrl = "redis://10.10.0.1:6379/1"
- 2018-08-17 15:00
Version 1.5.5
- New feature: /dotweb/state add CurrentRequestCount data
- Update: improve 30% performance on app's metric
- 2018-08-09 15:00
Version 1.5.4
- New feature: Session.StoreConfig support CookieName, used to set custom cookie name which sessionid store, default is dotweb_sessionId
- Update: Config.SessionNode add CookieName, used to set custom cookie name which sessionid store
- Update: default log format update to "Time [LogLevel] [FileName:Line] Content"
- BugFixed: remove init session which exec on dotweb.initAppConfig
- 2018-08-02 15:00
Version 1.5.3
- New feature: HttpServer add Validator which be called by Context.Validate()
- New feature: Context add Validate(interface{}) used to validate data with HttpServer::Validator
- Update: use routerExpressSplit replace "_" when padding data to Router::RouterExpress
- 2018-07-12 12:00
Version 1.5.2
- New feature: dotweb.innerRenderer add cache mode, default is enabled
- New feature: dotweb.innerRenderer add NewInnerRendererNoCache() used to disabled cache
- Update for app run_mode: if it's develop run mode, the default renderer will use no cache mode
- 2018-06-22 14:00
Version 1.5.1
- Fixed Bug: double sprintf on logger.xlog
- 2018-06-15 14:00
dotweb released to Version 1.5
What's new?
重要:go版本适配升级为1.9+
New features:
- New feature:UploadFile.RandomFileName used to get random file name from uuid
- New feature: encodes.base64x used to quickly use base64 EncodeString and DecodeString
- New feature: session.NewRedisConfig use to create redis session config include serverUrl and storeKeyPre
- if you set custom storeKeyPre, it will be store key start with custom set, default is "dotweb:session:"
- New feature: framewrok.RedisClient add Ping(), to check redis is alived
- New feature: DevelopmentMode:default UseLog,default use RequestLogMiddleware,default Console Print
- New feature: 状态页:访问/dotweb/state时增加CurrentTime字段输出
- New feature: GetSessionStore add Redis Ping check,if not alived, it will be panic error
- New feature: add dotweb.ClassicWithConf(config *config.Config),support Start server with custom config
- New feature:完善RedisClient接口能力
Bug fixed:
- fixed: for #114 dotweb: fix error found by vet
- fixed: for #122 - dotweb没有打出 access log
- fixed: 修正Reponse自动释放时未重置body字段,导致内存溢出BUG
- fixed: for #112 自定义处理异常的时候设置返回数据的content-type 但是没有生效
调整:
- 合并const目录内容至consts文件,统一const定义文件
- 移除example/static
- 新增example/developmode,便于对developmode的理解
- 调整: dotweb.Classic移除自动UseRequestLog逻辑
- 调整:Session Redis模式时,新增sessionReExpire用于重置有效期,避免调用SessionUpdate导致不必要的redis数据交换
- 调整:Cache.Runtime调整map为sync.Map
- 调整:Session Redis模式时,gob.EncodeMap逻辑调整,移除自动注册interface{}
- 调整:UploadFile.Size实现方法,直接返回Header.Size数据
- 调整:dotweb.Classic签名为Classic(logPath string),若传入logPath为空,则默认以"bin-root/logs"为日志目录
- 调整:默认Log目录由"bin-root"为"bin-root/logs"
- 调整:CharsetUTF8值为"charset=utf-8"
- 调整:内置Vendor目录仅保留 golang.org/x/net包,移除redis与yaml包
新增Config.IncludeConfigSet,ItemContext更名为ItemMap,新增ConcurrenceMap、ReadonlyMap接口
Version 1.4.8
- 调整:ItemContext更名为ItemMap,新增ConcurrenceMap、ReadonlyMap接口
- 调整:Dotweb.AppContext变更为Dotweb.Items
- 调整:HttpContext.AppContext变更为HttpContext.AppItems
- 调整:HttpContext.AppSetConfig变更为HttpContext.ConfigSet
- 调整:config.AppSet变更为config.ConfigSet
- 新增: config.ParseConfigSetXML\ParseConfigSetJSON\ParseConfigSetYaml,用于解析常规Key\Value格式的配置文件
- 新增:config.Config.IncludeConfigSet,用于向config.ConfigSet中导入Key\Value格式的配置文件,通过HttpContext.ConfigSet获取相关设置信息
- ParseConfigSetXML:支持xml格式文件解析,返回core.ConcurrenceMap
- ParseConfigSetJSON:支持json格式文件解析,返回core.ConcurrenceMap
- ParseConfigSetYaml:支持yaml格式文件解析,返回core.ConcurrenceMap
- 具体配置文件格式可参考example/configset
- 新增示例代码 example/configset
- 2018-01-24 22:00