Documentation ¶
Index ¶
- Variables
- type Config
- type PeerSyncing
- func (p *PeerSyncing) Add(message SyncMessage) error
- func (p *PeerSyncing) AvailableMessages() ([]SyncMessage, error)
- func (p *PeerSyncing) AvailableMessagesMapByChatIDs(groupIDs [][]byte, limit int) (map[string][][]byte, error)
- func (p *PeerSyncing) MessagesByIDs(messageIDs [][]byte) ([]SyncMessage, error)
- func (p *PeerSyncing) OnOffer(messages []SyncMessage) ([]SyncMessage, error)
- type SyncMessage
- type SyncMessagePersistence
- type SyncMessageSQLitePersistence
- func (p *SyncMessageSQLitePersistence) Add(message SyncMessage) error
- func (p *SyncMessageSQLitePersistence) All() ([]SyncMessage, error)
- func (p *SyncMessageSQLitePersistence) ByChatIDs(ids [][]byte, limit int) ([]SyncMessage, error)
- func (p *SyncMessageSQLitePersistence) ByMessageIDs(ids [][]byte) ([]SyncMessage, error)
- func (p *SyncMessageSQLitePersistence) Complement(messages []SyncMessage) ([]SyncMessage, error)
- type SyncMessageType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSyncMessageNotValid = errors.New("sync message not valid")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SyncMessagePersistence SyncMessagePersistence Database *sql.DB Timesource common.TimeSource }
type PeerSyncing ¶
type PeerSyncing struct {
// contains filtered or unexported fields
}
func New ¶
func New(config Config) *PeerSyncing
func (*PeerSyncing) Add ¶
func (p *PeerSyncing) Add(message SyncMessage) error
func (*PeerSyncing) AvailableMessages ¶
func (p *PeerSyncing) AvailableMessages() ([]SyncMessage, error)
func (*PeerSyncing) AvailableMessagesMapByChatIDs ¶ added in v0.179.17
func (*PeerSyncing) MessagesByIDs ¶
func (p *PeerSyncing) MessagesByIDs(messageIDs [][]byte) ([]SyncMessage, error)
func (*PeerSyncing) OnOffer ¶
func (p *PeerSyncing) OnOffer(messages []SyncMessage) ([]SyncMessage, error)
type SyncMessage ¶
type SyncMessage struct { ID []byte Type SyncMessageType ChatID []byte Payload []byte Timestamp uint64 }
func (*SyncMessage) Valid ¶
func (s *SyncMessage) Valid() error
type SyncMessagePersistence ¶
type SyncMessagePersistence interface { Add(SyncMessage) error All() ([]SyncMessage, error) Complement([]SyncMessage) ([]SyncMessage, error) ByChatIDs([][]byte, int) ([]SyncMessage, error) ByMessageIDs([][]byte) ([]SyncMessage, error) }
type SyncMessageSQLitePersistence ¶
type SyncMessageSQLitePersistence struct {
// contains filtered or unexported fields
}
func NewSyncMessageSQLitePersistence ¶
func NewSyncMessageSQLitePersistence(db *sql.DB) *SyncMessageSQLitePersistence
func (*SyncMessageSQLitePersistence) Add ¶
func (p *SyncMessageSQLitePersistence) Add(message SyncMessage) error
func (*SyncMessageSQLitePersistence) All ¶
func (p *SyncMessageSQLitePersistence) All() ([]SyncMessage, error)
func (*SyncMessageSQLitePersistence) ByChatIDs ¶ added in v0.179.17
func (p *SyncMessageSQLitePersistence) ByChatIDs(ids [][]byte, limit int) ([]SyncMessage, error)
func (*SyncMessageSQLitePersistence) ByMessageIDs ¶
func (p *SyncMessageSQLitePersistence) ByMessageIDs(ids [][]byte) ([]SyncMessage, error)
func (*SyncMessageSQLitePersistence) Complement ¶
func (p *SyncMessageSQLitePersistence) Complement(messages []SyncMessage) ([]SyncMessage, error)
type SyncMessageType ¶
type SyncMessageType int
const ( SyncMessageNoType SyncMessageType = iota SyncMessageCommunityType SyncMessageOneToOneType SyncMessagePrivateGroup )
Click to show internal directories.
Click to hide internal directories.