storage

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 (s *JSONMessageStore) GetConversation(ctx context.Context, userID, contactID string, limit int) ([]core.Message, error)

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 (s *JSONMessageStore) PendingForUser(ctx context.Context, userID string) []core.Message

func (*JSONMessageStore) SaveMessage

func (s *JSONMessageStore) SaveMessage(ctx context.Context, msg core.Message, recipients []string) (core.Message, error)

func (*JSONMessageStore) SyncForUserAfterSequence

func (s *JSONMessageStore) SyncForUserAfterSequence(ctx context.Context, userID string, after uint64, limit int) ([]core.Message, bool)

func (*JSONMessageStore) SyncForUserSince

func (s *JSONMessageStore) SyncForUserSince(ctx context.Context, userID string, since time.Time) []core.Message

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 (s *SQLMessageStore) GetConversation(ctx context.Context, userID, contactID string, limit int) ([]core.Message, error)

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 (s *SQLMessageStore) PendingForUser(ctx context.Context, userID string) []core.Message

func (*SQLMessageStore) SaveMessage

func (s *SQLMessageStore) SaveMessage(ctx context.Context, msg core.Message, recipients []string) (core.Message, error)

func (*SQLMessageStore) SyncForUserAfterSequence

func (s *SQLMessageStore) SyncForUserAfterSequence(ctx context.Context, userID string, after uint64, limit int) ([]core.Message, bool)

func (*SQLMessageStore) SyncForUserSince

func (s *SQLMessageStore) SyncForUserSince(ctx context.Context, userID string, since time.Time) []core.Message

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 (s *SQLRoomStore) CreateRoom(ctx context.Context, name, roomType, ownerID string, memberIDs []string) (string, error)

func (*SQLRoomStore) GetRoom added in v0.3.0

func (s *SQLRoomStore) GetRoom(ctx context.Context, roomID string) (core.RoomInfo, error)

func (*SQLRoomStore) ListUserRooms added in v0.3.0

func (s *SQLRoomStore) ListUserRooms(ctx context.Context, userID string) ([]core.RoomInfo, error)

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"`
}

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL