Documentation ¶
Index ¶
- type InMemoryStorer
- func (storer *InMemoryStorer) Clear()
- func (storer *InMemoryStorer) Contains(variableName string) bool
- func (storer *InMemoryStorer) GetValue(variableName string) (*Value, bool)
- func (storer *InMemoryStorer) GetValues() map[string]Value
- func (storer *InMemoryStorer) SetBooleanValue(variableName string, value bool)
- func (storer *InMemoryStorer) SetNumberValue(variableName string, value float64)
- func (storer *InMemoryStorer) SetStringValue(variableName string, value string)
- type Retriever
- type Storer
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryStorer ¶
type InMemoryStorer struct {
// contains filtered or unexported fields
}
InMemoryStorer stores variables from a dialogue using in-memory maps.
func NewInMemoryStorer ¶
func NewInMemoryStorer() *InMemoryStorer
NewInMemoryStorer creates a new empty InMemoryStorer.
func (*InMemoryStorer) Clear ¶
func (storer *InMemoryStorer) Clear()
Clear removes all variables from the store.
func (*InMemoryStorer) Contains ¶
func (storer *InMemoryStorer) Contains(variableName string) bool
Contains returns whether a variable with the given name is currently stored.
func (*InMemoryStorer) GetValue ¶
func (storer *InMemoryStorer) GetValue(variableName string) (*Value, bool)
GetValue returns the value of a variable, if it is stored.
func (*InMemoryStorer) GetValues ¶ added in v0.0.7
func (storer *InMemoryStorer) GetValues() map[string]Value
GetValues returns a map of all stored values.
func (*InMemoryStorer) SetBooleanValue ¶
func (storer *InMemoryStorer) SetBooleanValue(variableName string, value bool)
SetBooleanValue stores a boolean.
func (*InMemoryStorer) SetNumberValue ¶
func (storer *InMemoryStorer) SetNumberValue(variableName string, value float64)
SetNumberValue stores a number.
func (*InMemoryStorer) SetStringValue ¶
func (storer *InMemoryStorer) SetStringValue(variableName string, value string)
SetStringValue stores a string.
type Retriever ¶
type Retriever interface { GetValue(variableName string) (*Value, bool) GetValues() map[string]Value Contains(variableName string) bool }
Retriever allows to access stored variable values.
type Storer ¶
type Storer interface { Retriever SetNumberValue(variableName string, value float64) SetBooleanValue(variableName string, value bool) SetStringValue(variableName string, value string) Clear() }
Storer allows to access and modify stored variable values.
type Value ¶
Value holds an evaluated value of a YarnSpinner script.
func NewBoolean ¶
NewBoolean creates a new YarnSpinner dialogue value from the given boolean.