store

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxTime

func MaxTime(a, b time.Time) time.Time

Types

type FileSyncStore

type FileSyncStore struct {
	// contains filtered or unexported fields
}

FileSyncStore stores sync token and filter ID on disk.

func NewFileSyncStore

func NewFileSyncStore(path string) (*FileSyncStore, error)

func (*FileSyncStore) LoadFilterID

func (s *FileSyncStore) LoadFilterID(_ context.Context, _ id.UserID) (string, error)

func (*FileSyncStore) LoadNextBatch

func (s *FileSyncStore) LoadNextBatch(_ context.Context, _ id.UserID) (string, error)

func (*FileSyncStore) SaveFilterID

func (s *FileSyncStore) SaveFilterID(_ context.Context, _ id.UserID, filterID string) error

func (*FileSyncStore) SaveNextBatch

func (s *FileSyncStore) SaveNextBatch(_ context.Context, _ id.UserID, nextBatch string) error

type JoinStore

type JoinStore struct {

	// room_id -> join_ts_millis
	JoinTS map[id.RoomID]int64 `json:"join_ts"`
	// contains filtered or unexported fields
}

func NewJoinStore

func NewJoinStore(path string) (*JoinStore, error)

func (*JoinStore) Get

func (s *JoinStore) Get(roomID id.RoomID) (int64, bool)

func (*JoinStore) Set

func (s *JoinStore) Set(roomID id.RoomID, tsMillis int64) error

Set without conditions overwrites the value.

func (*JoinStore) SetIfEarlier

func (s *JoinStore) SetIfEarlier(roomID id.RoomID, tsMillis int64) error

func (*JoinStore) SetIfLater

func (s *JoinStore) SetIfLater(roomID id.RoomID, tsMillis int64) error

SetIfLater saves tsMillis only if it's LATER than what's already saved (or if the value doesn't exist yet). This is what's needed for "from the last entry."

type PrevBatchStore

type PrevBatchStore struct {
	// contains filtered or unexported fields
}

func NewPrevBatchStore

func NewPrevBatchStore() *PrevBatchStore

func (*PrevBatchStore) Get

func (s *PrevBatchStore) Get(roomID id.RoomID) (string, bool)

func (*PrevBatchStore) Set

func (s *PrevBatchStore) Set(roomID id.RoomID, token string)

Jump to

Keyboard shortcuts

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