Documentation ¶
Overview ¶
Package rivescript contains all of the private use functions of RiveScript.
Do Not Use This Package Directly ¶
You should not use any exported symbols from this package directly. They are not stable and are subject to change at any time without notice.
As an end user of the RiveScript library you should stick purely to the exported API functions of the base RiveScript package and any other subpackages (for example: parser and ast) but leave the src package alone!
Documentation for most exported functions is available in the root RiveScript package, which acts as a wrapper. Go there for documentation. Stop looking at this package lest you be tempted to use it (don't).
You've been warned. Here be dragons.
Index ¶
- type RiveScript
- func (rs *RiveScript) ClearAllUservars()
- func (rs *RiveScript) ClearUservars(username string)
- func (rs *RiveScript) CurrentUser() string
- func (rs *RiveScript) DeleteSubroutine(name string)
- func (rs *RiveScript) DumpSorted()
- func (rs *RiveScript) DumpTopics()
- func (rs *RiveScript) FreezeUservars(username string) error
- func (rs *RiveScript) GetAllUservars() map[string]*sessions.UserData
- func (rs *RiveScript) GetGlobal(name string) (string, error)
- func (rs *RiveScript) GetUservar(username string, name string) (string, error)
- func (rs *RiveScript) GetUservars(username string) (*sessions.UserData, error)
- func (rs *RiveScript) GetVariable(name string) (string, error)
- func (rs *RiveScript) LastMatch(username string) (string, error)
- func (rs *RiveScript) LoadDirectory(path string, extensions ...string) error
- func (rs *RiveScript) LoadFile(path string) error
- func (rs *RiveScript) RemoveHandler(lang string)
- func (rs *RiveScript) Reply(username string, message string) string
- func (rs *RiveScript) SetDebug(value bool)
- func (rs *RiveScript) SetDepth(value uint)
- func (rs *RiveScript) SetGlobal(name string, value string)
- func (rs *RiveScript) SetHandler(lang string, handler macro.MacroInterface)
- func (rs *RiveScript) SetPerson(name string, value string)
- func (rs *RiveScript) SetStrict(value bool)
- func (rs *RiveScript) SetSubroutine(name string, fn Subroutine)
- func (rs *RiveScript) SetSubstitution(name string, value string)
- func (rs *RiveScript) SetUTF8(value bool)
- func (rs *RiveScript) SetUnicodePunctuation(value string)
- func (rs *RiveScript) SetUservar(username string, name string, value string)
- func (rs *RiveScript) SetUservars(username string, data map[string]string)
- func (rs *RiveScript) SetVariable(name string, value string)
- func (rs *RiveScript) SortReplies()
- func (rs *RiveScript) Stream(code string) error
- func (rs *RiveScript) ThawUservars(username string, action sessions.ThawAction) error
- type Subroutine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RiveScript ¶
type RiveScript struct { // Parameters Debug bool // Debug mode Strict bool // Strictly enforce RiveScript syntax Depth uint // Max depth for recursion UTF8 bool // Support UTF-8 RiveScript code UnicodePunctuation *regexp.Regexp // contains filtered or unexported fields }
func New ¶
func New(cfg *config.Config) *RiveScript
func (*RiveScript) ClearAllUservars ¶
func (rs *RiveScript) ClearAllUservars()
func (*RiveScript) ClearUservars ¶
func (rs *RiveScript) ClearUservars(username string)
func (*RiveScript) CurrentUser ¶
func (rs *RiveScript) CurrentUser() string
func (*RiveScript) DeleteSubroutine ¶
func (rs *RiveScript) DeleteSubroutine(name string)
func (*RiveScript) DumpSorted ¶
func (rs *RiveScript) DumpSorted()
func (*RiveScript) DumpTopics ¶
func (rs *RiveScript) DumpTopics()
func (*RiveScript) FreezeUservars ¶
func (rs *RiveScript) FreezeUservars(username string) error
func (*RiveScript) GetAllUservars ¶
func (rs *RiveScript) GetAllUservars() map[string]*sessions.UserData
func (*RiveScript) GetUservar ¶
func (rs *RiveScript) GetUservar(username string, name string) (string, error)
func (*RiveScript) GetUservars ¶
func (rs *RiveScript) GetUservars(username string) (*sessions.UserData, error)
func (*RiveScript) GetVariable ¶
func (rs *RiveScript) GetVariable(name string) (string, error)
func (*RiveScript) LoadDirectory ¶
func (rs *RiveScript) LoadDirectory(path string, extensions ...string) error
func (*RiveScript) LoadFile ¶
func (rs *RiveScript) LoadFile(path string) error
func (*RiveScript) RemoveHandler ¶
func (rs *RiveScript) RemoveHandler(lang string)
func (*RiveScript) SetDebug ¶
func (rs *RiveScript) SetDebug(value bool)
func (*RiveScript) SetDepth ¶
func (rs *RiveScript) SetDepth(value uint)
func (*RiveScript) SetGlobal ¶
func (rs *RiveScript) SetGlobal(name string, value string)
func (*RiveScript) SetHandler ¶
func (rs *RiveScript) SetHandler(lang string, handler macro.MacroInterface)
func (*RiveScript) SetPerson ¶
func (rs *RiveScript) SetPerson(name string, value string)
func (*RiveScript) SetStrict ¶
func (rs *RiveScript) SetStrict(value bool)
func (*RiveScript) SetSubroutine ¶
func (rs *RiveScript) SetSubroutine(name string, fn Subroutine)
func (*RiveScript) SetSubstitution ¶
func (rs *RiveScript) SetSubstitution(name string, value string)
func (*RiveScript) SetUTF8 ¶
func (rs *RiveScript) SetUTF8(value bool)
func (*RiveScript) SetUnicodePunctuation ¶
func (rs *RiveScript) SetUnicodePunctuation(value string)
func (*RiveScript) SetUservar ¶
func (rs *RiveScript) SetUservar(username string, name string, value string)
func (*RiveScript) SetUservars ¶
func (rs *RiveScript) SetUservars(username string, data map[string]string)
func (*RiveScript) SetVariable ¶
func (rs *RiveScript) SetVariable(name string, value string)
func (*RiveScript) SortReplies ¶
func (rs *RiveScript) SortReplies()
func (*RiveScript) Stream ¶
func (rs *RiveScript) Stream(code string) error
func (*RiveScript) ThawUservars ¶
func (rs *RiveScript) ThawUservars(username string, action sessions.ThawAction) error
type Subroutine ¶
type Subroutine func(*RiveScript, []string) string
Subroutine is a Golang function type for defining an object macro in Go. TODO: get this exportable to third party devs somehow