From 087c8c8b3a149c5746c61c67c641e2974334af6d Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos Date: Wed, 2 May 2018 06:40:18 +0300 Subject: [PATCH] Update to (minor) version 10.6.2. Added: `websocket/Connection#OnPong` and `websocket/Connection#OnError(func(error))` instead of `func(string)` relative issues: https://github.com/kataras/iris/pull/988 and https://github.com/kataras/iris/issues/987 respectfully. Former-commit-id: 76d4fda4ab4f34f8a251c8c2d5bb1ae7c3ef7047 --- HISTORY.md | 5 +++++ HISTORY_GR.md | 4 ++++ HISTORY_ZH.md | 4 ++++ README.md | 2 +- README_GR.md | 2 +- README_RU.md | 2 +- README_ZH.md | 2 +- VERSION | 2 +- core/maintenance/version.go | 2 +- doc.go | 2 +- websocket/connection.go | 15 ++++++++++----- 11 files changed, 30 insertions(+), 12 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index da9091be..d3ba4aae 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -17,6 +17,11 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene **How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris` or let the automatic updater do that for you. +# Tu, 01 May 2018 | v10.6.2 + +- Websocket: added OnPong to Connection via PR: https://github.com/kataras/iris/pull/988 +- Websocket: `OnError` accepts a `func(error)` now instead of `func(string)`, as requested at: https://github.com/kataras/iris/issues/987 + # We, 25 April 2018 | v10.6.1 - Re-implement the [BoltDB](https://github.com/coreos/bbolt) as built'n back-end storage for sessions(`sessiondb`) using the latest features: [/sessions/sessiondb/boltdb/database.go](sessions/sessiondb/boltdb/database.go), example can be found at [/_examples/sessions/database/boltdb/main.go](_examples/sessions/database/boltdb/main.go). diff --git a/HISTORY_GR.md b/HISTORY_GR.md index ac144fe9..d183e227 100644 --- a/HISTORY_GR.md +++ b/HISTORY_GR.md @@ -17,6 +17,10 @@ **Πώς να αναβαθμίσετε**: Ανοίξτε την γραμμή εντολών σας και εκτελέστε αυτήν την εντολή: `go get -u github.com/kataras/iris` ή αφήστε το αυτόματο updater να το κάνει αυτό για σας. +# Tu, 01 May 2018 | v10.6.2 + +This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-01-may-2018--v1062) instead. + # We, 25 April 2018 | v10.6.1 This history entry is not translated yet to the Greek language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#we-25-april-2018--v1061) instead. diff --git a/HISTORY_ZH.md b/HISTORY_ZH.md index ca5596ee..9c55638b 100644 --- a/HISTORY_ZH.md +++ b/HISTORY_ZH.md @@ -17,6 +17,10 @@ **如何升级**: 打开命令行执行以下命令: `go get -u github.com/kataras/iris` 或者等待自动更新。 +# Tu, 01 May 2018 | v10.6.2 + +This history entry is not translated yet to the Chinese language yet, please refer to the english version of the [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#tu-01-may-2018--v1062) instead. + # 2018 4月25日 | v10.6.1 版本更新 - 用最新版 BoltDB 重新实现 session (`sessiondb`) 存储:[/sessions/sessiondb/boltdb/database.go](sessions/sessiondb/boltdb/database.go), 相关示例 [/_examples/sessions/database/boltdb/main.go](_examples/sessions/database/boltdb/main.go). diff --git a/README.md b/README.md index c99c0a7a..4b73bbb8 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ _Updated at: [Tuesday, 21 November 2017](_benchmarks/README_UNIX.md)_ ## Support -- [HISTORY](HISTORY.md#we-25-april-2018--v1061) file is your best friend, it contains information about the latest features and changes +- [HISTORY](HISTORY.md#tu-01-may-2018--v1062) file is your best friend, it contains information about the latest features and changes - Did you happen to find a bug? Post it at [github issues](https://github.com/kataras/iris/issues) - Do you have any questions or need to speak with someone experienced to solve a problem at real-time? Join us to the [community chat](https://chat.iris-go.com) - Complete our form-based user experience report by clicking [here](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/README_GR.md b/README_GR.md index 7a286e3f..87cb7324 100644 --- a/README_GR.md +++ b/README_GR.md @@ -108,7 +108,7 @@ _Η τελευταία ενημέρωση έγινε την [Τρίτη, 21 Νο ## Υποστήριξη -- To [HISTORY](HISTORY_GR.md#we-25-april-2018--v1061) αρχείο είναι ο καλύτερος σας φίλος, περιέχει πληροφορίες σχετικά με τις τελευταίες λειτουργίες(features) και αλλαγές +- To [HISTORY](HISTORY_GR.md#tu-01-may-2018--v1062) αρχείο είναι ο καλύτερος σας φίλος, περιέχει πληροφορίες σχετικά με τις τελευταίες λειτουργίες(features) και αλλαγές - Μήπως τυχαίνει να βρήκατε κάποιο bug; Δημοσιεύστε το στα [github issues](https://github.com/kataras/iris/issues) - Έχετε οποιεσδήποτε ερωτήσεις ή πρέπει να μιλήσετε με κάποιον έμπειρο για την επίλυση ενός προβλήματος σε πραγματικό χρόνο; Ελάτε μαζί μας στην [συνομιλία κοινότητας](https://chat.iris-go.com) - Συμπληρώστε την αναφορά εμπειρίας χρήστη κάνοντας κλικ [εδώ](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/README_RU.md b/README_RU.md index 05c53bef..1b2055e9 100644 --- a/README_RU.md +++ b/README_RU.md @@ -106,7 +106,7 @@ _Обновлено: [Вторник, 21 ноября 2017 г.](_benchmarks/READ ## Поддержка -- Файл [HISTORY](HISTORY.md#we-25-april-2018--v1061) - ваш лучший друг, он содержит информацию о последних особенностях и всех изменениях +- Файл [HISTORY](HISTORY.md#tu-01-may-2018--v1062) - ваш лучший друг, он содержит информацию о последних особенностях и всех изменениях - Вы случайно обнаружили ошибку? Опубликуйте ее на [Github вопросы](https://github.com/kataras/iris/issues) - У Вас есть какие-либо вопросы или Вам нужно поговорить с кем-то, кто бы смог решить Вашу проблему в режиме реального времени? Присоединяйтесь к нам в [чате сообщества](https://chat.iris-go.com) - Заполните наш отчет о пользовательском опыте на основе формы, нажав [здесь](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/README_ZH.md b/README_ZH.md index 73fcad1b..1a1642a7 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -102,7 +102,7 @@ _更新于: [2017年11月21日星期二](_benchmarks/README_UNIX.md)_ ## 支持 -- [更新记录](HISTORY_ZH.md#we-25-april-2018--v1061) 是您最好的朋友,它包含有关最新功能和更改的信息 +- [更新记录](HISTORY_ZH.md#tu-01-may-2018--v1062) 是您最好的朋友,它包含有关最新功能和更改的信息 - 你碰巧找到了一个错误? 请提交 [github issues](https://github.com/kataras/iris/issues) - 您是否有任何疑问或需要与有经验的人士交谈以实时解决问题? [加入我们的聊天](https://chat.iris-go.com) - [点击这里完成我们基于表单的用户体验报告](https://docs.google.com/forms/d/e/1FAIpQLSdCxZXPANg_xHWil4kVAdhmh7EBBHQZ_4_xSZVDL-oCC_z5pA/viewform?usp=sf_link) diff --git a/VERSION b/VERSION index ef1e0c88..9927db93 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.6.1:https://github.com/kataras/iris/blob/master/HISTORY.md#we-25-april-2018--v1061 \ No newline at end of file +10.6.2:https://github.com/kataras/iris/blob/master/HISTORY.md#tu-01-may-2018--v1062 \ No newline at end of file diff --git a/core/maintenance/version.go b/core/maintenance/version.go index b5041125..c0cc288b 100644 --- a/core/maintenance/version.go +++ b/core/maintenance/version.go @@ -13,7 +13,7 @@ import ( const ( // Version is the string representation of the current local Iris Web Framework version. - Version = "10.6.1" + Version = "10.6.2" ) // CheckForUpdates checks for any available updates diff --git a/doc.go b/doc.go index 242b2c8c..c5ad7308 100644 --- a/doc.go +++ b/doc.go @@ -35,7 +35,7 @@ Source code and other details for the project are available at GitHub: Current Version -10.6.1 +10.6.2 Installation diff --git a/websocket/connection.go b/websocket/connection.go index 027ebc75..08defffe 100644 --- a/websocket/connection.go +++ b/websocket/connection.go @@ -125,7 +125,7 @@ type ( // (because websocket server automatically leaves from all joined rooms) LeaveRoomFunc func(roomName string) // ErrorFunc is the callback which fires whenever an error occurs - ErrorFunc (func(string)) + ErrorFunc (func(error)) // NativeMessageFunc is the callback for native websocket messages, receives one []byte parameter which is the raw client's message NativeMessageFunc func([]byte) // MessageFunc is the second argument to the Emitter's Emit functions. @@ -172,7 +172,7 @@ type ( // FireOnError can be used to send a custom error message to the connection // // It does nothing more than firing the OnError listeners. It doesn't send anything to the client. - FireOnError(errorMessage string) + FireOnError(err error) // To defines on what "room" (see Join) the server should send a message // returns an Emmiter(`EmitMessage` & `Emit`) to send messages. To(string) Emitter @@ -249,6 +249,11 @@ type ( var _ Connection = &connection{} +// CloseMessage denotes a close control message. The optional message +// payload contains a numeric code and text. Use the FormatCloseMessage +// function to format a close message payload. +// +// Use the `Connection#Disconnect` instead. const CloseMessage = websocket.CloseMessage func newConnection(ctx context.Context, s *Server, underlineConn UnderlineConnection, id string) *connection { @@ -395,7 +400,7 @@ func (c *connection) startReader() { _, data, err := conn.ReadMessage() if err != nil { if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) { - c.FireOnError(err.Error()) + c.FireOnError(err) } break } else { @@ -492,9 +497,9 @@ func (c *connection) OnPong(cb PongFunc) { c.onPongListeners = append(c.onPongListeners, cb) } -func (c *connection) FireOnError(errorMessage string) { +func (c *connection) FireOnError(err error) { for _, cb := range c.onErrorListeners { - cb(errorMessage) + cb(err) } }