Documentation ¶
Index ¶
- type ConversationData
- type ConversationState
- type GORMPersistence
- func (p *GORMPersistence) AutoMigrate() error
- func (p *GORMPersistence) GetData(pk tm.PersistenceKey) tm.Data
- func (p *GORMPersistence) GetState(pk tm.PersistenceKey) string
- func (p *GORMPersistence) SetData(pk tm.PersistenceKey, data tm.Data)
- func (p *GORMPersistence) SetState(pk tm.PersistenceKey, state string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversationData ¶
type ConversationData struct { tm.PersistenceKey Data datatypes.JSONMap `gorm:"not null"` }
ConversationData is a model that contains conversation data for users.
type ConversationState ¶
type ConversationState struct { tm.PersistenceKey State string `gorm:"not null"` }
ConversationState is a model that contains conversation states for users.
type GORMPersistence ¶
GORMPersistence is an implementation of Persistence. It stores conversation states & conversation data in database via GORM.
func (*GORMPersistence) AutoMigrate ¶
func (p *GORMPersistence) AutoMigrate() error
AutoMigrate creates tables for ConversationState & ConversationData models
func (*GORMPersistence) GetData ¶
func (p *GORMPersistence) GetData(pk tm.PersistenceKey) tm.Data
GetData reads conversation data from database
func (*GORMPersistence) GetState ¶
func (p *GORMPersistence) GetState(pk tm.PersistenceKey) string
GetState reads conversation state from database
func (*GORMPersistence) SetData ¶
func (p *GORMPersistence) SetData(pk tm.PersistenceKey, data tm.Data)
SetData writes conversation data to database
func (*GORMPersistence) SetState ¶
func (p *GORMPersistence) SetState(pk tm.PersistenceKey, state string)
SetState writes conversation state to database
Click to show internal directories.
Click to hide internal directories.