Documentation
¶
Index ¶
- func CheckAndRecordBodyHash(g *libkb.GlobalContext, bodyHash chat1.Hash, uniqueMsgID chat1.MessageID, ...) error
- func CheckAndRecordPrevPointer(g *libkb.GlobalContext, msgID chat1.MessageID, convID chat1.ConversationID, ...) error
- type BodyHashChecker
- type ByCtimeOrder
- type ByDatabaseOrder
- type Error
- type Inbox
- func (i *Inbox) Merge(ctx context.Context, vers chat1.InboxVers, convsIn []chat1.Conversation, ...) (err Error)
- func (i *Inbox) NewConversation(ctx context.Context, vers chat1.InboxVers, conv chat1.Conversation) (err Error)
- func (i *Inbox) NewMessage(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, ...) (err Error)
- func (i *Inbox) Read(ctx context.Context, query *chat1.GetInboxQuery, p *chat1.Pagination) (vers chat1.InboxVers, res []chat1.Conversation, pagination *chat1.Pagination, ...)
- func (i *Inbox) ReadAll(ctx context.Context) (vers chat1.InboxVers, res []chat1.Conversation, err Error)
- func (i *Inbox) ReadMessage(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, ...) (err Error)
- func (i *Inbox) SetStatus(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, ...) (err Error)
- func (i *Inbox) TlfFinalize(ctx context.Context, vers chat1.InboxVers, convIDs []chat1.ConversationID, ...) (err Error)
- func (i *Inbox) VersionSync(ctx context.Context, vers chat1.InboxVers) (err Error)
- type InternalError
- type MiscError
- type MissError
- type Outbox
- func (o *Outbox) GetUID() gregor1.UID
- func (o *Outbox) MarkAsError(ctx context.Context, obr chat1.OutboxRecord, errRec chat1.OutboxStateError) error
- func (o *Outbox) PullAllConversations(ctx context.Context, includeErrors bool, remove bool) ([]chat1.OutboxRecord, error)
- func (o *Outbox) PushMessage(ctx context.Context, convID chat1.ConversationID, msg chat1.MessagePlaintext, ...) (rec chat1.OutboxRecord, err Error)
- func (o *Outbox) RecordFailedAttempt(ctx context.Context, oldObr chat1.OutboxRecord) error
- func (o *Outbox) RemoveMessage(ctx context.Context, obid chat1.OutboxID) error
- func (o *Outbox) RetryMessage(ctx context.Context, obid chat1.OutboxID) error
- func (o *Outbox) SetClock(cl clockwork.Clock)
- func (o *Outbox) SprinkleIntoThread(ctx context.Context, convID chat1.ConversationID, thread *chat1.ThreadView) error
- type PrevChecker
- type RemoteError
- type Storage
- func (s *Storage) Fetch(ctx context.Context, conv chat1.Conversation, uid gregor1.UID, ...) (chat1.ThreadView, Error)
- func (s *Storage) FetchMessages(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, ...) ([]*chat1.MessageUnboxed, error)
- func (s *Storage) FetchUpToLocalMaxMsgID(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, ...) (chat1.ThreadView, Error)
- func (s *Storage) GetMaxMsgID(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID) (chat1.MessageID, error)
- func (s *Storage) IsTLFIdentifyBroken(ctx context.Context, tlfID chat1.TLFID) bool
- func (s *Storage) MaybeNuke(force bool, err Error, convID chat1.ConversationID, uid gregor1.UID) Error
- func (s *Storage) Merge(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, ...) Error
- func (s *Storage) UpdateTLFIdentifyBreak(ctx context.Context, tlfID chat1.TLFID, breaks []keybase1.TLFIdentifyFailure) error
- type VersionMismatchError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndRecordBodyHash ¶
func CheckAndRecordBodyHash(g *libkb.GlobalContext, bodyHash chat1.Hash, uniqueMsgID chat1.MessageID, uniqueConvID chat1.ConversationID) error
Check the current message's body hash against all the body hashes we've seen, to prevent replays. If the header hash is new, add it to the set.
func CheckAndRecordPrevPointer ¶
func CheckAndRecordPrevPointer(g *libkb.GlobalContext, msgID chat1.MessageID, convID chat1.ConversationID, uniqueHeaderHash chat1.Hash) error
Check the current message's header hash against all the prev pointers we've ever seen. If the current message is new, add it to the set.
Types ¶
type BodyHashChecker ¶
type ByCtimeOrder ¶
type ByCtimeOrder []chat1.OutboxRecord
func (ByCtimeOrder) Len ¶
func (a ByCtimeOrder) Len() int
func (ByCtimeOrder) Less ¶
func (a ByCtimeOrder) Less(i, j int) bool
func (ByCtimeOrder) Swap ¶
func (a ByCtimeOrder) Swap(i, j int)
type ByDatabaseOrder ¶
type ByDatabaseOrder []chat1.Conversation
func (ByDatabaseOrder) Len ¶
func (a ByDatabaseOrder) Len() int
func (ByDatabaseOrder) Less ¶
func (a ByDatabaseOrder) Less(i, j int) bool
func (ByDatabaseOrder) Swap ¶
func (a ByDatabaseOrder) Swap(i, j int)
type Inbox ¶
type Inbox struct {
libkb.Contextified
utils.DebugLabeler
// contains filtered or unexported fields
}
func (*Inbox) Merge ¶
func (i *Inbox) Merge(ctx context.Context, vers chat1.InboxVers, convsIn []chat1.Conversation, query *chat1.GetInboxQuery, p *chat1.Pagination) (err Error)
func (*Inbox) NewConversation ¶
func (*Inbox) NewMessage ¶
func (i *Inbox) NewMessage(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, msg chat1.MessageBoxed) (err Error)
func (*Inbox) Read ¶
func (i *Inbox) Read(ctx context.Context, query *chat1.GetInboxQuery, p *chat1.Pagination) (vers chat1.InboxVers, res []chat1.Conversation, pagination *chat1.Pagination, err Error)
func (*Inbox) ReadMessage ¶
func (*Inbox) SetStatus ¶
func (i *Inbox) SetStatus(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, status chat1.ConversationStatus) (err Error)
func (*Inbox) TlfFinalize ¶
func (i *Inbox) TlfFinalize(ctx context.Context, vers chat1.InboxVers, convIDs []chat1.ConversationID, finalizeInfo chat1.ConversationFinalizeInfo) (err Error)
type InternalError ¶
type InternalError struct {
Msg string
}
func NewInternalError ¶
func NewInternalError(ctx context.Context, d utils.DebugLabeler, msg string, args ...interface{}) InternalError
func (InternalError) Error ¶
func (e InternalError) Error() string
func (InternalError) Message ¶
func (e InternalError) Message() string
func (InternalError) ShouldClear ¶
func (e InternalError) ShouldClear() bool
type Outbox ¶
type Outbox struct {
libkb.Contextified
utils.DebugLabeler
// contains filtered or unexported fields
}
func (*Outbox) MarkAsError ¶
func (o *Outbox) MarkAsError(ctx context.Context, obr chat1.OutboxRecord, errRec chat1.OutboxStateError) error
MarkAsError will either mark an existing record as an error, or it will add the passed record as an error with the specified error state
func (*Outbox) PullAllConversations ¶
func (o *Outbox) PullAllConversations(ctx context.Context, includeErrors bool, remove bool) ([]chat1.OutboxRecord, error)
PullAllConversations grabs all outbox entries for the current outbox, and optionally deletes them from storage
func (*Outbox) PushMessage ¶
func (o *Outbox) PushMessage(ctx context.Context, convID chat1.ConversationID, msg chat1.MessagePlaintext, identifyBehavior keybase1.TLFIdentifyBehavior) (rec chat1.OutboxRecord, err Error)
func (*Outbox) RecordFailedAttempt ¶
RecordFailedAttempt will either modify an existing matching record (if sending) to next attempt number, or if the record doesn't exist it adds it in.
func (*Outbox) RemoveMessage ¶
func (*Outbox) RetryMessage ¶
func (*Outbox) SprinkleIntoThread ¶
func (o *Outbox) SprinkleIntoThread(ctx context.Context, convID chat1.ConversationID, thread *chat1.ThreadView) error
type PrevChecker ¶
type RemoteError ¶
type RemoteError struct {
Msg string
}
func (RemoteError) Error ¶
func (e RemoteError) Error() string
func (RemoteError) Message ¶
func (e RemoteError) Message() string
func (RemoteError) ShouldClear ¶
func (e RemoteError) ShouldClear() bool
type Storage ¶
type Storage struct {
libkb.Contextified
utils.DebugLabeler
// contains filtered or unexported fields
}
func (*Storage) Fetch ¶
func (s *Storage) Fetch(ctx context.Context, conv chat1.Conversation, uid gregor1.UID, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (chat1.ThreadView, Error)
func (*Storage) FetchMessages ¶
func (*Storage) FetchUpToLocalMaxMsgID ¶
func (s *Storage) FetchUpToLocalMaxMsgID(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (chat1.ThreadView, Error)
func (*Storage) GetMaxMsgID ¶
func (*Storage) IsTLFIdentifyBroken ¶
func (*Storage) Merge ¶
func (s *Storage) Merge(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) Error
func (*Storage) UpdateTLFIdentifyBreak ¶
type VersionMismatchError ¶
type VersionMismatchError struct {
// contains filtered or unexported fields
}
func NewVersionMismatchError ¶
func NewVersionMismatchError(oldVers chat1.InboxVers, newVers chat1.InboxVers) VersionMismatchError
func (VersionMismatchError) Error ¶
func (e VersionMismatchError) Error() string
func (VersionMismatchError) Message ¶
func (e VersionMismatchError) Message() string
func (VersionMismatchError) ShouldClear ¶
func (e VersionMismatchError) ShouldClear() bool