Documentation ¶
Index ¶
- Variables
- type Callback
- type Chain
- func (c *Chain) DeletePosition(of tb.Recipient)
- func (c *Chain) GetBot() *tb.Bot
- func (c *Chain) GetId() string
- func (c *Chain) GetPosition(of tb.Recipient) (*Node, bool)
- func (c *Chain) GetRoot() *Node
- func (c *Chain) Process(m *tb.Message) bool
- func (c *Chain) Search(nodeId string) (*Node, bool)
- func (c *Chain) SetDefaultHandler(endpoint Callback) *Chain
- func (c *Chain) SetPosition(of tb.Recipient, node *Node)
- func (c *Chain) Start(to tb.Recipient, text string, options ...interface{}) (err error)
- type Node
- func (e *Node) CheckEvent(m *tb.Message) bool
- func (e *Node) GetEndpoint() Callback
- func (e *Node) GetFlow() *Chain
- func (e *Node) GetId() string
- func (e *Node) Next() *Node
- func (e *Node) Previous() *Node
- func (e *Node) SearchDown(nodeId string) (*Node, bool)
- func (e *Node) SearchUp(nodeId string) (*Node, bool)
- func (e *Node) Then(id string, endpoint Callback, expectedEvent string) *Node
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChainIsEmpty = errors.New("chain has zero handlers")
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
A flow is chain or double-linked list of events organized by type
func NewChainFlow ¶
Creates a new chain flow
func (*Chain) DeletePosition ¶
Deletes the user current position in the flow
func (*Chain) GetPosition ¶
Gets the user position in the flow
func (*Chain) Process ¶
Process with the next flow iteration Returns true only if the iteration was successful
func (*Chain) SetDefaultHandler ¶
Get the root node
func (*Chain) SetPosition ¶
Sets the user current position in the flow
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is an element in a double-linked list
func (*Node) CheckEvent ¶
Checks if the message type is matching the node type
func (*Node) SearchDown ¶
Tries to find a node with ID down the list
Click to show internal directories.
Click to hide internal directories.