Documentation
¶
Index ¶
- Variables
- 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) Clear(ctx context.Context) (err Error)
- 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) ServerVersion(ctx context.Context) (vers int, err Error)
- func (i *Inbox) SetStatus(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, ...) (err Error)
- func (i *Inbox) Sync(ctx context.Context, vers chat1.InboxVers, convs []chat1.Conversation) (err Error)
- func (i *Inbox) TlfFinalize(ctx context.Context, vers chat1.InboxVers, convIDs []chat1.ConversationID, ...) (err Error)
- func (i *Inbox) Version(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 ResultCollector
- type SecretUI
- type ServerVersions
- func (s *ServerVersions) Fetch(ctx context.Context) (chat1.ServerCacheVers, error)
- func (s *ServerVersions) MatchBodies(ctx context.Context, vers int) (int, error)
- func (s *ServerVersions) MatchInbox(ctx context.Context, vers int) (int, error)
- func (s *ServerVersions) Set(ctx context.Context, vers chat1.ServerCacheVers) (err error)
- type SimpleResultCollector
- func (s *SimpleResultCollector) Done() bool
- func (s *SimpleResultCollector) Error(err Error) Error
- func (s *SimpleResultCollector) Name() string
- func (s *SimpleResultCollector) Push(msg chat1.MessageUnboxed)
- func (s *SimpleResultCollector) Result() []chat1.MessageUnboxed
- func (s *SimpleResultCollector) String() string
- 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 TypedResultCollector
- func (t *TypedResultCollector) Done() bool
- func (t *TypedResultCollector) Error(err Error) Error
- func (t *TypedResultCollector) Name() string
- func (t *TypedResultCollector) Push(msg chat1.MessageUnboxed)
- func (t *TypedResultCollector) Result() []chat1.MessageUnboxed
- func (t *TypedResultCollector) String() string
- type VersionMismatchError
Constants ¶
This section is empty.
Variables ¶
var DefaultSecretUI = func() libkb.SecretUI { return SecretUI{} }
Functions ¶
func CheckAndRecordBodyHash ¶ added in v1.0.19
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 ¶ added in v1.0.19
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 ¶ added in v1.0.19
type ByCtimeOrder ¶ added in v1.0.19
type ByCtimeOrder []chat1.OutboxRecord
func (ByCtimeOrder) Len ¶ added in v1.0.19
func (a ByCtimeOrder) Len() int
func (ByCtimeOrder) Less ¶ added in v1.0.19
func (a ByCtimeOrder) Less(i, j int) bool
func (ByCtimeOrder) Swap ¶ added in v1.0.19
func (a ByCtimeOrder) Swap(i, j int)
type ByDatabaseOrder ¶ added in v1.0.19
type ByDatabaseOrder []chat1.Conversation
func (ByDatabaseOrder) Len ¶ added in v1.0.19
func (a ByDatabaseOrder) Len() int
func (ByDatabaseOrder) Less ¶ added in v1.0.19
func (a ByDatabaseOrder) Less(i, j int) bool
func (ByDatabaseOrder) Swap ¶ added in v1.0.19
func (a ByDatabaseOrder) Swap(i, j int)
type Inbox ¶ added in v1.0.19
type Inbox struct { libkb.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func (*Inbox) Merge ¶ added in v1.0.19
func (i *Inbox) Merge(ctx context.Context, vers chat1.InboxVers, convsIn []chat1.Conversation, query *chat1.GetInboxQuery, p *chat1.Pagination) (err Error)
func (*Inbox) NewConversation ¶ added in v1.0.19
func (*Inbox) NewMessage ¶ added in v1.0.19
func (i *Inbox) NewMessage(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, msg chat1.MessageBoxed) (err Error)
func (*Inbox) Read ¶ added in v1.0.19
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 ¶ added in v1.0.19
func (*Inbox) ServerVersion ¶ added in v1.0.21
func (*Inbox) SetStatus ¶ added in v1.0.19
func (i *Inbox) SetStatus(ctx context.Context, vers chat1.InboxVers, convID chat1.ConversationID, status chat1.ConversationStatus) (err Error)
func (*Inbox) TlfFinalize ¶ added in v1.0.19
func (i *Inbox) TlfFinalize(ctx context.Context, vers chat1.InboxVers, convIDs []chat1.ConversationID, finalizeInfo chat1.ConversationFinalizeInfo) (err Error)
type InternalError ¶ added in v1.0.19
type InternalError struct {
Msg string
}
func NewInternalError ¶ added in v1.0.19
func NewInternalError(ctx context.Context, d utils.DebugLabeler, msg string, args ...interface{}) InternalError
func (InternalError) Error ¶ added in v1.0.19
func (e InternalError) Error() string
func (InternalError) Message ¶ added in v1.0.19
func (e InternalError) Message() string
func (InternalError) ShouldClear ¶ added in v1.0.19
func (e InternalError) ShouldClear() bool
type MiscError ¶ added in v1.0.19
type MiscError struct {
Msg string
}
func (MiscError) ShouldClear ¶ added in v1.0.19
type MissError ¶ added in v1.0.19
type MissError struct {
Msg string
}
func (MissError) ShouldClear ¶ added in v1.0.19
type Outbox ¶ added in v1.0.19
type Outbox struct { libkb.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func (*Outbox) MarkAsError ¶ added in v1.0.19
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 ¶ added in v1.0.19
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 ¶ added in v1.0.19
func (o *Outbox) PushMessage(ctx context.Context, convID chat1.ConversationID, msg chat1.MessagePlaintext, identifyBehavior keybase1.TLFIdentifyBehavior) (rec chat1.OutboxRecord, err Error)
func (*Outbox) RecordFailedAttempt ¶ added in v1.0.19
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 ¶ added in v1.0.19
func (*Outbox) RetryMessage ¶ added in v1.0.19
func (*Outbox) SprinkleIntoThread ¶ added in v1.0.19
func (o *Outbox) SprinkleIntoThread(ctx context.Context, convID chat1.ConversationID, thread *chat1.ThreadView) error
type PrevChecker ¶ added in v1.0.19
type RemoteError ¶ added in v1.0.19
type RemoteError struct {
Msg string
}
func (RemoteError) Error ¶ added in v1.0.19
func (e RemoteError) Error() string
func (RemoteError) Message ¶ added in v1.0.19
func (e RemoteError) Message() string
func (RemoteError) ShouldClear ¶ added in v1.0.19
func (e RemoteError) ShouldClear() bool
type ResultCollector ¶ added in v1.0.21
type ResultCollector interface { Push(msg chat1.MessageUnboxed) Done() bool Result() []chat1.MessageUnboxed Error(err Error) Error Name() string String() string }
type SecretUI ¶ added in v1.0.21
type SecretUI struct { }
func (SecretUI) GetPassphrase ¶ added in v1.0.21
func (d SecretUI) GetPassphrase(pinentry keybase1.GUIEntryArg, terminal *keybase1.SecretEntryArg) (keybase1.GetPassphraseRes, error)
type ServerVersions ¶ added in v1.0.21
type ServerVersions struct { libkb.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func NewServerVersions ¶ added in v1.0.21
func NewServerVersions(g *libkb.GlobalContext) *ServerVersions
func (*ServerVersions) Fetch ¶ added in v1.0.21
func (s *ServerVersions) Fetch(ctx context.Context) (chat1.ServerCacheVers, error)
func (*ServerVersions) MatchBodies ¶ added in v1.0.21
func (*ServerVersions) MatchInbox ¶ added in v1.0.21
func (*ServerVersions) Set ¶ added in v1.0.21
func (s *ServerVersions) Set(ctx context.Context, vers chat1.ServerCacheVers) (err error)
type SimpleResultCollector ¶ added in v1.0.21
type SimpleResultCollector struct {
// contains filtered or unexported fields
}
simpleResultCollector aggregates all results in a the basic way. It is not thread safe.
func NewSimpleResultCollector ¶ added in v1.0.21
func NewSimpleResultCollector(num int) *SimpleResultCollector
func (*SimpleResultCollector) Done ¶ added in v1.0.21
func (s *SimpleResultCollector) Done() bool
func (*SimpleResultCollector) Error ¶ added in v1.0.21
func (s *SimpleResultCollector) Error(err Error) Error
func (*SimpleResultCollector) Name ¶ added in v1.0.21
func (s *SimpleResultCollector) Name() string
func (*SimpleResultCollector) Push ¶ added in v1.0.21
func (s *SimpleResultCollector) Push(msg chat1.MessageUnboxed)
func (*SimpleResultCollector) Result ¶ added in v1.0.21
func (s *SimpleResultCollector) Result() []chat1.MessageUnboxed
func (*SimpleResultCollector) String ¶ added in v1.0.21
func (s *SimpleResultCollector) String() string
type Storage ¶
type Storage struct { libkb.Contextified utils.DebugLabeler // contains filtered or unexported fields }
func New ¶
func New(g *libkb.GlobalContext) *Storage
func (*Storage) Fetch ¶
func (s *Storage) Fetch(ctx context.Context, conv chat1.Conversation, uid gregor1.UID, rc ResultCollector, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (chat1.ThreadView, Error)
func (*Storage) FetchMessages ¶ added in v1.0.19
func (*Storage) FetchUpToLocalMaxMsgID ¶ added in v1.0.19
func (s *Storage) FetchUpToLocalMaxMsgID(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, rc ResultCollector, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (chat1.ThreadView, Error)
func (*Storage) GetMaxMsgID ¶ added in v1.0.19
func (*Storage) IsTLFIdentifyBroken ¶ added in v1.0.19
func (*Storage) Merge ¶
func (s *Storage) Merge(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) Error
func (*Storage) UpdateTLFIdentifyBreak ¶ added in v1.0.19
type TypedResultCollector ¶ added in v1.0.21
type TypedResultCollector struct {
// contains filtered or unexported fields
}
typedResultCollector aggregates results with a type contraints. It is not thread safe.
func NewTypedResultCollector ¶ added in v1.0.21
func NewTypedResultCollector(num int, typs []chat1.MessageType) *TypedResultCollector
func (*TypedResultCollector) Done ¶ added in v1.0.21
func (t *TypedResultCollector) Done() bool
func (*TypedResultCollector) Error ¶ added in v1.0.21
func (t *TypedResultCollector) Error(err Error) Error
func (*TypedResultCollector) Name ¶ added in v1.0.21
func (t *TypedResultCollector) Name() string
func (*TypedResultCollector) Push ¶ added in v1.0.21
func (t *TypedResultCollector) Push(msg chat1.MessageUnboxed)
func (*TypedResultCollector) Result ¶ added in v1.0.21
func (t *TypedResultCollector) Result() []chat1.MessageUnboxed
func (*TypedResultCollector) String ¶ added in v1.0.21
func (t *TypedResultCollector) String() string
type VersionMismatchError ¶ added in v1.0.19
type VersionMismatchError struct {
// contains filtered or unexported fields
}
func NewVersionMismatchError ¶ added in v1.0.19
func NewVersionMismatchError(oldVers chat1.InboxVers, newVers chat1.InboxVers) VersionMismatchError
func (VersionMismatchError) Error ¶ added in v1.0.19
func (e VersionMismatchError) Error() string
func (VersionMismatchError) Message ¶ added in v1.0.19
func (e VersionMismatchError) Message() string
func (VersionMismatchError) ShouldClear ¶ added in v1.0.19
func (e VersionMismatchError) ShouldClear() bool