Documentation ¶
Index ¶
- Constants
- type BaseSceneError
- type BaseTextError
- type Button
- type Command
- type Context
- func (c *Context) Get(key ContextKey) (value any, exists bool)
- func (c *Context) GetBool(key ContextKey) (b bool)
- func (c *Context) GetDuration(key ContextKey) (d time.Duration)
- func (c *Context) GetFloat64(key ContextKey) (f64 float64)
- func (c *Context) GetInt(key ContextKey) (i int)
- func (c *Context) GetInt64(key ContextKey) (i64 int64)
- func (c *Context) GetString(key ContextKey) (s string)
- func (c *Context) GetStringMap(key ContextKey) (sm map[string]any)
- func (c *Context) GetStringMapString(key ContextKey) (sms map[string]string)
- func (c *Context) GetStringMapStringSlice(key ContextKey) (smss map[string][]string)
- func (c *Context) GetStringSlice(key ContextKey) (ss []string)
- func (c *Context) GetTime(key ContextKey) (t time.Time)
- func (c *Context) GetUint(key ContextKey) (ui uint)
- func (c *Context) GetUint64(key ContextKey) (ui64 uint64)
- func (c *Context) MustGet(key ContextKey) any
- func (c *Context) Set(key ContextKey, value any)
- type ContextKey
- type Error
- type Info
- type MessageMatcher
- type Request
- type Scene
- type Text
- type UserInfo
Constants ¶
const ( NoCommand = Command(0) ApplyStashedScene = Command(1) FinishScene = Command(2) StashScene = Command(3) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseSceneError ¶
type BaseSceneError struct {
Scene Scene
}
func (BaseSceneError) GetErrorScene ¶
func (bse BaseSceneError) GetErrorScene() Scene
func (BaseSceneError) GetErrorText ¶
func (bse BaseSceneError) GetErrorText() string
func (BaseSceneError) IsErrorScene ¶
func (bse BaseSceneError) IsErrorScene() bool
type BaseTextError ¶
type BaseTextError struct {
Message string
}
func (BaseTextError) GetErrorScene ¶
func (bte BaseTextError) GetErrorScene() Scene
func (BaseTextError) GetErrorText ¶
func (bte BaseTextError) GetErrorText() string
func (BaseTextError) IsErrorScene ¶
func (bte BaseTextError) IsErrorScene() bool
type Context ¶
func (*Context) Get ¶
func (c *Context) Get(key ContextKey) (value any, exists bool)
Get returns the value for the given key, ie: (value, true). If the value does not exist it returns (nil, false)
func (*Context) GetBool ¶
func (c *Context) GetBool(key ContextKey) (b bool)
GetBool returns the value associated with the key as a boolean.
func (*Context) GetDuration ¶
func (c *Context) GetDuration(key ContextKey) (d time.Duration)
GetDuration returns the value associated with the key as a duration.
func (*Context) GetFloat64 ¶
func (c *Context) GetFloat64(key ContextKey) (f64 float64)
GetFloat64 returns the value associated with the key as a float64.
func (*Context) GetInt ¶
func (c *Context) GetInt(key ContextKey) (i int)
GetInt returns the value associated with the key as an integer.
func (*Context) GetInt64 ¶
func (c *Context) GetInt64(key ContextKey) (i64 int64)
GetInt64 returns the value associated with the key as an integer.
func (*Context) GetString ¶
func (c *Context) GetString(key ContextKey) (s string)
GetString returns the value associated with the key as a string.
func (*Context) GetStringMap ¶
func (c *Context) GetStringMap(key ContextKey) (sm map[string]any)
GetStringMap returns the value associated with the key as a map of interfaces.
func (*Context) GetStringMapString ¶
func (c *Context) GetStringMapString(key ContextKey) (sms map[string]string)
GetStringMapString returns the value associated with the key as a map of strings.
func (*Context) GetStringMapStringSlice ¶
func (c *Context) GetStringMapStringSlice(key ContextKey) (smss map[string][]string)
GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.
func (*Context) GetStringSlice ¶
func (c *Context) GetStringSlice(key ContextKey) (ss []string)
GetStringSlice returns the value associated with the key as a slice of strings.
func (*Context) GetTime ¶
func (c *Context) GetTime(key ContextKey) (t time.Time)
GetTime returns the value associated with the key as time.
func (*Context) GetUint ¶
func (c *Context) GetUint(key ContextKey) (ui uint)
GetUint returns the value associated with the key as an unsigned integer.
func (*Context) GetUint64 ¶
func (c *Context) GetUint64(key ContextKey) (ui64 uint64)
GetUint64 returns the value associated with the key as an unsigned integer.
func (*Context) MustGet ¶
func (c *Context) MustGet(key ContextKey) any
MustGet returns the value for the given key if it exists, otherwise it panics.
func (*Context) Set ¶
func (c *Context) Set(key ContextKey, value any)
Set is used to store a new key/value pair exclusively for this context. It also lazy initializes c.Keys if it was not used previously.
type ContextKey ¶
type ContextKey string
type Info ¶
type Info struct { Text Text Buttons []Button ExpectedMessages []MessageMatcher Err Error }