<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # beego 1.9.0 1. Fix the new repo address for casbin #2654 2. Fix cache/memory fatal error: concurrent map iteration and map write #2726 3. AddAPPStartHook func modify #2724 4. Fix panic: sync: negative WaitGroup counter #2717 5. incorrect error rendering (wrong status) #2712 6. validation: support int64 int32 int16 and int8 type #2728 7. validation: support required option for some struct tag valids #2741 8. Fix big form parse issue #2725 9. File log add RotatePerm #2683 10. Fix Oracle placehold #2749 11. Supported gzip for req.Header has Content-Encoding: gzip #2754 12. Add new Database Migrations #2744 13. Beego auto generate sort ControllerComments #2766 14. added statusCode and pattern to FilterMonitorFunc #2692 15. fix the bugs in the "ParseBool" function in the file of config.go #2740 ## bee 1.9.0 1. Added MySQL year data type #443 2. support multiple http methods #445 3. The DDL migration can now be generated by adding a -ddl and a proper "alter" or "create" as argument value. #455 4. Fix: docs generator skips everything containing 'vendor' #454 5. get these tables information in custom the option #441 6. read ref(pk) #444 7. Add command bee server to server static folder. # beego 1.7.1 新增功能: 1. access log 增加 IP [#2156](https://github.com/astaxie/beego/pull/2156) 2. orm 增加新接口 ReadForUpdate [#2158](https://github.com/astaxie/beego/pull/2158) 3. 參數 bind 支持數組 form,columns[0].Data=foo&columns[1].Data=bar&columns[2].Data=baz [#2111](https://github.com/astaxie/beego/pull/2111) 4. 自定義 recover 函數,增加配置 `beego.BConfig.RecoverFunc`,默認和原來保持一致,但是用戶可以自己定義 [#2004](https://github.com/astaxie/beego/issues/2004) 5. memcache cache 同時支持 byte 和 string 的存儲,這樣就可以通過 gob 保存 struct [#1521](https://github.com/astaxie/beego/issues/1521) 6. ORM delete 支持按照指定條件刪除 [#1802](https://github.com/astaxie/beego/issues/1802) 7. swagger 的支持輸出 yaml [#2162](https://github.com/astaxie/beego/pull/2162) 8. 增加 RunController 和 RunMethod,讓用戶自定義路由規則 [#2017](https://github.com/astaxie/beego/issues/2017) 修復 bug: 1. 靜態目錄如果已經存在 index.html,當訪問目錄的時候不會自動添加 /, 例如訪問 /swagger 不會跳轉到 /swagger/,這樣會導致相對的 css 和 js 訪問不存在 [#2142](https://github.com/astaxie/beego/issues/2142) 2. beego admin ui 里面訪問時間排序沒有按照 us, ms 排序,而是按照字符排序 [#1877](https://github.com/astaxie/beego/issues/1877) 3. captcha 生產圖片的時候,自定義 height 和 width crash [#2161](https://github.com/astaxie/beego/issues/2161) 4. DELETE 請求下開啟了 CopyBody 情況下,如果 body 為空 panic [#1656](https://github.com/astaxie/beego/issues/1656) # beego 1.7.0 新增改進功能: 1. Filter 訪問速度提升 7.5 倍以上 [#1799](https://github.com/astaxie/beego/pull/1799) 2. Gzip 壓縮的時候支持不同的 level [#1808](https://github.com/astaxie/beego/pull/1808) 3. ORM PK 支持負數 [#1810](https://github.com/astaxie/beego/pull/1810) 4. ORM 支持自定義自增 ID 的值 [#1826](https://github.com/astaxie/beego/pull/1826) 5. Context 下載文件函數改進:下載文件之前先檢查是否存在 [#1827](https://github.com/astaxie/beego/pull/1827) 6. log增加 `GetLogger` 函數,可以增加相應的前綴 [#1832](https://github.com/astaxie/beego/pull/1832) ``` package main import "github.com/astaxie/beego/logs" func main() { logs.Warn("this is a warn message") l := logs.GetLogger("HTTP") l.Println("this is a message of http") logs.GetLogger("orm").Println("this is a message of orm") logs.Debug("my book is bought in the year of ", 2016) logs.Info("this %s cat is %v years old", "yellow", 3) logs.Error(1024, "is a very", "good", 2.5, map[string]int{"id": 1}) logs.Critical("oh my god") } ``` ![](https://cloud.githubusercontent.com/assets/707691/14017109/f608b658-f1ff-11e5-8d57-72030cfe4f5d.png) 7. session 增加 Log,一旦錯誤發生可以記錄日志. [#1833](https://github.com/astaxie/beego/pull/1833) 8. logs 包添加兩個 public 函數,`EnableFuncCallDepth` 和 `SetLogFuncCallDepth`, 用來設置函數的調用層級. [#1837](https://github.com/astaxie/beego/pull/1837) 9. 支持 `go run` 運行 beego 的項目代碼 [#1840](https://github.com/astaxie/beego/pull/1840) 10. 添加 `ExecuteTemplate` 函數,這樣用戶就可以通過這種方式訪問 template,而不是直接訪問 map,因為 map 有并發讀寫問題 [#1848](https://github.com/astaxie/beego/pull/1848) 11. ORM 字段支持 `time` 類型 [#1856](https://github.com/astaxie/beego/pull/1856) 12. ORM One 接口只獲取一條 [#1874](https://github.com/astaxie/beego/pull/1874) 13. ORM 支持 json jsonb 類型 [#1875](https://github.com/astaxie/beego/pull/1875) 14. ORM 默認使用 text 類型 [#1879](https://github.com/astaxie/beego/pull/1879) 15. session 配置三個配置,`EnableSidInHttpHeader` `EnableSidInUrlQuery` `SessionNameInHttpHeader`, 允許用戶可以在 http 頭和 URL 中帶 sid [#1897](https://github.com/astaxie/beego/pull/1897) 16. 自動化路由改進生成的文件名,之前太長了 [#1924](https://github.com/astaxie/beego/pull/1924) 17. 支持復雜的模板引擎. ace jade [#1940](https://github.com/astaxie/beego/pull/1940) ``` beego.AddTemplateEngine("ace", func(root, path string, funcs template.FuncMap) (*template.Template, error) { aceOptions := &ace.Options{DynamicReload: true, FuncMap: funcs} aceBasePath := filepath.Join(root, "base/base") aceInnerPath := filepath.Join(root, strings.TrimSuffix(path, ".ace")) tpl, err := ace.Load(aceBasePath, aceInnerPath, aceOptions) if err != nil { return nil, fmt.Errorf("error loading ace template: %v", err) } return tpl, nil }) ``` [#1940](https://github.com/astaxie/beego/pull/1940) 18. session 引擎支持 ssdb [#1953](https://github.com/astaxie/beego/pull/1953) 19. RenderForm 支持輸出 required [#1993](https://github.com/astaxie/beego/pull/1993) 20. 讓打印的 beego 日志更加美觀 [#1997](https://github.com/astaxie/beego/pull/1997) ![](https://cloud.githubusercontent.com/assets/1248967/16153054/f654b08e-34a4-11e6-894d-24f16ab847a7.png) 21. ORM 支持 struct 中帶有 `time.Time` 指針 [#2006](https://github.com/astaxie/beego/pull/2006) 22. Controller 中增加 `TplPrefix` 這樣就可以在 baseController 制定讀取模板的前綴目錄 [#2030](https://github.com/astaxie/beego/pull/2030) 23. jsonb 函數中增加 js 函數的判斷,避免函數不存在時候出錯. [#2045](https://github.com/astaxie/beego/pull/2045) 24. ORM 增加 `InsertOrUpdate` 函數 [#2053](https://github.com/astaxie/beego/pull/2053) 25. Filter 函數增加重置參數的參數. 因為 `beego.InsertFilter("*", beego.BeforeStatic, RedirectHTTP)` 的時候,參數會賦值給 `:splat`,從而影響后續如果路由里面也有想用的路由, 那么就會引起沖突,因此增加這樣的函數以方便用戶重置。 [#2085](https://github.com/astaxie/beego/pull/2085) 26. session 包配置采用對象初始化,而拋棄傳遞 json 的方式. 如果獨立使用session包的可能會引起兼容性問題 [#2096](https://github.com/astaxie/beego/pull/2096) 27. Swagger 遷移到2.0版本,現在生產的代碼無需依賴 API,直接生產 swagger.json bugfix: 1. 靜態路由中 `/m` 自動跳轉到 `/m/` [#1792](https://github.com/astaxie/beego/pull/1792) 2. test 的時候解析配置文件出錯 [#1794](https://github.com/astaxie/beego/pull/1794) 3. 文件 rotato 的時候產生 race condition [#1803](https://github.com/astaxie/beego/pull/1803) 4. 修復 multiple response.WriteHeader calls 的錯誤 [#1805](https://github.com/astaxie/beego/pull/1805) 5. ORM 如果主鍵是 uint 的時候 panic [#1828](https://github.com/astaxie/beego/pull/1828) 6. 日志 rotate 的時候如果當前時間小于 2000 panic [#]() 7. context 重用導致 XSRF 重用[#1863](https://github.com/astaxie/beego/pull/1863) 8. ORM InsertMulti 的時候當是 * 類型時 panic [#1882](https://github.com/astaxie/beego/pull/1882) 9. task 中任務在很微小的時間內可能存在執行多次的情況 [#1909](https://github.com/astaxie/beego/pull/1909) 10. IE 瀏覽器下載文件名混亂 [#1912](https://github.com/astaxie/beego/pull/1912) 11. ORM DISTINCT 實現 [#1938](https://github.com/astaxie/beego/pull/1938) 12. Logs 包里面設置文件的 permit 時候,int 無法設置. [#1948](https://github.com/astaxie/beego/pull/1948) [#2003](https://github.com/astaxie/beego/pull/2003) 13. QueryRow 和 QueryRows 查詢獲取數據后外鍵字段不填充值 [#1964](https://github.com/astaxie/beego/pull/1964) 14. 當 beego 應用跑在代理之后的時候,scheme 通過 `X-Forwarded-Proto` 獲取 [#2050](https://github.com/astaxie/beego/pull/2050) 15. 靜態文件訪問目錄時候跳轉到 `目錄/` 的時候自動帶上參數 [#2064](https://github.com/astaxie/beego/pull/2064) # beego 1.6.1 新增功能: 1. ORM 支持 Oracle 驅動 2. ORM 的 Model 支持 inline 3. Cache 支持 ssdb引擎 4. console 支持顏色輸出配置 5. 添加 travis 的自動化集成測試 6. 日志新增 mulitfile 引擎,支持不同級別的輸出到不同的文件 bugfix: 1. cookie 時間設置 2. 路由規則里面的匹配 [#1580](https://github.com/astaxie/beego/issues/1580) 3. 在 beego.Run() 之前沒有 log 輸出 4. config 獲取 []string 為空的時候返回為空,應該返回 nil 5. ini 接口保存的時候需要注釋不正確 6. 異步存儲日志的時候時間可能延遲的問題 7. 配置文件解析兩次,導致部署 key 獲取失敗 8. 正則路由無法解析本身帶有 `()` 的問題 9. mail發送中文附件和 title 亂碼的問題 10. ORM 里面缺少 Distinct 的接口定義 11. Layout 編譯失敗 12. logrotate 的時候文件名不正確 13. CORS 插件失敗的時候不生效 14. filters 的路徑參數和路由參數沖突 15. 靜態文件找不到返回 200,應該返回 404 16. 添加 GroupBy 的 interface 支持 17. Go1.6 的并發訪問 map 引起靜態文件換成崩潰 18. httplib JSONBody 輸出的時候采用 json.Encoder 會輸出一個額外的換行符 19. 異步模式下,log 調用 flush,Close 的時候日志丟失 # beego 1.6.0 新功能: 1. 文件 log 支持 rotate 支持類似 `xx.2013-01-01.2.log` 這樣的輸出 [#1265](https://github.com/astaxie/beego/pull/1265) 2. context.response 支持了原生的 Flush,Hijack,CloseNotify 3. ORM 支持 Distinct 操作 [#1276](https://github.com/astaxie/beego/pull/1276) 4. 新增加模板函數 map_get [#1305](https://github.com/astaxie/beego/pull/1305) 5. ORM 支持 tidb 引擎 [#1366](https://github.com/astaxie/beego/pull/1366) 6. httplib 請求參數支持 []string [#1308](https://github.com/astaxie/beego/pull/1308) 7. ORM querySeter 添加 GroupBy 方法 [#1345](https://github.com/astaxie/beego/pull/1345) 8. Session 的 MySQL 引擎支持自定義表名 [#1348](https://github.com/astaxie/beego/pull/1348) 9. log 的 file 引擎性能提升 30%,同時支持自定義創建的文件權限 [#1560](https://github.com/astaxie/beego/pull/1560) 10. session 支持通過 query 獲取 [#1507](https://github.com/astaxie/beego/pull/1507) 11. Cache 模塊支持多個 Cache 對象,之前調用 NewCache 獲取的是同一個 Cache,現在會初始化不同的 Cache 對象。 12. validation 支持自定義驗證函數 bugfix: 1. context 里面 bind 函數如果參數為空 crash [#1245](https://github.com/astaxie/beego/issues/1245) 2. ORM 中 manytomany 獲取 reverse 的時候出錯。[#671](https://github.com/astaxie/beego/issues/671) 3. http: multiple response.WriteHeader calls [#1329](https://github.com/astaxie/beego/pull/1329) 4. ParseForm 解析日期使用當前的 timezone [#1343](https://github.com/astaxie/beego/pull/1343) 5. log 引擎里面 Smtp 發送郵件無法認證 6. 修復路由規則的一些 issue: `/topic/:id/?:auth`, `/topic/:id/?:auth:int` [#1349](https://github.com/astaxie/beego/pull/1349) 7. 修復注釋文檔解析的時候 nil 引起 crash [#1367](https://github.com/astaxie/beego/pull/1367) 8. static 目錄下的 index.html 無法讀取[#1508](https://github.com/astaxie/beego/pull/1508) 9. dbBase.Update 失敗不返回 err [#1384](https://github.com/astaxie/beego/pull/1384) 10. validation 里面設置的 Required 只對 int 有效,int64 無效 11. ORM 創建外鍵是 string 類型的主鍵時創建 varchar(0) 的字符問題 [#1379](https://github.com/astaxie/beego/pull/1379) 12. graceful 同時開啟 http 和 https 的時候出錯 [#1414](https://github.com/astaxie/beego/pull/1414) 13. ListenTCP4 開啟之后如果 httpaddr 為空還是監控 TCP6 14. migration 不支持 postgres [#1434](https://github.com/astaxie/beego/pull/1434) 15. ORM text、bool 等默認值問題導致創建表出錯 16. graceful 導致 panic 問題 negative WaitGroup counter 優化: 1. example 移到了 [samples](https://github.com/beego/samples) 2. 所有代碼符合 golint 規范 3. 重寫路由樹底層,性能提升三倍左右 4. 每次請求的 context 采用 sync.Pool 復用,內存和性能提升 5. 模板編譯優化速度,按需編譯 [#1298](https://github.com/astaxie/beego/pull/1298) 6. 優化了 beego 的配置管理,采用統一的 BConfig,更易讀易管理 7. 優化了 beego 的整體結構代碼,使得代碼更易讀維護 8. 所有初始化的信息統一到 AddAPPStartHook 函數中去,易于管理 9. 移除了 middleware,之后全部采用 plugins 來管理插件 10. 重構 Error 處理,使得 Error 更加易懂 # beego 1.5.0 新功能: 1. 優雅重啟模塊:grace 2. httplib 增加 JsonBody 函數,支持 raw body 以 Json 格式發送 3. context input 增加 AcceptsHtml AcceptsXml AcceptsJson 函數 4. 配置文件優先從 Runmode 中獲取 5. httplib 支持 gzip 6. Log 模塊默認不采用異步方式 7. validation 增加循環嵌套驗證 8. 增加 apk mime 9. ORM 支持 eq 和 ne bugfix: 1. ledis 驅動的參數錯誤 2. 當頁面放置一段時間,驗證碼將從緩存中失效。當用戶再來刷新驗證碼將出現驗證碼 404。對于 reload 操作應該直接生成驗證碼。 3. Controller 定義 Error 異常 4. 修復 cookie 無法在 window 下的 IE 正常工作 5. GetInt 函數當獲取不存在的變量是返回 nil 錯誤 6. 增加更多的手機驗證碼方式 7. 修復路由的匹配問題 8. panic 返回 http 200 9. redis session 引起數據庫設置錯誤 10. https 和 http 直接的 session 無法共享 11. memcache session 引擎當沒有數據的時候返回錯誤 # beego 1.4.3 新功能: 1. ORM 數據庫創建和修改的時候支持 default 設置 2. 改進日志文件行數統計 3. session ledis 支持選擇數據庫 4. session redis 支持選擇數據庫 5. cache redis 支持選擇數據庫 6. UrlFor 支持任意類型的參數 7. controller 中 GetInt/GetString 等 Get 系列函數支持默認值, 例如:GetInt("a",12) 8. 增加 CompareNot/NotNil 模板函數 9. 支持 Controller 定義錯誤處理,更多請參考 [controller Error](http://beego.me/docs/mvc/controller/errors.md#controller%E5%AE%9A%E4%B9%89error) 10. ParseForm 增加支持 slices 11. 改進 ORM interface,可以模擬 interface bugfix: 1. context subdomain 獲取的子域名不正確 2. beego.AppConfig.Strings 當數據為空時判定不正確 3. utils/pagination 修復不能修改分頁屬性 4. 路由處理中如果請求的 URL 是空導致 crash 的問題 5. adminui 中 task 點擊無法執行 6. CGI 模式退出進程后 Socket 文件沒有刪除 # beego 1.4.2 新功能: 1. 增加了 SQL 構造器,參考了 ZEND 框架的 ORM 2. Controller 獲取參數增加了 GetInt(), GetInt8(), GetInt16(), GetInt32(), GetInt64() 3. 優化日志提示,增加日志輸出過濾設置 FilterHandler,默認靜態文件不輸出匹配日志 4. 靜態目錄支持 index.html 輸出,靜態目錄自動增加 / 5. flash 支持 success 和 set 函數,支持各種一次性的數據 6. 路由支持大小寫忽略設置,RouterCaseSensitive,默認是大小寫敏感的 URL,根據用戶注冊的URL進行匹配 7. 配置文件支持自定義的變量獲取,beego.AppConfig.String("myvar") 在 dev 模式下返回456,在其他模式下返回 123 > runmode = dev > myvar = 123 > [dev] > myvar = 456 8. ini 配置文件支持 include 語法,在配置文件中允許 include 其他配置文件: > appname = btest > include b.conf 9. utils 下增加分頁組件,可以方便用戶編寫分頁相關的應用。 10. 增加 BEEGO_RUNMODE 環境變量,用戶在部署的時候只要通過改變量方便切換應用的不同模式 11. toolbox 增加獲取 statistic 的 Json 函數 12. utils 下的 mail 發送內嵌附件發送 13. 允許用戶通過標準 IO 開啟 fastcgi 14. redis Session 引擎,采用 SETEX 命令兼容老版本的 redis 15. RenderForm 支持 html id 和 class,使用 id 和 class tag 16. ini 配置文件支持 BOM 頭 17. Session 增加新的引擎 ledis 18. 改進 httplib 文件上傳,采用了 io.Pipe 支持超大文件上傳 19. 支持應用啟動直接綁定到 TCP4 地址上,Go 默認是綁定到 ipv6,增加配置參數 ListenTCP4 20. 表單數據渲染支持 off/on/yes/no/1/0 解析到 bool,支持 time 格式的解析 21. 簡化了 SessionID 的生成,不再采用 hmac_sha1 算法,直接通過 golang 內置的 rand 獲取 bugfix: 1. 模擬 PUT 和 DELETE 時,_method 的值沒有大寫,導致 XSRF 驗證失敗 2. cache 如果在 StartAndGC 初始化失敗時,沒有返回錯誤信息 3. httplib 修復 User-Agent 設置不起作用 4. DelStaticPath 優化/處理 5. 靜態目錄多個的時候,文件只會在第一個靜態目錄找 6. Filter 函數在 AfterExec 和 FinishRouter 之后多個 Filter 不能執行的問題 7. 修復在請求方法是模擬的 _method 是 PUT 或者 DELETE 的時候無法正確路由 8. 修復了 mime 沒有初始化的問題 9. log 輸出文件以及行號不正確 10. httplib 修復了當只有一個文件上傳一個參數是不能發送的問題 11. 改進了 Abort 的輸出信息,之前如果是沒有定義的錯誤信息不會輸出 12. 修復 namespace 循環嵌套中,如果外層沒有 Filter 的情況下內層 Filter 無法添加的問題 13. 路由包含多層參數時,路由匹配出錯 #824 14. 注釋路由,如果存在多個 namespace 的時候,一個更新,另一個信息丟失 #770 15. urlfor函數調用多余 {{placeholder}} 問題 #759 # beego 1.4.1 主要更新: 1. context.Input.Url 獲取 path 信息,去除了域名,scheme 等信息 2. 增加插件 apiauth,模擬 AWS 的加密請求 3. 精簡 debug 輸出的路由信息 4. orm 字段支持指針類型 5. 改進了 httplib 功能,增加了 BasicAuth,多次請求緩存等功能 bugfix: 1. _method 模擬請求 put 和 delete,參數大小寫不統一 2. 路由 *.* 和其他路由正則混用情況下無法解析 # beego 1.4.0 這個版本整整憋了兩個月時間,主要是我們真的做了好多功能性上面的改進,這里要感謝所有給 beego 貢獻的用戶,也感謝給 beego 持續提各種改進意見的用戶,下面是我們這次改進的特性 1. bee 工具的完整性改進,bee 現在支持了如下功能: bee api 直接從數據庫讀取數據庫表,一鍵生成 API 應用帶文檔,詳細介紹看視頻:http://www.tudou.com/programs/view/aM7iKLlBlrU/ - bee generate 命令,這個是新增加的命令,可以用來自動化生成代碼,主要有如下子命令: - scaffold 類似其他框架的腳手架功能,生成 controller、model、view、migration - model 生成 CRUD 的 model - controller 生成 CRUD 的 controller - view 生成 CRUD 的 view 文件,內容為空,需要用戶自己做 UI 界面 - migration 生成 migration 文件 - appcode 從數據庫根據表結構生成 model、controller、router - docs 從 controller 注釋自動化生成 swagger 文檔 - bee migrate 命令,執行 migration,支持如下子命令 - migrate 執行所有新的 migration - rollback 回滾最后一次執行的 migration - reset 回滾所有的 migration - refresh 回滾所有的 migration 并從頭執行全部的 migration - bee run改進,默認支持了 watchall 功能,增加了兩個參數 gendoc 和 downdoc 2. config 模塊增加新的接口,現在 config 模塊支持如下接口,支持直接保存文件: ``` type ConfigContainer interface { Set(key, val string) error // support section::key type in given key when using ini type. String(key string) string // support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. Strings(key string) []string //get string slice Int(key string) (int, error) Int64(key string) (int64, error) Bool(key string) (bool, error) Float(key string) (float64, error) DefaultString(key string, defaultval string) string // support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. DefaultStrings(key string, defaultval []string) []string //get string slice DefaultInt(key string, defaultval int) int DefaultInt64(key string, defaultval int64) int64 DefaultBool(key string, defaultval bool) bool DefaultFloat(key string, defaultval float64) float64 DIY(key string) (interface{}, error) GetSection(section string) (map[string]string, error) SaveConfigFile(filename string) error } ``` 3. middleware中支持另一種 i18n 的支持: ``` I18N = middleware.NewLocale("conf/i18n.conf", beego.AppConfig.String("language")) ``` 配置文件如下: ``` { "E-mail Address": { "en": "E-mail Address", "zh": "郵箱地址", "vn": "?????" }, "Username": { "en": "Ussername", "zh": "用戶名", "vn": "t&ecirc;n truy nh?p" } } ``` 使用如下: `I18N.Translate("username", "vn")` 4. namespace前綴支持正則: ``` beego.NewNamespace("/v1/:uid", beego.NSNamespace("/customer", beego.NSInclude( &controllers.CustomerController{}, &controllers.CustomerCookieCheckerController{}, ), ), ) ``` 5. cache 和 session 模塊的 memcache、redis 引擎修改到最新版本的驅動 6. 增加開發打印路由調試功能: ``` 2014/08/22 09:55:40 [I] | GET | / | 7.660221504s | match | / | 2014/08/22 09:55:40 [I] | GET | / | 13.421869836s | match | / | 2014/08/22 09:55:40 [I] | GET | / | 1.726185752s | match | / | 2014/08/22 09:55:40 [I] | GET | /user/login| 7.494079ms | match | /user/login | ``` 7. log 的等級符合 RFC5424 規范 8. 靜態文件處理支持 robots.txt,用戶放在 static 目錄下即可 9. 增加和簡化 plugins 功能: auth 支持 basicauth,詳細使用請看 https://godoc.org/github.com/astaxie/beego/plugins/auth cors 支持跨站調用,詳細使用請看 https://godoc.org/github.com/astaxie/beego/plugins/cors 10. 新增了 AdminUI,用戶在 EnableAdmin 的情況下,可以通過界面簡單地獲取當前應用的各種狀態,同時可以很容易的調試性能,監控系統,執行任務,獲取配置等 ![](https://box.kancloud.cn/2016-03-12_56e3ccbac8138.png) 11. session 配置現在支持設置 cookie domain 12. 新增 migration 包,支持 migration 的功能 13. getconfg 方法改為 public 方法,用戶就可以通過改方法獲取相應 runmode 下的配置文件 14. 改進 httplib 的方法支持 SetAgent 和 BasicAuth 的請求,httplib 支持請求一次,讀取多次 修復 bug: 1. file session 在部分情況下內容消失問題 2. docs 自動化生成,文件不更新 3. 路由 namespace 的前綴不支持 4. orm 修正 detect engine 5. 修復 captcha 里面當用戶驗證碼輸入長度不對時不進行更新 6. 調用 setstatus 之后后面調用的 setHeader 全部無效的問題 7. 修復 smtp 發送郵件需要驗證的情況 8. 修復 utils 下 safemap 的 items 問題 9. 修復 geturl 函數當參數多個時不帶?的問題 # beego 1.3.0 經過了一個多月的開發,我們很高興的宣布,beego 1.3.0來了,這個版本我們做了非常多好玩并且有用的功能,升級請看[升級指南](http://beego.me/docs/intro/upgrade.md) ## 路由重寫 這一次路由進行了全部改造,從之前的三個路由模式,改成了 tree 路由,第一性能得到了提升,第二路由支持的格式更加豐富,第三路由更加符合我們的思考方式, 例如現在注冊如下路由規則: /user/astaxie /user/:username 如果你的訪問地址是 `/user/astaxie`,那么優先匹配固定的路由,也就是第一條,如果訪問是 `/user/slene`,那么就匹配第二個,和你注冊的路由的先后順序無關 ## namespace 更優雅 設計 namespace 主要是為了大家模塊化設計的,之前是采用了類似 jQuery 的鏈式方式,當然新版本也是支持的,但是由于 gofmt 的格式無法很直觀的看出來整個路由的目錄結構,所以我采用了多參數注冊方式,現在看上去就更加的優雅: ``` ns := beego.NewNamespace("/v1", beego.NSNamespace("/shop", beego.NSGet("/:id", func(ctx *context.Context) { ctx.Output.Body([]byte("shopinfo")) }), ), beego.NSNamespace("/order", beego.NSGet("/:id", func(ctx *context.Context) { ctx.Output.Body([]byte("orderinfo")) }), ), beego.NSNamespace("/crm", beego.NSGet("/:id", func(ctx *context.Context) { ctx.Output.Body([]byte("crminfo")) }), ), ) ``` 更多詳細信息請參考文檔:[namespace](http://beego.me/docs/mvc/controller/router.md#namespace) ## 注解路由 ``` // CMS API type CMSController struct { beego.Controller } func (c *CMSController) URLMapping() { c.Mapping("StaticBlock", c.StaticBlock) c.Mapping("AllBlock", c.AllBlock) } // @router /staticblock/:key [get] func (this *CMSController) StaticBlock() { } // @router /all/:key [get] func (this *CMSController) AllBlock() { } ``` 更多請參考文檔:[注解路由](http://beego.me/docs/mvc/controller/router.md#%E6%B3%A8%E8%A7%A3%E8%B7%AF%E7%94%B1) ## 自動化文檔 自動化文檔一直是我夢想中的一個功能,這次借著公司的項目終于實現了出來,我說過 beego 不僅僅要讓開發 API 快,而且讓使用 API 的用戶也能快速的使用我們開發的 API,這個就是我開發這個項目的初衷。 可以通過注釋自動化的生成文檔,并且在線測試,詳細的請看下面的截圖 ![](https://box.kancloud.cn/2016-03-12_56e3ccbaee407.png) 而且可以通過文檔進行 API 的測試: ![](https://box.kancloud.cn/2016-03-12_56e3ccbb288f2.png) 更多請參考文檔:[自動化文檔](http://beego.me/docs/advantage/docs.md) ## config 支持不同模式的配置 在配置文件里面支持 section,可以有不同的 Runmode 的配置,默認優先讀取 runmode 下的配置信息,例如下面的配置文件: appname = beepkg httpaddr = "127.0.0.1" httpport = 9090 runmode ="dev" autorender = false autorecover = false viewspath = "myview" [dev] httpport = 8080 [prod] httpport = 8088 [test] httpport = 8888 上面的配置文件就是在不同的 runmode 下解析不同的配置,例如在 dev 模式下,httpport 是 8080,在 prod 模式下是 8088,在 test 模式下是 8888。其他配置文件同理。解析的時候優先解析 runmode 模式的配置,然后解析默認的配置。 ## 支持雙向的 SSL 認證 ``` config := tls.Config{ ClientAuth: tls.RequireAndVerifyClientCert, Certificates: []tls.Certificate{cert}, ClientCAs: pool, } config.Rand = rand.Reader beego.BeeApp.Server.TLSConfig = &config ``` ## beego.Run支持帶參數 beego.Run() 默認執行HttpPort beego.Run(":8089") beego.Run("127.0.0.1:8089") ## XSRFKEY 的 token 從 15 個字符增加到 32 個字符,增強安全性 ## 刪除熱更新 ## 模板函數增加 Config,可以方便的在模板中獲取配置信息 {{config returnType key defaultValue}} {{config "int" "httpport" 8080}} ## httplib 支持 cookiejar 功能,感謝 curvesft ## orm 時間格式,如果為空就設置為 nil,感謝 JessonChan ## config 模塊支持 json 解析就一個 array 格式,感謝 chrisport ## bug fix - 靜態文件目錄循環跳轉 - fix typo # beego 1.2.0 大家好,經過我們一個多月的努力,今天我們發布一個很帥的版本,之前性能測試框架出來 beego 已經躍居 Go 框架第一了,雖然這不是我們的目標,我們的目標是做最好用,最易用的框架. http://www.techempower.com/benchmarks/#section=data-r9&hw=i7&test=json 但是這個版本我們還是在性能和易用性上面做了很多改進.應該說性能更加的接近 Go 原生應用. ### 新特性: #### 1. namespace 支持 ``` beego.NewNamespace("/v1"). Filter("before", auth). Get("/notallowed", func(ctx *context.Context) { ctx.Output.Body([]byte("notAllowed")) }). Router("/version", &AdminController{}, "get:ShowAPIVersion"). Router("/changepassword", &UserController{}). Namespace( beego.NewNamespace("/shop"). Filter("before", sentry). Get("/:id", func(ctx *context.Context) { ctx.Output.Body([]byte("notAllowed")) })) ``` 上面這個代碼支持了如下這樣的請求URL - GET /v1/notallowed - GET /v1/version - GET /v1/changepassword - POST /v1/changepassword - GET /v1/shop/123 而且還支持前置過濾,條件判斷,無限嵌套 namespace #### 2. beego 支持更加自由化的路由方式 RESTful的自定義函數 - beego.Get(router, beego.FilterFunc) - beego.Post(router, beego.FilterFunc) - beego.Put(router, beego.FilterFunc) - beego.Head(router, beego.FilterFunc) - beego.Options(router, beego.FilterFunc) - beego.Delete(router, beego.FilterFunc) ``` beego.Get("/user", func(ctx *context.Context) { ctx.Output.Body([]byte("Get userlist")) }) ``` 更加自由度的 Handler - beego.Handler(router, http.Handler) 可以很容易的集成其他服務 ``` import ( "http" "github.com/gorilla/rpc" "github.com/gorilla/rpc/json" ) func init() { s := rpc.NewServer() s.RegisterCodec(json.NewCodec(), "application/json") s.RegisterService(new(HelloService), "") beego.Handler("/rpc", s) } ``` #### 3. 支持從用戶請求中直接數據 bind 到指定的對象 例如請求地址如下 ?id=123&isok=true&ft=1.2&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=astaxie ``` var id int ctx.Input.Bind(&id, "id") //id ==123 var isok bool ctx.Input.Bind(&isok, "isok") //isok ==true var ft float64 ctx.Input.Bind(&ft, "ft") //ft ==1.2 ol := make([]int, 0, 2) ctx.Input.Bind(&ol, "ol") //ol ==[1 2] ul := make([]string, 0, 2) ctx.Input.Bind(&ul, "ul") //ul ==[str array] user struct{Name} ctx.Input.Bind(&user, "user") //user =={Name:"astaxie"} ``` #### 4. 優化解析 form 的流程,讓性能更加提升 #### 5. 增加更多地 testcase 進行自動化測試 #### 6. admin 管理模塊所有的增加可點擊的鏈接,方便直接查詢 #### 7. session 的除了 memory 之外的引擎支持 struct 存儲 #### 8. httplib 支持文件直接上傳接口 ``` b:=httplib.Post("http://beego.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } ``` httplib 支持自定義協議版本 #### 9. ORM 支持 struct 中有 unexport 的字段 #### 10. XSRF 支持 controller 級別控制是否啟用, 之前 XSRF 是全局設置只要開啟了就會影響所有的 POST PUT DELET 請求,但是項目中可能 API 和頁面共存的情況,頁面可能不需要類似的 XSRF,因此支持在 Prepare 函數中設置值來控制 controller 是否啟用 XSRF. 默認是 true,也就是根據全局的來執行.用戶可以在 prepare 中設置是否關閉. ``` func (a *AdminController) Prepare(){ a.EnableXSRF = false } ``` #### 11. controller 支持 ServeFormatted 函數,支持根據請求 Accept 來判斷是調用 ServeJson 還是 ServeXML #### 12. session 提供 memcache 引擎 #### 13. Context 中的 Download 函數支持自定義文件名提供下載 ## bug 修復 1. session 的 Cookie 引擎修復無法設置過期的 bug 2. 修復 flash 數據的存儲和解析問題 3. 修復所有 go vet 出現的問題 4. 修復 ParseFormOrMulitForm 問題 5. 修復只有 POST 才能解析 raw body,現在支持除了 GET 和 HEAD 之外的其他請求 6. config 模塊修復 xml 和 yaml 無法解析的問題 # beego 1.1.4 發布一個緊急的版本, beego 存在一個嚴重的安全漏洞,請大家更新到最新版本. 順便把最近做的一起發布了 1. 緊急修復一個安全漏洞,稍后會在 beego/SECURITY.md 公布詳細的情況 2. 靜態文件處理獨立到文件 3. 第三方依賴庫移除,目前如果你使用 session/cache/config,使用的是依賴第三方庫的,那么現在都移到了子目錄,如果你想使用這些就需要在使用的地方采用 mysql 類似的方式引入 ``` import ( "github.com/astaxie/beego" _ "github.com/astaxie/beego/session/mysql" ) ``` 4. 修改部分導出的函數為 private,因為外部不需要調用 5. 優化 formparse 的過程,根據不同的 content-type 進行解析 發布時間: 2014-04-08 # beego 1.1.3 這是一個 hotfix 的版本,主要是修復了以下 bug 1. console 日志輸出,如果不設置配置文件,不能正常輸出 2. 支持了 go run main.go,但是 main.go 沒有遵循 beego 的目錄結構,自定義了配置文件或者不存在配置文件,就會 panic 找不到 app.conf. 3. 支持了在 go test 中解析配置,但是實際上調用 TestBeegoInit 無法解析配置文件 發布時間: 2014-04-04 # beego 1.1.2 beego 1.1.2 版本發布,這個版本主要是一些改進: 1. 增加 ExceptMethodAppend 函數,支持 autorouter 的時候過濾一些函數 2. 支持自定義 FlashName,FlashSeperator 3. ORM 支持自定義的類型,例如 type MyInt int 這種 4. 修復驗證模塊返回自定義驗證信息 5. 改進 logs 模塊, 增加 Init 處理 error,設置一些不必要的 public 函數為 private 6. 增加 PostgreSQL 的 session 引擎 7. logs 模塊,支持輸出調用的文件名和行號,增加設置函數 EnableFuncCallDepth,默認關閉 8. 修改 session 模塊中 Cookie 引擎的一個隱藏 bug 9. 模板解析錯誤的時候,提示語進行了改進 10. 允許用戶通過 Filter 修改 Context,跳過 beego 的路由查找方法,直接使用自己的路由規則.增加參數 RunController 和 RunMethod 11. 支持 go run main.go 執行 beego 的應用 12. 支持 go test 執行測試用例,無法讀取配置文件,模板的問題,增加 TestBeegoInit 函數調用. 發布時間: 2014-04-03 # beego 1.1.1 這個版本主要是一些 bug 的修復和增加新功能 1. session 模塊 file 引擎無法刪除文件,不斷刷新引起的文件讀取失敗問題 2. 文件緩存無法讀取 struct,改進 gob 自動化注冊 3. session 模塊增加新引擎 couchbase 4. httplib 支持設置 transport 和 proxy 5. 改進 context 中 Cookie 函數,默認支持 httponly,以及其他一些默認參數行為 6. 驗證模塊的改進,支持更多地手機號碼 7. getstrings 函數行為也改成 getstring 一樣,不需要自己 parseform 8. session 模塊 redis 引擎,在連接失敗的情況下返回錯誤 9. 修復無法添加 GroupRouters 的 bug 問題 10. 改進多個靜態文件的一些潛在 bug,路徑匹配問題,以及自動跳轉靜態目錄顯示. 11. ORM 增加 GetDB 獲取已連接的 *sql.DB 12. ORM 增加 ResetModelCache 重置已注冊緩存的模型 struct,方便寫測試 13. ORM 支持 between 14. ORM 支持 sql.Null* 類型 15. 修改 auto_now_add,用戶有自定義值時跳過自動設置時間 發布時間: 2014-03-12 # beego 1.1.0 這個版本增加了一些新特性,修復了一些 bug 新特性 1. 支持 AddAPPStartHook 函數 2. 支持插件模式,支持 AddGroupRouter,用于插件路由設置 3. response 支持 HiJacker接口 4. AddFilter 支持批量匹配 5. session 重構,支持 Cookie 引擎 6. 主流 ORM 性能測試 7. config 增加 strings 接口,允許設置 8. 支持 controller 級別的模板渲染控制 9. 增加插件 basicauth,可以方便的使用該插件實現認證 10. #436 一次插入多個對象 11. #384 query map to struct bugfix 1. 修復 FileCache的bug 2. websocket 的例子修正引用庫 3. 當發生程序內部錯誤時。http 的 status 默認修改為 500 而不是 200 4. gmfim map in memzipfile.go file should use some synchronization mechanism (for example sync.RWMutex) otherwise it errors sometimes. 5. #440 on_delete 不自動刪除的問題 6. #441 時區問題 發布時間: 2014-02-10 # beego 1.0.0 經過了四個多月的重構開發,beego 終于發布了第一個正式穩定版本。這個版本我們進行了重構,同時針對很多細節進行了改進。下面列一些主要的改進功能: 1. 模塊化的設計,現在基本上 beego 做成一個輕量的組裝框架,重模塊的設計,目前實現了cache、config、logs、sessions、httplibs、toolbox、orm、context 等八個模塊,以后可能會更多。用戶可以直接引用這些模塊應用于自己的應用中,不僅僅局限于Web應用,beego 用戶中有應用 logs、config、cache 這些模塊到頁游、手游中。 2. 工程化的設計,部署項目之后,經常需要進行對線上程序進行各種信息的統計和分析,統計包括 QPS,分析包括 GC、內存使用量、CPU,如果出現問題的時候我們還希望通過 profile 來調試,那么 beego 都為你考慮到了這些,集成了監控模塊,默認是關閉的,用戶可以開啟,并在另一個端口監聽,通過 http://127.0.0.1:8088/ 訪問。 3. 詳細的文檔,這個版本的文檔全部是新寫的,在之前文檔用戶的各方面反饋之后,進行了很多細節上面的改進,目前文檔中英文版本都已經完成,中英文文檔的評論分離,針對不同的用戶群交流。 4. 豐富的示例,這一次更新我們開發組寫了三個例子,聊天室、短域名、todo 任務三個比較有典型意義的例子。讓用戶在熟悉 beego 之前有一個更深入的了解。 5. 全新設計的官方網站,這一次我們通過社區獲得了很多人的幫助,logo 設計,網站 UI 的改進。 6. 越來越多的用戶,官方網站列舉了一些典型的用戶,都是一些比較大的公司,他們內部都在使用beego開發對外的 API 應用,說明 beego 是得到了線上項目驗證的框架。 7. 越來越活躍的社區,在 github 上面目前已經差不多有 390 個的 issue,貢獻者超過 36 個,commit 超過了 700 個,Google groups 目前還在穩步發展中。 8. 周邊產品越來越多,基于beego的開源產品也越來越多,例如 cms 系統,https://github.com/insionng/toropress 例如管理后臺系統,https://github.com/beego/admin 9. beego 的輔助工具越來越強大,bee 工具是專門輔助用戶開發 beego 應用的,可以快速的創建應用,動態編譯,打包部署等 發布時間: 2013-12-19
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看