rivescript

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2016 License: MIT Imports: 16 Imported by: 0

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

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) GetGlobal

func (rs *RiveScript) GetGlobal(name string) (string, error)

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) LastMatch

func (rs *RiveScript) LastMatch(username 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) Reply

func (rs *RiveScript) Reply(username string, message string) 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL