Documentation
¶
Index ¶
- func NewMessageStore(path string) (core.MessageStore, error)
- type DeliveryState
- type JSONMessageStore
- func (s *JSONMessageStore) GetConversation(ctx context.Context, userID, contactID string, limit int) ([]core.Message, error)
- func (s *JSONMessageStore) LatestSequenceForUser(ctx context.Context, userID string) uint64
- func (s *JSONMessageStore) MarkDelivered(ctx context.Context, messageID, userID string) error
- func (s *JSONMessageStore) PendingForUser(ctx context.Context, userID string) []core.Message
- func (s *JSONMessageStore) SaveMessage(ctx context.Context, msg core.Message, recipients []string) (core.Message, error)
- func (s *JSONMessageStore) SyncForUserAfterSequence(ctx context.Context, userID string, after uint64, limit int) ([]core.Message, bool)
- func (s *JSONMessageStore) SyncForUserSince(ctx context.Context, userID string, since time.Time) []core.Message
- type SQLMessageStore
- func (s *SQLMessageStore) GetConversation(ctx context.Context, userID, contactID string, limit int) ([]core.Message, error)
- func (s *SQLMessageStore) LatestSequenceForUser(ctx context.Context, userID string) uint64
- func (s *SQLMessageStore) MarkDelivered(ctx context.Context, messageID, userID string) error
- func (s *SQLMessageStore) PendingForUser(ctx context.Context, userID string) []core.Message
- func (s *SQLMessageStore) SaveMessage(ctx context.Context, msg core.Message, recipients []string) (core.Message, error)
- func (s *SQLMessageStore) SyncForUserAfterSequence(ctx context.Context, userID string, after uint64, limit int) ([]core.Message, bool)
- func (s *SQLMessageStore) SyncForUserSince(ctx context.Context, userID string, since time.Time) []core.Message
- type SQLRoomStore
- func (s *SQLRoomStore) AddMember(ctx context.Context, roomID, userID string) error
- func (s *SQLRoomStore) CreateRoom(ctx context.Context, name, roomType, ownerID string, memberIDs []string) (string, error)
- func (s *SQLRoomStore) GetRoom(ctx context.Context, roomID string) (core.RoomInfo, error)
- func (s *SQLRoomStore) ListUserRooms(ctx context.Context, userID string) ([]core.RoomInfo, error)
- func (s *SQLRoomStore) RemoveMember(ctx context.Context, roomID, userID string) error
- type StoredMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMessageStore ¶
func NewMessageStore(path string) (core.MessageStore, error)
NewMessageStore creates a new message store.
Types ¶
type DeliveryState ¶
type DeliveryState string
const ( DeliveryPending DeliveryState = "pending" DeliveryDelivered DeliveryState = "delivered" DeliveryRead DeliveryState = "read" )
type JSONMessageStore ¶
type JSONMessageStore struct {
// contains filtered or unexported fields
}
func (*JSONMessageStore) GetConversation ¶ added in v0.3.0
func (*JSONMessageStore) LatestSequenceForUser ¶
func (s *JSONMessageStore) LatestSequenceForUser(ctx context.Context, userID string) uint64
func (*JSONMessageStore) MarkDelivered ¶
func (s *JSONMessageStore) MarkDelivered(ctx context.Context, messageID, userID string) error
func (*JSONMessageStore) PendingForUser ¶
func (*JSONMessageStore) SaveMessage ¶
func (*JSONMessageStore) SyncForUserAfterSequence ¶
func (*JSONMessageStore) SyncForUserSince ¶
type SQLMessageStore ¶
type SQLMessageStore struct {
// contains filtered or unexported fields
}
func NewSQLMessageStore ¶
func NewSQLMessageStore(backend *db.Backend) (*SQLMessageStore, error)
NewSQLMessageStore creates a new SQL-based message store. If prefix is provided, it will be added to all table names (e.g. "mana_messages").
func NewSQLMessageStoreWithPrefix ¶
func NewSQLMessageStoreWithPrefix(backend *db.Backend, prefix string) (*SQLMessageStore, error)
func (*SQLMessageStore) GetConversation ¶ added in v0.3.0
func (*SQLMessageStore) LatestSequenceForUser ¶
func (s *SQLMessageStore) LatestSequenceForUser(ctx context.Context, userID string) uint64
func (*SQLMessageStore) MarkDelivered ¶
func (s *SQLMessageStore) MarkDelivered(ctx context.Context, messageID, userID string) error
func (*SQLMessageStore) PendingForUser ¶
func (*SQLMessageStore) SaveMessage ¶
func (*SQLMessageStore) SyncForUserAfterSequence ¶
func (*SQLMessageStore) SyncForUserSince ¶
type SQLRoomStore ¶ added in v0.3.0
type SQLRoomStore struct {
// contains filtered or unexported fields
}
func NewSQLRoomStore ¶ added in v0.3.0
func NewSQLRoomStore(backend *db.Backend) (*SQLRoomStore, error)
func NewSQLRoomStoreWithPrefix ¶ added in v0.3.0
func NewSQLRoomStoreWithPrefix(backend *db.Backend, prefix string) (*SQLRoomStore, error)
func (*SQLRoomStore) AddMember ¶ added in v0.3.0
func (s *SQLRoomStore) AddMember(ctx context.Context, roomID, userID string) error
func (*SQLRoomStore) CreateRoom ¶ added in v0.3.0
func (*SQLRoomStore) ListUserRooms ¶ added in v0.3.0
func (*SQLRoomStore) RemoveMember ¶ added in v0.3.0
func (s *SQLRoomStore) RemoveMember(ctx context.Context, roomID, userID string) error
type StoredMessage ¶
type StoredMessage struct {
Message core.Message `json:"message"`
Recipients []string `json:"recipients"`
Delivery map[string]DeliveryState `json:"delivery"`
}
Click to show internal directories.
Click to hide internal directories.