Documentation ¶
Index ¶
- Constants
- type MessageStore
- type MessageStoreFactory
- func NewFileStoreFactory(settings map[string]string) MessageStoreFactory
- func NewMemoryStoreFactory() MessageStoreFactory
- func NewMongoStoreFactory(dbURL string, dbName string) MessageStoreFactory
- func NewMongoStoreFactoryWithTablePrefix(dbURL string, dbName string, tablePrefix string) MessageStoreFactory
- func NewSQLStoreFactory(settings map[string]string) MessageStoreFactory
Constants ¶
const ( // SQLStoreDriver is the driverName that will be passed to database/sql, e.g. "sqlite", "mysql". SQLStoreDriver string = "SQLStoreDriver" // SQLStoreDataSourceName is the dataSourceName that will be passed to database/sql. SQLStoreDataSourceName string = "SQLStoreDataSourceName" // SQLStoreConnMaxLifetime is the value that will be passed to database/sql SetConnMaxLifetime. SQLStoreConnMaxLifetime string = "SQLStoreConnMaxLifetime" // SQLStoreTableNamePrefix will be prepended to the names of the database tables. Optional. SQLStoreTableNamePrefix string = "SQLStoreTableNamePrefix" )
const ( // FileStorePath is the name of the filesystem directory that will be used. FileStorePath string = "FileStorePath" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageStore ¶
type MessageStore interface { NextSenderMsgSeqNum() int NextTargetMsgSeqNum() int IncrNextSenderMsgSeqNum() error IncrNextTargetMsgSeqNum() error SetNextSenderMsgSeqNum(next int) error SetNextTargetMsgSeqNum(next int) error CreationTime() time.Time SaveMessage(seqNum int, msg []byte) error GetMessages(beginSeqNum, endSeqNum int) ([][]byte, error) Refresh() error Reset() error Close() error }
The MessageStore interface provides methods to record and retrieve messages for resend purposes
type MessageStoreFactory ¶
type MessageStoreFactory interface {
Create(sessionID string) (MessageStore, error)
}
The MessageStoreFactory interface is used by session to create a session specific message store
func NewFileStoreFactory ¶
func NewFileStoreFactory(settings map[string]string) MessageStoreFactory
NewFileStoreFactory returns a file-based implementation of MessageStoreFactory
func NewMemoryStoreFactory ¶
func NewMemoryStoreFactory() MessageStoreFactory
NewMemoryStoreFactory returns a MessageStoreFactory instance that created in-memory MessageStores
func NewMongoStoreFactory ¶
func NewMongoStoreFactory(dbURL string, dbName string) MessageStoreFactory
NewMongoStoreFactory returns a transactional, mongo-based implementation of MessageStoreFactory
func NewMongoStoreFactoryWithTablePrefix ¶
func NewMongoStoreFactoryWithTablePrefix(dbURL string, dbName string, tablePrefix string) MessageStoreFactory
NewMongoStoreFactoryWithTablePrefix returns an initialized MessageStoreFactory that will use the provided prefix for table names
func NewSQLStoreFactory ¶
func NewSQLStoreFactory(settings map[string]string) MessageStoreFactory
NewSQLStoreFactory returns a sql-based implementation of MessageStoreFactory