|
2 | 2 |
|
3 | 3 | This documents the history of significant changes to `rivescript-go`.
|
4 | 4 |
|
| 5 | +## v0.1.0 - Dec 11, 2016 |
| 6 | + |
| 7 | +This update changes some function prototypes in the API which breaks backward |
| 8 | +compatibility with existing code. |
| 9 | + |
| 10 | +* **API Breaking Changes:** |
| 11 | + * `rivescript.New()` now takes a `*config.Config` struct to configure the |
| 12 | + instance. This is now the preferred way to configure debug mode, strict |
| 13 | + mode, UTF-8, etc. rather than functions like `SetUTF8()`. |
| 14 | + |
| 15 | + For RiveScript's default settings, you can do `rivescript.New(config.Basic())` |
| 16 | + or `rivescript.New(nil)`. For UTF-8 support, `rivescript.New(config.UTF8())` |
| 17 | + is a convenient config template to use. |
| 18 | + * `GetDepth()` and `SetDepth()` now use a `uint` instead of an `int`. But |
| 19 | + these functions are deprecated anyway. |
| 20 | + * `GetUservars()` and `GetAllUservars()` return `*sessions.UserData` objects |
| 21 | + instead of `map[string]string` for the user data. |
| 22 | + * `ThawUservars()` now takes a `sessions.ThawAction` instead of a string to |
| 23 | + specify the action. Valid values are `Thaw`, `Discard`, or `Keep` |
| 24 | + (constants from the `sessions` package). |
| 25 | +* **Deprecated Functions:** |
| 26 | + * Configuration functions (getters and setters). Use the `Config` struct |
| 27 | + when calling `rivescript.New(*config.Config)` instead: |
| 28 | + * `SetDebug()`, `SetUTF8()`, `SetDepth()`, `SetStrict()` |
| 29 | + * `GetDebug()`, `GetUTF8()`, `GetDepth()`, `GetStrict()` |
| 30 | +* **Changes:** |
| 31 | + * Add support for pluggable session stores for user variables. The default |
| 32 | + one still keeps user variables in memory, but you can specify your own |
| 33 | + implementation instead. |
| 34 | + |
| 35 | + The interface for a `SessionManager` is in the `sessions` package. The |
| 36 | + default in-memory manager is in `sessions/memory`. By implementing your own |
| 37 | + session manager, you can change where RiveScript keeps track of user |
| 38 | + variables, e.g. to put them in a database or cache. |
| 39 | + * Make the library thread-safe with regards to getting/setting user variables |
| 40 | + while answering a message. The default in-memory session manager implements |
| 41 | + a mutex for accessing user variables. |
| 42 | + |
5 | 43 | ## v0.0.3 - Sept 28, 2016
|
6 | 44 |
|
7 | 45 | This update was all about restructuring the internal source code to make certain
|
|
0 commit comments