Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSendMessage = errors.New("failed to send message") ErrGetMessage = errors.New("failed to get message") ErrDeleteMessage = errors.New("failed to delete message") ErrJSONEncode = errors.New("failed to encode json") ErrRollback = errors.New("failed rollback") ErrCommit = errors.New("failed commit") ErrOptimisticConcurrency = errors.New("different version") ErrNotFoundEntity = errors.New("entity not found") )
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func New ¶
func New(s *discordgo.Session) *Connection
func (*Connection) Save ¶
func (c *Connection) Save( entityCh, eventCh, snapshotCh string, entityID string, snapshotOpt OptionalSnapshot, events ...Event, ) error
func (*Connection) Update ¶
func (c *Connection) Update( entityCh, eventCh, snapshotCh string, entityID string, version uint64, snapshotOpt OptionalSnapshot, events ...Event, ) error
type EntitySchema ¶
type EntitySchema struct { Version uint64 `json:"version"` ID string `json:"id"` Last MessageKey `json:"last"` }
type EventSchema ¶
type MessageKey ¶
type OptionalEntityMessage ¶
type OptionalEntityMessage struct { Ok bool Schema EntitySchema MessageKey MessageKey }
type OptionalSnapshot ¶
type OptionalSnapshotMessage ¶
type OptionalSnapshotMessage struct { Ok bool Schema SnapshotSchema MessageKey MessageKey }
type SnapshotSchema ¶
type SnapshotSchema struct { Version uint64 `json:"version"` EntityID string `json:"entityID"` Last MessageKey `json:"last"` Data map[string]interface{} `json:"data"` }
Click to show internal directories.
Click to hide internal directories.