-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from aichaos/feature/session-store
Implement pluggable session store and make it threadsafe
- Loading branch information
Showing
28 changed files
with
779 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export GOPATH="$(pwd)/.gopath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Package config provides the RiveScript configuration type. | ||
package config | ||
|
||
import ( | ||
"github.com/aichaos/rivescript-go/sessions" | ||
"github.com/aichaos/rivescript-go/sessions/memory" | ||
) | ||
|
||
// Type Config configures a RiveScript instance. | ||
type Config struct { | ||
// Debug enables verbose debug logging to your standard output. | ||
Debug bool | ||
|
||
// Strict enables strict syntax checking. | ||
Strict bool | ||
|
||
// Depth sets the recursion depth limit. The zero value will default to | ||
// 50 levels deep. | ||
Depth uint | ||
|
||
// UTF8 enables UTF-8 support for user messages and triggers. | ||
UTF8 bool | ||
|
||
// SessionManager chooses a session manager for user variables. | ||
SessionManager sessions.SessionManager | ||
} | ||
|
||
// Basic creates a default configuration: | ||
// | ||
// - Strict: true | ||
// - Depth: 50 | ||
// - UTF8: false | ||
func Basic() *Config { | ||
return &Config{ | ||
Strict: true, | ||
Depth: 50, | ||
UTF8: false, | ||
SessionManager: memory.New(), | ||
} | ||
} | ||
|
||
// UTF8 creates a default configuration with UTF-8 mode enabled. | ||
// | ||
// - Strict: true | ||
// - Depth: 50 | ||
// - UTF8: true | ||
func UTF8() *Config { | ||
return &Config{ | ||
Strict: true, | ||
Depth: 50, | ||
UTF8: true, | ||
SessionManager: memory.New(), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.