chat

package
v1.0.39 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: BSD-3-Clause, BSD-3-Clause Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentMessageBoxedVersion = chat1.MessageBoxedVersion_V2

Variables

View Source
var ActiveIntervalAfterSend = 30 * 24 * time.Hour
View Source
var ErrAbortOnPartMismatch = errors.New("local part mismatch, aborting upload")

ErrAbortOnPartMismatch is returned when there is a mismatch between a current part and a previous attempt part. If ErrAbortOnPartMismatch is returned, the caller should abort the upload attempt and start from scratch.

View Source
var ErrChatServerTimeout = errors.New("timeout calling chat server")
View Source
var ErrDuplicateConnection = errors.New("error calling chat server")
View Source
var ErrKeyServerTimeout = errors.New("timeout calling into key server")
View Source
var ErrPartNotFound = errors.New("part does not exist in stash")
View Source
var InitialAssumedActiveInterval = 24 * time.Hour

All devices are presumed active for the first 24 hours. See comment below.

Functions

func BackgroundContext added in v1.0.19

func BackgroundContext(sourceCtx context.Context, g *globals.Context) context.Context

func Context added in v1.0.19

func CtxAddLogTags added in v1.0.19

func CtxAddLogTags(ctx context.Context, env appTypeSource) context.Context

func CtxTrace added in v1.0.27

func CtxTrace(ctx context.Context) (string, bool)

func CurrentUID added in v1.0.27

func CurrentUID(g *globals.Context) (keybase1.UID, error)

func FindConversations added in v1.0.27

func FindConversations(ctx context.Context, g *globals.Context, debugger utils.DebugLabeler,
	ri func() chat1.RemoteInterface, uid gregor1.UID, tlfName string, topicType chat1.TopicType,
	membersTypeIn chat1.ConversationMembersType, vis keybase1.TLFVisibility, topicName string,
	oneChatPerTLF *bool) (res []chat1.ConversationLocal, rl []chat1.RateLimit, err error)

func GetInboxQueryNameInfo added in v1.0.27

func GetInboxQueryNameInfo(ctx context.Context, g *globals.Context,
	lquery *chat1.GetInboxLocalQuery) (types.NameInfo, error)

func GetLastSendTime added in v1.0.39

func GetLastSendTime(ctx context.Context, g *globals.Context, log utils.DebugLabeler) time.Time

Returns the zero time if there is no recorded last send time (either because the device has never sent a message, or because it hasn't sent one since we started recording).

func GetTopicNameState added in v1.0.27

func GetTopicNameState(ctx context.Context, g *globals.Context, debugger utils.DebugLabeler,
	convs []chat1.ConversationLocal,
	uid gregor1.UID, tlfID chat1.TLFID, topicType chat1.TopicType,
	membersType chat1.ConversationMembersType) (res chat1.TopicNameState, err error)

func GetUnverifiedConv added in v1.0.27

func GetUnverifiedConv(ctx context.Context, g *globals.Context, uid gregor1.UID,
	convID chat1.ConversationID, useLocalData bool) (chat1.Conversation, *chat1.RateLimit, error)

func IdentifyMode added in v1.0.19

func IdentifyMode(ctx context.Context) (ib keybase1.TLFIdentifyBehavior, breaks *[]keybase1.TLFIdentifyFailure, ok bool)

func IdentifyModeCtx added in v1.0.22

func JoinConversation added in v1.0.27

func JoinConversation(ctx context.Context, g *globals.Context, debugger utils.DebugLabeler,
	ri func() chat1.RemoteInterface, uid gregor1.UID, convID chat1.ConversationID) (rl []chat1.RateLimit, err error)

func LeaveConversation added in v1.0.27

func LeaveConversation(ctx context.Context, g *globals.Context, debugger utils.DebugLabeler,
	ri func() chat1.RemoteInterface, uid gregor1.UID, convID chat1.ConversationID) (rl []chat1.RateLimit, err error)

func NewConversation added in v1.0.27

func NewConversation(ctx context.Context, g *globals.Context, uid gregor1.UID, tlfName string, topicName *string,
	topicType chat1.TopicType, membersType chat1.ConversationMembersType, vis keybase1.TLFVisibility,
	ri func() chat1.RemoteInterface) (chat1.ConversationLocal, []chat1.RateLimit, error)

func NewConversationSource

func NewConversationSource(g *globals.Context, typ string, boxer *Boxer, storage *storage.Storage,
	ri func() chat1.RemoteInterface) types.ConversationSource

func NewInboxSource added in v1.0.19

func NewInboxSource(g *globals.Context, typ string, ri func() chat1.RemoteInterface) types.InboxSource

func PreviewConversation added in v1.0.34

func PreviewConversation(ctx context.Context, g *globals.Context, debugger utils.DebugLabeler,
	ri func() chat1.RemoteInterface, uid gregor1.UID, convID chat1.ConversationID) (rl []chat1.RateLimit, err error)

func RecentConversationParticipants added in v1.0.27

func RecentConversationParticipants(ctx context.Context, g *globals.Context, myUID gregor1.UID) ([]gregor1.UID, error)

func RecordChatSend added in v1.0.39

func RecordChatSend(ctx context.Context, g *globals.Context, log utils.DebugLabeler)

func TouchFirstChatActiveQueryTime added in v1.0.39

func TouchFirstChatActiveQueryTime(ctx context.Context, g *globals.Context, log utils.DebugLabeler) time.Time

If no first query time is found in the local db, this function writes the current time.

Types

type AttachmentInfo added in v1.0.19

type AttachmentInfo struct {
	ObjectKey string                   // s3 destination
	EncKey    signencrypt.SecretboxKey // encryption key
	SignKey   signencrypt.SignKey      // signing key
	VerifyKey signencrypt.VerifyKey    // verification key
	Parts     map[int]string           // map of parts uploaded to S3, key == part number, value == hash of ciphertext
	StartedAt time.Time                // when the upload started
}

type AttachmentStash added in v1.0.19

type AttachmentStash interface {
	Start(key StashKey, info AttachmentInfo) error
	Lookup(key StashKey) (AttachmentInfo, bool, error)
	RecordPart(key StashKey, partNumber int, hash string) error
	Finish(key StashKey) error
}

type AttachmentStore added in v1.0.19

type AttachmentStore struct {
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewAttachmentStore added in v1.0.19

func NewAttachmentStore(log logger.Logger, runtimeDir string) *AttachmentStore

NewAttachmentStore creates a standard AttachmentStore that uses a real S3 connection.

func (*AttachmentStore) DeleteAsset added in v1.0.19

func (a *AttachmentStore) DeleteAsset(ctx context.Context, params chat1.S3Params, signer s3.Signer, asset chat1.Asset) error

func (*AttachmentStore) DeleteAssets added in v1.0.19

func (a *AttachmentStore) DeleteAssets(ctx context.Context, params chat1.S3Params, signer s3.Signer, assets []chat1.Asset) error

func (*AttachmentStore) DownloadAsset added in v1.0.19

func (a *AttachmentStore) DownloadAsset(ctx context.Context, params chat1.S3Params, asset chat1.Asset, w io.Writer, signer s3.Signer, progress ProgressReporter) error

DownloadAsset gets an object from S3 as described in asset.

func (*AttachmentStore) PutS3 added in v1.0.19

func (a *AttachmentStore) PutS3(ctx context.Context, r io.Reader, size int64, task *UploadTask, previous *AttachmentInfo) (*PutS3Result, error)

PutS3 uploads the data in Reader r to S3. It chooses whether to use putSingle or putMultiPipeline based on the size of the object.

func (*AttachmentStore) UploadAsset added in v1.0.19

func (a *AttachmentStore) UploadAsset(ctx context.Context, task *UploadTask) (chat1.Asset, error)

type BackgroundConvLoader added in v1.0.27

type BackgroundConvLoader struct {
	globals.Contextified
	utils.DebugLabeler
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBackgroundConvLoader added in v1.0.27

func NewBackgroundConvLoader(g *globals.Context) *BackgroundConvLoader

func (*BackgroundConvLoader) Queue added in v1.0.27

func (*BackgroundConvLoader) Start added in v1.0.27

func (b *BackgroundConvLoader) Start(ctx context.Context, uid gregor1.UID)

func (*BackgroundConvLoader) Stop added in v1.0.27

func (b *BackgroundConvLoader) Stop(ctx context.Context) chan struct{}

type BlockingLocalizer added in v1.0.19

type BlockingLocalizer struct {
	globals.Contextified
	// contains filtered or unexported fields
}

func NewBlockingLocalizer added in v1.0.19

func NewBlockingLocalizer(g *globals.Context) *BlockingLocalizer

func (*BlockingLocalizer) Localize added in v1.0.19

func (b *BlockingLocalizer) Localize(ctx context.Context, uid gregor1.UID, inbox types.Inbox) (res []chat1.ConversationLocal, err error)

func (*BlockingLocalizer) Name added in v1.0.19

func (b *BlockingLocalizer) Name() string

func (*BlockingLocalizer) SetOffline added in v1.0.19

func (b *BlockingLocalizer) SetOffline()

type BlockingSender added in v1.0.19

type BlockingSender struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewBlockingSender added in v1.0.19

func NewBlockingSender(g *globals.Context, boxer *Boxer, store *AttachmentStore,
	getRi func() chat1.RemoteInterface) *BlockingSender

func (*BlockingSender) Prepare added in v1.0.19

Prepare a message to be sent. Returns (boxedMessage, pendingAssetDeletes, error)

func (*BlockingSender) Send added in v1.0.19

func (s *BlockingSender) Send(ctx context.Context, convID chat1.ConversationID,
	msg chat1.MessagePlaintext, clientPrev chat1.MessageID, outboxID *chat1.OutboxID) (obid chat1.OutboxID, boxed *chat1.MessageBoxed, rl *chat1.RateLimit, err error)

func (*BlockingSender) Sign added in v1.0.19

func (s *BlockingSender) Sign(payload []byte) ([]byte, error)

Sign implements github.com/keybase/go/chat/s3.Signer interface.

type BodyHashInvalid added in v1.0.19

type BodyHashInvalid struct{}

func (BodyHashInvalid) Error added in v1.0.19

func (e BodyHashInvalid) Error() string

type Boxer

type Boxer struct {
	utils.DebugLabeler
	globals.Contextified
	// contains filtered or unexported fields
}

func NewBoxer

func NewBoxer(g *globals.Context) *Boxer

func (*Boxer) BoxMessage

func (b *Boxer) BoxMessage(ctx context.Context, msg chat1.MessagePlaintext,
	membersType chat1.ConversationMembersType,
	signingKeyPair libkb.NaclSigningKeyPair) (*chat1.MessageBoxed, error)

BoxMessage encrypts a keybase1.MessagePlaintext into a chat1.MessageBoxed. It finds the most recent key for the TLF.

func (*Boxer) CompareTlfNames added in v1.0.21

func (b *Boxer) CompareTlfNames(ctx context.Context, tlfName1, tlfName2 string,
	conv chat1.Conversation, tlfPublic bool) (bool, error)

func (*Boxer) UnboxMessage

func (b *Boxer) UnboxMessage(ctx context.Context, boxed chat1.MessageBoxed, conv unboxConversationInfo) (m chat1.MessageUnboxed, uberr UnboxingError)

UnboxMessage unboxes a chat1.MessageBoxed into a chat1.MessageUnboxed. It finds the appropriate keybase1.CryptKey, decrypts the message, and verifies several things:

  • The message's signature is valid.
  • (TODO) The signing KID was valid when the signature was made.
  • (TODO) The signing KID belongs to the sending device.
  • (TODO) The sending device belongs to the sender. [Note that we do currently check the KID -> UID relationship, independent of the device ID.]
  • (TODO) The sender has write permission in the TLF.
  • (TODO) The TLF name, public flag, and finalized info resolve to the TLF ID.
  • The conversation ID derives from the ConversationIDTriple.
  • The body hash is not a replay from another message we know about.
  • The prev pointers are consistent with other messages we know about.
  • (TODO) The prev pointers are not absurdly ancient.
  • The ClientHeader provided with the BoxedMessage matches the one we decrypt.

The first return value is unusable if the err != nil. Returns (_, err) for non-permanent errors, and (MessageUnboxedError, nil) for permanent errors. Permanent errors can be cached and must be treated as a value to deal with, whereas temporary errors are transient failures.

func (*Boxer) UnboxMessages

func (b *Boxer) UnboxMessages(ctx context.Context, boxed []chat1.MessageBoxed, conv unboxConversationInfo) (unboxed []chat1.MessageUnboxed, err error)

func (*Boxer) UnboxThread

func (b *Boxer) UnboxThread(ctx context.Context, boxed chat1.ThreadViewBoxed, conv unboxConversationInfo) (thread chat1.ThreadView, err error)

unboxThread transforms a chat1.ThreadViewBoxed to a keybase1.ThreadView.

func (*Boxer) ValidSenderKey added in v1.0.19

func (b *Boxer) ValidSenderKey(ctx context.Context, sender gregor1.UID, key []byte, ctime gregor1.Time) (found, validAtCTime bool, revoked *gregor1.Time, unboxErr UnboxingError)

ValidSenderKey checks that the key was active for sender at ctime. This trusts the server for ctime, so a colluding server could use a revoked key and this check erroneously pass. But (revoked != nil) if the key was ever revoked, so that is irrespective of ctime. Returns (validAtCtime, revoked, err)

type BoxingCryptKeysError added in v1.0.19

type BoxingCryptKeysError struct {
	Err error
}

func NewBoxingCryptKeysError added in v1.0.19

func NewBoxingCryptKeysError(err error) BoxingCryptKeysError

func (BoxingCryptKeysError) Error added in v1.0.19

func (e BoxingCryptKeysError) Error() string

func (BoxingCryptKeysError) Inner added in v1.0.19

func (e BoxingCryptKeysError) Inner() error

func (BoxingCryptKeysError) IsImmediateFail added in v1.0.19

func (e BoxingCryptKeysError) IsImmediateFail() (chat1.OutboxErrorType, bool)

type BoxingError added in v1.0.19

type BoxingError struct {
	Msg  string
	Perm bool
}

func NewBoxingError added in v1.0.19

func NewBoxingError(msg string, perm bool) BoxingError

func (BoxingError) Error added in v1.0.19

func (e BoxingError) Error() string

func (BoxingError) IsImmediateFail added in v1.0.19

func (e BoxingError) IsImmediateFail() (chat1.OutboxErrorType, bool)

type BufferSource added in v1.0.19

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

func (*BufferSource) Basename added in v1.0.19

func (b *BufferSource) Basename() string

func (*BufferSource) Bytes added in v1.0.21

func (b *BufferSource) Bytes() []byte

func (*BufferSource) Close added in v1.0.19

func (b *BufferSource) Close() error

func (*BufferSource) FileSize added in v1.0.19

func (b *BufferSource) FileSize() int

func (*BufferSource) Open added in v1.0.19

func (b *BufferSource) Open(sessionID int, cli *keybase1.StreamUiClient) (ReadResetter, error)

type ByMsgID added in v1.0.19

type ByMsgID []chat1.MessageUnboxed

func (ByMsgID) Len added in v1.0.19

func (m ByMsgID) Len() int

func (ByMsgID) Less added in v1.0.19

func (m ByMsgID) Less(i, j int) bool

func (ByMsgID) Swap added in v1.0.19

func (m ByMsgID) Swap(i, j int)

type CachingTeamChannelSource added in v1.0.34

type CachingTeamChannelSource struct {
	globals.Contextified
	utils.DebugLabeler
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCachingTeamChannelSource added in v1.0.34

func NewCachingTeamChannelSource(g *globals.Context, ri func() chat1.RemoteInterface) *CachingTeamChannelSource

func (*CachingTeamChannelSource) ChannelsChanged added in v1.0.34

func (c *CachingTeamChannelSource) ChannelsChanged(ctx context.Context, teamID chat1.TLFID)

func (*CachingTeamChannelSource) Connected added in v1.0.34

func (c *CachingTeamChannelSource) Connected(ctx context.Context)

func (*CachingTeamChannelSource) Disconnected added in v1.0.34

func (c *CachingTeamChannelSource) Disconnected(ctx context.Context)

func (*CachingTeamChannelSource) GetChannelsFull added in v1.0.34

func (c *CachingTeamChannelSource) GetChannelsFull(ctx context.Context, uid gregor1.UID, teamID chat1.TLFID,
	topicType chat1.TopicType) (res []chat1.ConversationLocal, rl []chat1.RateLimit, err error)

func (*CachingTeamChannelSource) GetChannelsTopicName added in v1.0.34

func (c *CachingTeamChannelSource) GetChannelsTopicName(ctx context.Context, uid gregor1.UID,
	teamID chat1.TLFID, topicType chat1.TopicType) (res []types.ConvIDAndTopicName, rl []chat1.RateLimit, err error)

func (*CachingTeamChannelSource) IsOffline added in v1.0.34

func (c *CachingTeamChannelSource) IsOffline(ctx context.Context) bool

type ChatThreadConsistencyError added in v1.0.19

type ChatThreadConsistencyError interface {
	error
	Code() ConsistencyErrorCode
}

func CheckPrevPointersAndGetUnpreved

func CheckPrevPointersAndGetUnpreved(thread *chat1.ThreadView) ([]chat1.MessagePreviousPointer, ChatThreadConsistencyError)

Ingest a ThreadView, check several invariants, and produce a list of prev pointers to not-yet-pointed-to messages. Check several invariants at the same time: 1. No two messages have the same ID. 2. All prev pointers point to messages with lesser IDs. 3. All prev pointers to a message agree on that message's header hash. 4. For all messages we have locally, the hashes pointing to them are actually correct. TODO: All of this should happen in the cache instead of here all at once.

func NewChatThreadConsistencyError added in v1.0.19

func NewChatThreadConsistencyError(code ConsistencyErrorCode, msg string, formatArgs ...interface{}) ChatThreadConsistencyError

type ConsistencyErrorCode added in v1.0.19

type ConsistencyErrorCode int
const (
	DuplicateID ConsistencyErrorCode = iota
	OutOfOrderID
	InconsistentHash
	IncorrectHash
)

type ConversationRetry added in v1.0.27

type ConversationRetry struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewConversationRetry added in v1.0.27

func NewConversationRetry(g *globals.Context, convID chat1.ConversationID, tlfID *chat1.TLFID, kind FetchType) *ConversationRetry

func (*ConversationRetry) Fix added in v1.0.27

func (c *ConversationRetry) Fix(ctx context.Context, uid gregor1.UID) error

func (*ConversationRetry) RekeyFixable added in v1.0.31

func (c *ConversationRetry) RekeyFixable(ctx context.Context, tlfID chat1.TLFID) bool

func (*ConversationRetry) SendStale added in v1.0.27

func (c *ConversationRetry) SendStale(ctx context.Context, uid gregor1.UID)

func (*ConversationRetry) String added in v1.0.27

func (c *ConversationRetry) String() string

type Decrypter

type Decrypter interface {
	// Decrypt takes a ciphertext reader, encryption and verify keys.
	// It returns a plaintext reader.  It uses the constant nonce.
	Decrypt(ciphertext io.Reader, encKey, verifyKey []byte) (plaintext io.Reader)

	// DecryptWithNonce takes a ciphertext reader, nonce, encryption and verify keys.
	// It returns a plaintext reader.
	DecryptWithNonce(ciphertext io.Reader, nonce signencrypt.Nonce, encKey, verifyKey []byte) (plaintext io.Reader)
}

type Deliverer added in v1.0.19

type Deliverer struct {
	globals.Contextified
	sync.Mutex
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewDeliverer added in v1.0.19

func NewDeliverer(g *globals.Context, sender types.Sender) *Deliverer

func (*Deliverer) Connected added in v1.0.19

func (s *Deliverer) Connected(ctx context.Context)

func (*Deliverer) Disconnected added in v1.0.19

func (s *Deliverer) Disconnected(ctx context.Context)

func (*Deliverer) ForceDeliverLoop added in v1.0.19

func (s *Deliverer) ForceDeliverLoop(ctx context.Context)

func (*Deliverer) IsOffline added in v1.0.19

func (s *Deliverer) IsOffline(ctx context.Context) bool

func (*Deliverer) Queue added in v1.0.19

func (s *Deliverer) Queue(ctx context.Context, convID chat1.ConversationID, msg chat1.MessagePlaintext,
	outboxID *chat1.OutboxID,
	identifyBehavior keybase1.TLFIdentifyBehavior) (obr chat1.OutboxRecord, err error)

func (*Deliverer) SetClock added in v1.0.19

func (s *Deliverer) SetClock(clock clockwork.Clock)

func (*Deliverer) SetSender added in v1.0.19

func (s *Deliverer) SetSender(sender types.Sender)

func (*Deliverer) Start added in v1.0.19

func (s *Deliverer) Start(ctx context.Context, uid gregor1.UID)

func (*Deliverer) Stop added in v1.0.19

func (s *Deliverer) Stop(ctx context.Context) chan struct{}

type DelivererInfoError added in v1.0.19

type DelivererInfoError interface {
	IsImmediateFail() (chat1.OutboxErrorType, bool)
}

type DuplicateTopicNameError added in v1.0.27

type DuplicateTopicNameError struct {
	TopicName string
}

func (DuplicateTopicNameError) Error added in v1.0.27

func (e DuplicateTopicNameError) Error() string

type Encrypter

type Encrypter interface {
	// EncryptedLen returns the number of bytes that the ciphertext of
	// size plaintext bytes will be.
	EncryptedLen(size int) int

	// Encrypt takes a plaintext reader and returns a ciphertext reader.
	// It generates new keys every time it is called and uses a
	// constant nonce.
	Encrypt(plaintext io.Reader) (ciphertext io.Reader, err error)

	// EncryptWithNonce takes a plaintext reader and returns a ciphertext reader.
	// It generates new keys every time it is called and uses
	// the provided nonce.
	EncryptWithNonce(plaintext io.Reader, nonce signencrypt.Nonce) (ciphertext io.Reader, err error)

	// EncryptResume takes a plaintext reader and a set of keys.  It
	// returns a ciphertext reader.  It *does not* generate new keys
	// but uses the parameter keys.  These keys should *only* be used
	// to encrypt the same plaintext as a previous attempt.
	EncryptResume(r io.Reader, nonce signencrypt.Nonce, encKey signencrypt.SecretboxKey, signKey signencrypt.SignKey, verifyKey signencrypt.VerifyKey) (io.Reader, error)

	// EncryptKey returns the ephemeral key that was used during the
	// last invocation of Encrypt.
	EncryptKey() []byte

	// VerifyKey returns the public portion of the signing key used during
	// the last invocation of Encrypt.  It can be used for signature
	// verification.
	VerifyKey() []byte
}

type ErrorWrapper added in v1.0.19

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

func NewErrorWrapper added in v1.0.19

func NewErrorWrapper(prefix string, err error) *ErrorWrapper

func (*ErrorWrapper) Details added in v1.0.19

func (e *ErrorWrapper) Details() string

func (*ErrorWrapper) Error added in v1.0.19

func (e *ErrorWrapper) Error() string

type FetchRetrier added in v1.0.22

type FetchRetrier struct {
	globals.Contextified
	utils.DebugLabeler
	sync.Mutex
	// contains filtered or unexported fields
}

FetchRetrier is responsible for tracking any nonblock fetch failures, and retrying them automatically.

func NewFetchRetrier added in v1.0.22

func NewFetchRetrier(g *globals.Context) *FetchRetrier

func (*FetchRetrier) Connected added in v1.0.22

func (f *FetchRetrier) Connected(ctx context.Context)

Connected is called when a connection to the chat server is established, and forces a pass over the retry queue

func (*FetchRetrier) Disconnected added in v1.0.22

func (f *FetchRetrier) Disconnected(ctx context.Context)

Disconnected is called when we lose connection to the chat server, and pauses attempts on the retry queue.

func (*FetchRetrier) Failure added in v1.0.22

func (f *FetchRetrier) Failure(ctx context.Context, uid gregor1.UID, desc types.RetryDescription) (err error)

Failure indicates a failure of type kind has happened when loading a conversation.

func (*FetchRetrier) Force added in v1.0.22

func (f *FetchRetrier) Force(ctx context.Context)

Force forces a run of the retry loop.

func (*FetchRetrier) IsOffline added in v1.0.22

func (f *FetchRetrier) IsOffline(ctx context.Context) bool

IsOffline returns if the module thinks we are connected to the chat server.

func (*FetchRetrier) Rekey added in v1.0.31

func (f *FetchRetrier) Rekey(ctx context.Context, name string, membersType chat1.ConversationMembersType,
	public bool)

func (*FetchRetrier) SetClock added in v1.0.22

func (f *FetchRetrier) SetClock(clock clockwork.Clock)

SetClock sets a custom clock for testing.

func (*FetchRetrier) Start added in v1.0.22

func (f *FetchRetrier) Start(ctx context.Context, uid gregor1.UID)

func (*FetchRetrier) Stop added in v1.0.22

func (f *FetchRetrier) Stop(ctx context.Context) chan struct{}

func (*FetchRetrier) Success added in v1.0.22

func (f *FetchRetrier) Success(ctx context.Context, uid gregor1.UID, desc types.RetryDescription) (err error)

Success indicates a success of type kind loading a conversation. This effectively removes that conversation from the retry queue.

type FetchType added in v1.0.27

type FetchType int
const (
	InboxLoad FetchType = iota
	ThreadLoad
	FullInboxLoad
)

type FileStash added in v1.0.19

type FileStash struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewFileStash added in v1.0.19

func NewFileStash(dir string) *FileStash

func (*FileStash) Finish added in v1.0.19

func (f *FileStash) Finish(key StashKey) error

func (*FileStash) Lookup added in v1.0.19

func (f *FileStash) Lookup(key StashKey) (AttachmentInfo, bool, error)

func (*FileStash) RecordPart added in v1.0.19

func (f *FileStash) RecordPart(key StashKey, partNumber int, hash string) error

func (*FileStash) Start added in v1.0.19

func (f *FileStash) Start(key StashKey, info AttachmentInfo) error

type FullInboxRetry added in v1.0.27

type FullInboxRetry struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewFullInboxRetry added in v1.0.27

func NewFullInboxRetry(g *globals.Context, query *chat1.GetInboxLocalQuery, p *chat1.Pagination) FullInboxRetry

func (FullInboxRetry) Fix added in v1.0.27

func (f FullInboxRetry) Fix(ctx context.Context, uid gregor1.UID) error

func (FullInboxRetry) RekeyFixable added in v1.0.31

func (f FullInboxRetry) RekeyFixable(ctx context.Context, tlfID chat1.TLFID) bool

func (FullInboxRetry) SendStale added in v1.0.27

func (f FullInboxRetry) SendStale(ctx context.Context, uid gregor1.UID)

func (FullInboxRetry) String added in v1.0.27

func (f FullInboxRetry) String() string

type HeaderMismatchError added in v1.0.19

type HeaderMismatchError struct {
	Field string
}

func NewHeaderMismatchError added in v1.0.19

func NewHeaderMismatchError(field string) HeaderMismatchError

func (HeaderMismatchError) Error added in v1.0.19

func (e HeaderMismatchError) Error() string

type Helper added in v1.0.34

type Helper struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewHelper added in v1.0.34

func NewHelper(g *globals.Context, ri func() chat1.RemoteInterface) *Helper

func (*Helper) SendMsgByID added in v1.0.34

func (h *Helper) SendMsgByID(ctx context.Context, convID chat1.ConversationID,
	trip chat1.ConversationIDTriple, tlfName string, body chat1.MessageBody, msgType chat1.MessageType) error

func (*Helper) SendMsgByIDNonblock added in v1.0.34

func (h *Helper) SendMsgByIDNonblock(ctx context.Context, convID chat1.ConversationID,
	trip chat1.ConversationIDTriple, tlfName string, body chat1.MessageBody, msgType chat1.MessageType) error

func (*Helper) SendMsgByName added in v1.0.34

func (h *Helper) SendMsgByName(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, body chat1.MessageBody,
	msgType chat1.MessageType) error

func (*Helper) SendMsgByNameNonblock added in v1.0.34

func (h *Helper) SendMsgByNameNonblock(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, body chat1.MessageBody,
	msgType chat1.MessageType) error

func (*Helper) SendTextByID added in v1.0.34

func (h *Helper) SendTextByID(ctx context.Context, convID chat1.ConversationID,
	trip chat1.ConversationIDTriple, tlfName string, text string) error

func (*Helper) SendTextByIDNonblock added in v1.0.34

func (h *Helper) SendTextByIDNonblock(ctx context.Context, convID chat1.ConversationID,
	trip chat1.ConversationIDTriple, tlfName string, text string) error

func (*Helper) SendTextByName added in v1.0.34

func (h *Helper) SendTextByName(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, text string) error

func (*Helper) SendTextByNameNonblock added in v1.0.34

func (h *Helper) SendTextByNameNonblock(ctx context.Context, name string, topicName *string,
	membersType chat1.ConversationMembersType, ident keybase1.TLFIdentifyBehavior, text string) error

type HybridConversationSource

type HybridConversationSource struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewHybridConversationSource

func NewHybridConversationSource(g *globals.Context, b *Boxer, storage *storage.Storage,
	ri func() chat1.RemoteInterface) *HybridConversationSource

func (*HybridConversationSource) Clear

func (*HybridConversationSource) GetMessages added in v1.0.19

func (*HybridConversationSource) GetMessagesWithRemotes added in v1.0.19

func (s *HybridConversationSource) GetMessagesWithRemotes(ctx context.Context,
	conv chat1.Conversation, uid gregor1.UID, msgs []chat1.MessageBoxed) ([]chat1.MessageUnboxed, error)

func (*HybridConversationSource) Pull

func (s *HybridConversationSource) Pull(ctx context.Context, convID chat1.ConversationID,
	uid gregor1.UID, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (thread chat1.ThreadView, rl []*chat1.RateLimit, err error)

func (*HybridConversationSource) PullLocalOnly added in v1.0.19

func (s *HybridConversationSource) PullLocalOnly(ctx context.Context, convID chat1.ConversationID,
	uid gregor1.UID, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (tv chat1.ThreadView, err error)

func (*HybridConversationSource) Push

func (s *HybridConversationSource) Push(ctx context.Context, convID chat1.ConversationID,
	uid gregor1.UID, msg chat1.MessageBoxed) (decmsg chat1.MessageUnboxed, continuousUpdate bool, err error)

func (HybridConversationSource) SetRemoteInterface added in v1.0.19

func (s HybridConversationSource) SetRemoteInterface(ri func() chat1.RemoteInterface)

func (HybridConversationSource) TransformSupersedes added in v1.0.19

func (s HybridConversationSource) TransformSupersedes(ctx context.Context, conv chat1.Conversation, uid gregor1.UID, msgs []chat1.MessageUnboxed) ([]chat1.MessageUnboxed, error)

type HybridInboxSource added in v1.0.19

type HybridInboxSource struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewHybridInboxSource added in v1.0.19

func NewHybridInboxSource(g *globals.Context,
	getChatInterface func() chat1.RemoteInterface) *HybridInboxSource

func (HybridInboxSource) Connected added in v1.0.19

func (s HybridInboxSource) Connected(ctx context.Context)

func (HybridInboxSource) Disconnected added in v1.0.19

func (s HybridInboxSource) Disconnected(ctx context.Context)

func (HybridInboxSource) GetInboxQueryLocalToRemote added in v1.0.27

func (b HybridInboxSource) GetInboxQueryLocalToRemote(ctx context.Context,
	lquery *chat1.GetInboxLocalQuery) (rquery *chat1.GetInboxQuery, info types.NameInfo, err error)

func (HybridInboxSource) IsMember added in v1.0.27

func (b HybridInboxSource) IsMember(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID) (bool, *chat1.RateLimit, error)

func (HybridInboxSource) IsOffline added in v1.0.19

func (s HybridInboxSource) IsOffline(ctx context.Context) bool

func (*HybridInboxSource) MembershipUpdate added in v1.0.27

func (s *HybridInboxSource) MembershipUpdate(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers,
	joined []chat1.ConversationMember, removed []chat1.ConversationMember, resets []chat1.ConversationMember,
	previews []chat1.ConversationID) (res types.MembershipUpdateRes, err error)

func (*HybridInboxSource) NewConversation added in v1.0.19

func (s *HybridInboxSource) NewConversation(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers,
	conv chat1.Conversation) (err error)

func (*HybridInboxSource) NewMessage added in v1.0.19

func (*HybridInboxSource) Read added in v1.0.19

func (s *HybridInboxSource) Read(ctx context.Context, uid gregor1.UID,
	localizer types.ChatLocalizer, useLocalData bool, query *chat1.GetInboxLocalQuery,
	p *chat1.Pagination) (inbox types.Inbox, rl *chat1.RateLimit, err error)

func (*HybridInboxSource) ReadMessage added in v1.0.19

func (s *HybridInboxSource) ReadMessage(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers,
	convID chat1.ConversationID, msgID chat1.MessageID) (conv *chat1.ConversationLocal, err error)

func (*HybridInboxSource) ReadUnverified added in v1.0.19

func (s *HybridInboxSource) ReadUnverified(ctx context.Context, uid gregor1.UID, useLocalData bool,
	query *chat1.GetInboxQuery, p *chat1.Pagination) (res types.Inbox, rl *chat1.RateLimit, err error)

func (*HybridInboxSource) SetAppNotificationSettings added in v1.0.27

func (s *HybridInboxSource) SetAppNotificationSettings(ctx context.Context, uid gregor1.UID,
	vers chat1.InboxVers, convID chat1.ConversationID, settings chat1.ConversationNotificationInfo) (conv *chat1.ConversationLocal, err error)

func (HybridInboxSource) SetRemoteInterface added in v1.0.19

func (b HybridInboxSource) SetRemoteInterface(ri func() chat1.RemoteInterface)

func (*HybridInboxSource) SetStatus added in v1.0.19

func (*HybridInboxSource) TeamTypeChanged added in v1.0.30

func (s *HybridInboxSource) TeamTypeChanged(ctx context.Context, uid gregor1.UID,
	vers chat1.InboxVers, convID chat1.ConversationID, teamType chat1.TeamType) (conv *chat1.ConversationLocal, err error)

func (*HybridInboxSource) TlfFinalize added in v1.0.19

func (s *HybridInboxSource) TlfFinalize(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers,
	convIDs []chat1.ConversationID, finalizeInfo chat1.ConversationFinalizeInfo) (convs []chat1.ConversationLocal, err error)

type IdentifyChangedHandler added in v1.0.19

type IdentifyChangedHandler struct {
	globals.Contextified
	utils.DebugLabeler
}

func NewIdentifyChangedHandler added in v1.0.19

func NewIdentifyChangedHandler(g *globals.Context) *IdentifyChangedHandler

func (*IdentifyChangedHandler) BackgroundIdentifyChanged added in v1.0.19

func (h *IdentifyChangedHandler) BackgroundIdentifyChanged(ctx context.Context, job engine.IdentifyJob)

func (*IdentifyChangedHandler) HandleUserChanged added in v1.0.19

func (h *IdentifyChangedHandler) HandleUserChanged(uid keybase1.UID) (err error)

type IdentifyNotifier added in v1.0.19

type IdentifyNotifier struct {
	globals.Contextified
	utils.DebugLabeler

	sync.RWMutex
	// contains filtered or unexported fields
}

func CtxIdentifyNotifier added in v1.0.19

func CtxIdentifyNotifier(ctx context.Context) *IdentifyNotifier

func NewIdentifyNotifier added in v1.0.19

func NewIdentifyNotifier(g *globals.Context) *IdentifyNotifier

func (*IdentifyNotifier) Send added in v1.0.19

type ImplicitTeamsNameInfoSource added in v1.0.29

type ImplicitTeamsNameInfoSource struct {
	globals.Contextified
	utils.DebugLabeler
	*NameIdentifier
}

func NewImplicitTeamsNameInfoSource added in v1.0.29

func NewImplicitTeamsNameInfoSource(g *globals.Context) *ImplicitTeamsNameInfoSource

func (*ImplicitTeamsNameInfoSource) Lookup added in v1.0.29

type KBFSNameInfoSource added in v1.0.27

type KBFSNameInfoSource struct {
	globals.Contextified
	utils.DebugLabeler
	*NameIdentifier
}

func NewKBFSNameInfoSource added in v1.0.27

func NewKBFSNameInfoSource(g *globals.Context) *KBFSNameInfoSource

func (*KBFSNameInfoSource) CompleteAndCanonicalizePrivateTlfName added in v1.0.27

func (t *KBFSNameInfoSource) CompleteAndCanonicalizePrivateTlfName(ctx context.Context, tlfName string) (res keybase1.CanonicalTLFNameAndIDWithBreaks, err error)

func (*KBFSNameInfoSource) CryptKeys added in v1.0.27

func (t *KBFSNameInfoSource) CryptKeys(ctx context.Context, tlfName string) (res keybase1.GetTLFCryptKeysRes, ferr error)

func (*KBFSNameInfoSource) Lookup added in v1.0.27

func (t *KBFSNameInfoSource) Lookup(ctx context.Context, tlfName string,
	visibility keybase1.TLFVisibility) (res types.NameInfo, err error)

func (*KBFSNameInfoSource) PublicCanonicalTLFNameAndID added in v1.0.27

func (t *KBFSNameInfoSource) PublicCanonicalTLFNameAndID(ctx context.Context, tlfName string) (res keybase1.CanonicalTLFNameAndIDWithBreaks, ferr error)

type KeyFinder

type KeyFinder interface {
	Find(ctx context.Context, name string, membersType chat1.ConversationMembersType, public bool) (types.NameInfo, error)
	FindForEncryption(ctx context.Context, tlfName string, teamID chat1.TLFID, membersType chat1.ConversationMembersType, public bool) (types.NameInfo, error)
	FindForDecryption(ctx context.Context, tlfName string, teamID chat1.TLFID, membersType chat1.ConversationMembersType, public bool, keyGeneration int) (types.NameInfo, error)
	SetNameInfoSourceOverride(types.NameInfoSource)
}

KeyFinder remembers results from previous calls to CryptKeys().

func CtxKeyFinder added in v1.0.19

func CtxKeyFinder(ctx context.Context, g *globals.Context) KeyFinder

func NewKeyFinder

func NewKeyFinder(g *globals.Context) KeyFinder

NewKeyFinder creates a KeyFinder.

type KeyFinderImpl

type KeyFinderImpl struct {
	globals.Contextified
	utils.DebugLabeler
	sync.Mutex
	// contains filtered or unexported fields
}

func (*KeyFinderImpl) Find

func (k *KeyFinderImpl) Find(ctx context.Context, name string,
	membersType chat1.ConversationMembersType, public bool) (types.NameInfo, error)

Find finds keybase1.TLFCryptKeys for tlfName, checking for existing results.

func (*KeyFinderImpl) FindForDecryption added in v1.0.27

func (k *KeyFinderImpl) FindForDecryption(ctx context.Context,
	tlfName string, teamID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool,
	keyGeneration int) (res types.NameInfo, err error)

Ignores tlfName or teamID based on membersType.

func (*KeyFinderImpl) FindForEncryption added in v1.0.27

func (k *KeyFinderImpl) FindForEncryption(ctx context.Context,
	tlfName string, teamID chat1.TLFID,
	membersType chat1.ConversationMembersType, public bool) (res types.NameInfo, err error)

Find keys up-to-date enough for encrypting. Ignores tlfName or teamID based on membersType.

func (*KeyFinderImpl) SetNameInfoSourceOverride added in v1.0.27

func (k *KeyFinderImpl) SetNameInfoSourceOverride(ni types.NameInfoSource)

type NameIdentifier added in v1.0.29

type NameIdentifier struct {
	globals.Contextified
}

func NewNameIdentifier added in v1.0.29

func NewNameIdentifier(g *globals.Context) *NameIdentifier

func (*NameIdentifier) Identify added in v1.0.29

func (t *NameIdentifier) Identify(ctx context.Context, names []string, private bool,
	identBehavior keybase1.TLFIdentifyBehavior) ([]keybase1.TLFIdentifyFailure, error)

type NonblockInboxResult added in v1.0.19

type NonblockInboxResult struct {
	Conv     chat1.Conversation
	Err      *chat1.ConversationErrorLocal
	ConvRes  *chat1.ConversationLocal
	InboxRes *types.Inbox
}

type NonblockingLocalizer added in v1.0.19

type NonblockingLocalizer struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewNonblockingLocalizer added in v1.0.19

func NewNonblockingLocalizer(g *globals.Context, localizeCb chan NonblockInboxResult,
	maxUnbox *int) *NonblockingLocalizer

func (*NonblockingLocalizer) Localize added in v1.0.19

func (b *NonblockingLocalizer) Localize(ctx context.Context, uid gregor1.UID, inbox types.Inbox) (res []chat1.ConversationLocal, err error)

func (*NonblockingLocalizer) Name added in v1.0.19

func (b *NonblockingLocalizer) Name() string

func (*NonblockingLocalizer) SetOffline added in v1.0.19

func (b *NonblockingLocalizer) SetOffline()

type NonblockingSender added in v1.0.19

type NonblockingSender struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewNonblockingSender added in v1.0.19

func NewNonblockingSender(g *globals.Context, sender types.Sender) *NonblockingSender

func (*NonblockingSender) Prepare added in v1.0.19

func (*NonblockingSender) Send added in v1.0.19

type OfflineClient added in v1.0.27

type OfflineClient struct {
}

func (OfflineClient) Call added in v1.0.27

func (e OfflineClient) Call(ctx context.Context, method string, arg interface{}, res interface{}) error

func (OfflineClient) Notify added in v1.0.27

func (e OfflineClient) Notify(ctx context.Context, method string, arg interface{}) error

type OfflineError added in v1.0.19

type OfflineError struct {
}

func (OfflineError) Error added in v1.0.19

func (e OfflineError) Error() string

type PermanentUnboxingError added in v1.0.19

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

func (PermanentUnboxingError) Error added in v1.0.19

func (e PermanentUnboxingError) Error() string

func (PermanentUnboxingError) ExportType added in v1.0.19

func (PermanentUnboxingError) Inner added in v1.0.19

func (e PermanentUnboxingError) Inner() error

func (PermanentUnboxingError) IsPermanent added in v1.0.19

func (e PermanentUnboxingError) IsPermanent() bool

type PreviewRes added in v1.0.19

type PreviewRes struct {
	Source            *BufferSource
	ContentType       string
	BaseWidth         int
	BaseHeight        int
	BaseDurationMs    int
	PreviewWidth      int
	PreviewHeight     int
	PreviewDurationMs int
}

func Preview added in v1.0.19

func Preview(ctx context.Context, log logger.Logger, src io.Reader, contentType, basename string, fileSize int) (*PreviewRes, error)

Preview creates preview assets from src. It returns an in-memory BufferSource and the content type of the preview asset.

type ProgressReporter

type ProgressReporter func(bytesCompleted, bytesTotal int64)

type PushHandler added in v1.0.19

type PushHandler struct {
	globals.Contextified
	utils.DebugLabeler
	sync.Mutex
	// contains filtered or unexported fields
}

func NewPushHandler added in v1.0.19

func NewPushHandler(g *globals.Context) *PushHandler

func (*PushHandler) Activity added in v1.0.19

func (g *PushHandler) Activity(ctx context.Context, m gregor.OutOfBandMessage) (err error)

func (*PushHandler) HandleOobm added in v1.0.27

func (g *PushHandler) HandleOobm(ctx context.Context, obm gregor.OutOfBandMessage) (bool, error)

func (*PushHandler) MembershipUpdate added in v1.0.27

func (g *PushHandler) MembershipUpdate(ctx context.Context, m gregor.OutOfBandMessage) (err error)

func (*PushHandler) SetBadger added in v1.0.27

func (g *PushHandler) SetBadger(badger *badges.Badger)

func (*PushHandler) SetClock added in v1.0.27

func (g *PushHandler) SetClock(clock clockwork.Clock)

func (*PushHandler) TeamChannels added in v1.0.34

func (g *PushHandler) TeamChannels(ctx context.Context, m gregor.OutOfBandMessage) (err error)

func (*PushHandler) TlfFinalize added in v1.0.19

func (g *PushHandler) TlfFinalize(ctx context.Context, m gregor.OutOfBandMessage) (err error)

func (*PushHandler) TlfResolve added in v1.0.19

func (g *PushHandler) TlfResolve(ctx context.Context, m gregor.OutOfBandMessage) (err error)

func (*PushHandler) Typing added in v1.0.27

func (g *PushHandler) Typing(ctx context.Context, m gregor.OutOfBandMessage) (err error)

type PutS3Result

type PutS3Result struct {
	Region   string
	Endpoint string
	Bucket   string
	Path     string
	Size     int64
}

PutS3Result is the success result of calling PutS3.

type ReadResetter added in v1.0.19

type ReadResetter interface {
	io.Reader
	Reset() error
}

type RemoteClient added in v1.0.22

type RemoteClient struct {
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewRemoteClient added in v1.0.22

func NewRemoteClient(g *globals.Context, cli rpc.GenericClient) *RemoteClient

func (*RemoteClient) Call added in v1.0.22

func (c *RemoteClient) Call(ctx context.Context, method string, arg interface{}, res interface{}) (err error)

func (*RemoteClient) Notify added in v1.0.22

func (c *RemoteClient) Notify(ctx context.Context, method string, arg interface{}) (err error)

type RemoteConversationSource

type RemoteConversationSource struct {
	globals.Contextified
	// contains filtered or unexported fields
}

func NewRemoteConversationSource

func NewRemoteConversationSource(g *globals.Context, b *Boxer, ri func() chat1.RemoteInterface) *RemoteConversationSource

func (*RemoteConversationSource) Clear

func (*RemoteConversationSource) GetMessages added in v1.0.19

func (*RemoteConversationSource) GetMessagesWithRemotes added in v1.0.19

func (s *RemoteConversationSource) GetMessagesWithRemotes(ctx context.Context,
	conv chat1.Conversation, uid gregor1.UID, msgs []chat1.MessageBoxed) ([]chat1.MessageUnboxed, error)

func (*RemoteConversationSource) Pull

func (*RemoteConversationSource) PullLocalOnly added in v1.0.19

func (s *RemoteConversationSource) PullLocalOnly(ctx context.Context, convID chat1.ConversationID,
	uid gregor1.UID, query *chat1.GetThreadQuery, pagination *chat1.Pagination) (chat1.ThreadView, error)

func (*RemoteConversationSource) Push

func (RemoteConversationSource) SetRemoteInterface added in v1.0.19

func (s RemoteConversationSource) SetRemoteInterface(ri func() chat1.RemoteInterface)

func (RemoteConversationSource) TransformSupersedes added in v1.0.19

func (s RemoteConversationSource) TransformSupersedes(ctx context.Context, conv chat1.Conversation, uid gregor1.UID, msgs []chat1.MessageUnboxed) ([]chat1.MessageUnboxed, error)

type RemoteInboxSource added in v1.0.19

type RemoteInboxSource struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewRemoteInboxSource added in v1.0.19

func NewRemoteInboxSource(g *globals.Context, ri func() chat1.RemoteInterface) *RemoteInboxSource

func (RemoteInboxSource) Connected added in v1.0.19

func (s RemoteInboxSource) Connected(ctx context.Context)

func (RemoteInboxSource) Disconnected added in v1.0.19

func (s RemoteInboxSource) Disconnected(ctx context.Context)

func (RemoteInboxSource) GetInboxQueryLocalToRemote added in v1.0.27

func (b RemoteInboxSource) GetInboxQueryLocalToRemote(ctx context.Context,
	lquery *chat1.GetInboxLocalQuery) (rquery *chat1.GetInboxQuery, info types.NameInfo, err error)

func (RemoteInboxSource) IsMember added in v1.0.27

func (b RemoteInboxSource) IsMember(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID) (bool, *chat1.RateLimit, error)

func (RemoteInboxSource) IsOffline added in v1.0.19

func (s RemoteInboxSource) IsOffline(ctx context.Context) bool

func (*RemoteInboxSource) MembershipUpdate added in v1.0.27

func (s *RemoteInboxSource) MembershipUpdate(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers,
	joined []chat1.ConversationMember, removed []chat1.ConversationMember, resets []chat1.ConversationMember,
	previews []chat1.ConversationID) (res types.MembershipUpdateRes, err error)

func (*RemoteInboxSource) NewConversation added in v1.0.19

func (s *RemoteInboxSource) NewConversation(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers,
	conv chat1.Conversation) error

func (*RemoteInboxSource) NewMessage added in v1.0.19

func (*RemoteInboxSource) Read added in v1.0.19

func (*RemoteInboxSource) ReadMessage added in v1.0.19

func (*RemoteInboxSource) ReadUnverified added in v1.0.19

func (s *RemoteInboxSource) ReadUnverified(ctx context.Context, uid gregor1.UID, useLocalData bool,
	rquery *chat1.GetInboxQuery, p *chat1.Pagination) (types.Inbox, *chat1.RateLimit, error)

func (*RemoteInboxSource) SetAppNotificationSettings added in v1.0.27

func (s *RemoteInboxSource) SetAppNotificationSettings(ctx context.Context, uid gregor1.UID,
	vers chat1.InboxVers, convID chat1.ConversationID, settings chat1.ConversationNotificationInfo) (*chat1.ConversationLocal, error)

func (RemoteInboxSource) SetRemoteInterface added in v1.0.19

func (b RemoteInboxSource) SetRemoteInterface(ri func() chat1.RemoteInterface)

func (*RemoteInboxSource) SetStatus added in v1.0.19

func (*RemoteInboxSource) TlfFinalize added in v1.0.19

type Server added in v1.0.22

type Server struct {
	globals.Contextified
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewServer added in v1.0.22

func NewServer(g *globals.Context, store *AttachmentStore, serverConn ServerConnection,
	uiSource UISource) *Server

func (*Server) AddTeamMemberAfterReset added in v1.0.39

func (h *Server) AddTeamMemberAfterReset(ctx context.Context,
	arg chat1.AddTeamMemberAfterResetArg) (err error)

func (*Server) CancelPost added in v1.0.22

func (h *Server) CancelPost(ctx context.Context, outboxID chat1.OutboxID) (err error)

func (*Server) DeleteConversationLocal added in v1.0.31

func (h *Server) DeleteConversationLocal(ctx context.Context, arg chat1.DeleteConversationLocalArg) (res chat1.DeleteConversationLocalRes, err error)

func (*Server) DownloadAttachmentLocal added in v1.0.22

func (h *Server) DownloadAttachmentLocal(ctx context.Context, arg chat1.DownloadAttachmentLocalArg) (res chat1.DownloadAttachmentLocalRes, err error)

DownloadAttachmentLocal implements chat1.LocalInterface.DownloadAttachmentLocal.

func (*Server) DownloadFileAttachmentLocal added in v1.0.22

func (h *Server) DownloadFileAttachmentLocal(ctx context.Context, arg chat1.DownloadFileAttachmentLocalArg) (res chat1.DownloadAttachmentLocalRes, err error)

DownloadFileAttachmentLocal implements chat1.LocalInterface.DownloadFileAttachmentLocal.

func (*Server) FindConversationsLocal added in v1.0.22

func (h *Server) FindConversationsLocal(ctx context.Context,
	arg chat1.FindConversationsLocalArg) (res chat1.FindConversationsLocalRes, err error)

func (*Server) GenerateOutboxID added in v1.0.27

func (h *Server) GenerateOutboxID(ctx context.Context) (res chat1.OutboxID, err error)

func (*Server) GetCachedThread added in v1.0.22

func (h *Server) GetCachedThread(ctx context.Context, arg chat1.GetCachedThreadArg) (res chat1.GetThreadLocalRes, err error)

func (*Server) GetConversationForCLILocal added in v1.0.22

func (h *Server) GetConversationForCLILocal(ctx context.Context, arg chat1.GetConversationForCLILocalQuery) (res chat1.GetConversationForCLILocalRes, err error)

func (*Server) GetGlobalAppNotificationSettingsLocal added in v1.0.27

func (h *Server) GetGlobalAppNotificationSettingsLocal(ctx context.Context) (res chat1.GlobalAppNotificationSettings, err error)

func (*Server) GetInboxAndUnboxLocal added in v1.0.22

func (h *Server) GetInboxAndUnboxLocal(ctx context.Context, arg chat1.GetInboxAndUnboxLocalArg) (res chat1.GetInboxAndUnboxLocalRes, err error)

GetInboxAndUnboxLocal implements keybase.chatLocal.getInboxAndUnboxLocal protocol.

func (*Server) GetInboxNonblockLocal added in v1.0.22

func (h *Server) GetInboxNonblockLocal(ctx context.Context, arg chat1.GetInboxNonblockLocalArg) (res chat1.NonblockFetchRes, err error)

func (*Server) GetInboxSummaryForCLILocal added in v1.0.22

func (h *Server) GetInboxSummaryForCLILocal(ctx context.Context, arg chat1.GetInboxSummaryForCLILocalQuery) (res chat1.GetInboxSummaryForCLILocalRes, err error)

func (*Server) GetMessagesLocal added in v1.0.22

func (h *Server) GetMessagesLocal(ctx context.Context, arg chat1.GetMessagesLocalArg) (res chat1.GetMessagesLocalRes, err error)

func (*Server) GetTLFConversationsLocal added in v1.0.27

func (h *Server) GetTLFConversationsLocal(ctx context.Context, arg chat1.GetTLFConversationsLocalArg) (res chat1.GetTLFConversationsLocalRes, err error)

func (*Server) GetThreadLocal added in v1.0.22

func (h *Server) GetThreadLocal(ctx context.Context, arg chat1.GetThreadLocalArg) (res chat1.GetThreadLocalRes, err error)

GetThreadLocal implements keybase.chatLocal.getThreadLocal protocol.

func (*Server) GetThreadNonblock added in v1.0.22

func (h *Server) GetThreadNonblock(ctx context.Context, arg chat1.GetThreadNonblockArg) (res chat1.NonblockFetchRes, fullErr error)

func (*Server) JoinConversationByIDLocal added in v1.0.27

func (h *Server) JoinConversationByIDLocal(ctx context.Context, convID chat1.ConversationID) (res chat1.JoinLeaveConversationLocalRes, err error)

func (*Server) JoinConversationLocal added in v1.0.27

func (h *Server) JoinConversationLocal(ctx context.Context, arg chat1.JoinConversationLocalArg) (res chat1.JoinLeaveConversationLocalRes, err error)

func (*Server) LeaveConversationLocal added in v1.0.27

func (h *Server) LeaveConversationLocal(ctx context.Context, convID chat1.ConversationID) (res chat1.JoinLeaveConversationLocalRes, err error)

func (*Server) MakePreview added in v1.0.22

func (h *Server) MakePreview(ctx context.Context, arg chat1.MakePreviewArg) (res chat1.MakePreviewRes, err error)

MakePreview implements chat1.LocalInterface.MakePreview.

func (*Server) MarkAsReadLocal added in v1.0.22

func (h *Server) MarkAsReadLocal(ctx context.Context, arg chat1.MarkAsReadLocalArg) (res chat1.MarkAsReadLocalRes, err error)

func (*Server) NewConversationLocal added in v1.0.22

func (h *Server) NewConversationLocal(ctx context.Context, arg chat1.NewConversationLocalArg) (res chat1.NewConversationLocalRes, err error)

NewConversationLocal implements keybase.chatLocal.newConversationLocal protocol. Create a new conversation. Or in the case of CHAT, create-or-get a conversation.

func (*Server) PostAttachmentLocal added in v1.0.22

func (h *Server) PostAttachmentLocal(ctx context.Context, arg chat1.PostAttachmentLocalArg) (res chat1.PostLocalRes, err error)

PostAttachmentLocal implements chat1.LocalInterface.PostAttachmentLocal.

func (*Server) PostDeleteNonblock added in v1.0.22

func (h *Server) PostDeleteNonblock(ctx context.Context, arg chat1.PostDeleteNonblockArg) (chat1.PostLocalNonblockRes, error)

func (*Server) PostEditNonblock added in v1.0.22

func (*Server) PostFileAttachmentLocal added in v1.0.22

func (h *Server) PostFileAttachmentLocal(ctx context.Context, arg chat1.PostFileAttachmentLocalArg) (res chat1.PostLocalRes, err error)

PostFileAttachmentLocal implements chat1.LocalInterface.PostFileAttachmentLocal.

func (*Server) PostHeadline added in v1.0.29

func (h *Server) PostHeadline(ctx context.Context, arg chat1.PostHeadlineArg) (chat1.PostLocalRes, error)

func (*Server) PostHeadlineNonblock added in v1.0.29

func (h *Server) PostHeadlineNonblock(ctx context.Context, arg chat1.PostHeadlineNonblockArg) (chat1.PostLocalNonblockRes, error)

func (*Server) PostLocal added in v1.0.22

func (h *Server) PostLocal(ctx context.Context, arg chat1.PostLocalArg) (res chat1.PostLocalRes, err error)

PostLocal implements keybase.chatLocal.postLocal protocol.

func (*Server) PostLocalNonblock added in v1.0.22

func (h *Server) PostLocalNonblock(ctx context.Context, arg chat1.PostLocalNonblockArg) (res chat1.PostLocalNonblockRes, err error)

func (*Server) PostMetadata added in v1.0.34

func (h *Server) PostMetadata(ctx context.Context, arg chat1.PostMetadataArg) (chat1.PostLocalRes, error)

func (*Server) PostMetadataNonblock added in v1.0.34

func (h *Server) PostMetadataNonblock(ctx context.Context, arg chat1.PostMetadataNonblockArg) (chat1.PostLocalNonblockRes, error)

func (*Server) PostTextNonblock added in v1.0.22

func (*Server) PreviewConversationByIDLocal added in v1.0.34

func (h *Server) PreviewConversationByIDLocal(ctx context.Context, convID chat1.ConversationID) (res chat1.JoinLeaveConversationLocalRes, err error)

func (*Server) RetryPost added in v1.0.22

func (h *Server) RetryPost(ctx context.Context, outboxID chat1.OutboxID) (err error)

func (*Server) SetAppNotificationSettingsLocal added in v1.0.27

func (h *Server) SetAppNotificationSettingsLocal(ctx context.Context,
	arg chat1.SetAppNotificationSettingsLocalArg) (res chat1.SetAppNotificationSettingsLocalRes, err error)

func (*Server) SetConversationStatusLocal added in v1.0.22

func (h *Server) SetConversationStatusLocal(ctx context.Context, arg chat1.SetConversationStatusLocalArg) (res chat1.SetConversationStatusLocalRes, err error)

func (*Server) SetGlobalAppNotificationSettingsLocal added in v1.0.27

func (h *Server) SetGlobalAppNotificationSettingsLocal(ctx context.Context,
	strSettings map[string]bool) (err error)

func (*Server) Sign added in v1.0.22

func (h *Server) Sign(payload []byte) ([]byte, error)

Sign implements github.com/keybase/go/chat/s3.Signer interface.

func (*Server) UnboxMobilePushNotification added in v1.0.27

func (h *Server) UnboxMobilePushNotification(ctx context.Context, arg chat1.UnboxMobilePushNotificationArg) (res string, err error)

func (*Server) UpdateTyping added in v1.0.27

func (h *Server) UpdateTyping(ctx context.Context, arg chat1.UpdateTypingArg) (err error)

type ServerConnection added in v1.0.22

type ServerConnection interface {
	Reconnect(context.Context) (bool, error)
	GetClient() chat1.RemoteInterface
}

type SignDecrypter

type SignDecrypter struct{}

func NewSignDecrypter

func NewSignDecrypter() *SignDecrypter

func (*SignDecrypter) Decrypt

func (s *SignDecrypter) Decrypt(r io.Reader, encKey, verifyKey []byte) io.Reader

func (*SignDecrypter) DecryptWithNonce added in v1.0.19

func (s *SignDecrypter) DecryptWithNonce(r io.Reader, nonce signencrypt.Nonce, encKey, verifyKey []byte) (plaintext io.Reader)

type SignEncrypter

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

func NewSignEncrypter

func NewSignEncrypter() *SignEncrypter

func (*SignEncrypter) Encrypt

func (s *SignEncrypter) Encrypt(r io.Reader) (io.Reader, error)

func (*SignEncrypter) EncryptKey

func (s *SignEncrypter) EncryptKey() []byte

func (*SignEncrypter) EncryptResume added in v1.0.19

func (s *SignEncrypter) EncryptResume(r io.Reader, nonce signencrypt.Nonce, encKey signencrypt.SecretboxKey, signKey signencrypt.SignKey, verifyKey signencrypt.VerifyKey) (io.Reader, error)

EncryptResume is used to create a SignEncrypter to resume an interrupted attachment upload. It is *very* important that the keys passed in are not used to encrypt different plaintext than their original usage.

func (*SignEncrypter) EncryptWithNonce added in v1.0.19

func (s *SignEncrypter) EncryptWithNonce(r io.Reader, nonce signencrypt.Nonce) (io.Reader, error)

func (*SignEncrypter) EncryptedLen

func (s *SignEncrypter) EncryptedLen(size int) int

func (*SignEncrypter) SignKey added in v1.0.19

func (s *SignEncrypter) SignKey() []byte

func (*SignEncrypter) VerifyKey

func (s *SignEncrypter) VerifyKey() []byte

type StashKey added in v1.0.19

type StashKey struct {
	PlaintextHash  []byte
	ConversationID chat1.ConversationID
	UserID         keybase1.UID
}

func NewStashKey added in v1.0.19

func NewStashKey(plaintextHash []byte, cid chat1.ConversationID, uid keybase1.UID) StashKey

func (StashKey) String added in v1.0.19

func (s StashKey) String() string

type Syncer added in v1.0.19

type Syncer struct {
	globals.Contextified
	utils.DebugLabeler
	sync.Mutex
	// contains filtered or unexported fields
}

func NewSyncer added in v1.0.19

func NewSyncer(g *globals.Context) *Syncer

func (*Syncer) Connected added in v1.0.19

func (s *Syncer) Connected(ctx context.Context, cli chat1.RemoteInterface, uid gregor1.UID,
	syncRes *chat1.SyncChatRes) (err error)

func (*Syncer) Disconnected added in v1.0.19

func (s *Syncer) Disconnected(ctx context.Context)

func (*Syncer) IsConnected added in v1.0.21

func (s *Syncer) IsConnected(ctx context.Context) bool

func (*Syncer) RegisterOfflinable added in v1.0.19

func (s *Syncer) RegisterOfflinable(offlinable types.Offlinable)

func (*Syncer) SendChatStaleNotifications added in v1.0.19

func (s *Syncer) SendChatStaleNotifications(ctx context.Context, uid gregor1.UID,
	updates []chat1.ConversationStaleUpdate, immediate bool)

func (*Syncer) SetClock added in v1.0.21

func (s *Syncer) SetClock(clock clockwork.Clock)

func (*Syncer) Shutdown added in v1.0.21

func (s *Syncer) Shutdown()

func (*Syncer) Sync added in v1.0.21

func (s *Syncer) Sync(ctx context.Context, cli chat1.RemoteInterface, uid gregor1.UID,
	syncRes *chat1.SyncChatRes) (err error)

type TeamsNameInfoSource added in v1.0.27

type TeamsNameInfoSource struct {
	globals.Contextified
	utils.DebugLabeler
}

func NewTeamsNameInfoSource added in v1.0.27

func NewTeamsNameInfoSource(g *globals.Context) *TeamsNameInfoSource

func (*TeamsNameInfoSource) Lookup added in v1.0.27

func (t *TeamsNameInfoSource) Lookup(ctx context.Context, name string, vis keybase1.TLFVisibility) (res types.NameInfo, err error)

type TransientUnboxingError added in v1.0.19

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

func (TransientUnboxingError) Error added in v1.0.19

func (e TransientUnboxingError) Error() string

func (TransientUnboxingError) ExportType added in v1.0.19

func (TransientUnboxingError) Inner added in v1.0.19

func (e TransientUnboxingError) Inner() error

func (TransientUnboxingError) IsPermanent added in v1.0.19

func (e TransientUnboxingError) IsPermanent() bool

type TypingMonitor added in v1.0.27

type TypingMonitor struct {
	globals.Contextified
	sync.Mutex
	utils.DebugLabeler
	// contains filtered or unexported fields
}

func NewTypingMonitor added in v1.0.27

func NewTypingMonitor(g *globals.Context) *TypingMonitor

func (*TypingMonitor) SetClock added in v1.0.27

func (t *TypingMonitor) SetClock(clock clockwork.Clock)

func (*TypingMonitor) SetTimeout added in v1.0.27

func (t *TypingMonitor) SetTimeout(timeout time.Duration)

func (*TypingMonitor) Update added in v1.0.27

func (t *TypingMonitor) Update(ctx context.Context, typer chat1.TyperInfo, convID chat1.ConversationID,
	typing bool)

type UISource added in v1.0.22

type UISource interface {
	GetChatUI(sessionID int) libkb.ChatUI
	GetStreamUICli() *keybase1.StreamUiClient
}

type UnboxingError added in v1.0.19

type UnboxingError interface {
	Error() string
	Inner() error
	IsPermanent() bool
	ExportType() chat1.MessageUnboxedErrorType
}

func NewPermanentUnboxingError added in v1.0.19

func NewPermanentUnboxingError(inner error) UnboxingError

func NewTransientUnboxingError added in v1.0.19

func NewTransientUnboxingError(inner error) UnboxingError

type UploadTask added in v1.0.19

type UploadTask struct {
	S3Params  chat1.S3Params
	Filename  string
	FileSize  int
	Plaintext ReadResetter

	S3Signer       s3.Signer
	ConversationID chat1.ConversationID
	UserID         keybase1.UID
	Progress       ProgressReporter
	// contains filtered or unexported fields
}

func (*UploadTask) Nonce added in v1.0.19

func (u *UploadTask) Nonce() signencrypt.Nonce

type VersionError added in v1.0.19

type VersionError struct {
	Kind     string
	Version  int
	Critical bool
}

func NewBodyVersionError added in v1.0.19

func NewBodyVersionError(version chat1.BodyPlaintextVersion, defaultBody chat1.BodyPlaintextUnsupported) VersionError

func NewHeaderVersionError added in v1.0.19

func NewHeaderVersionError(version chat1.HeaderPlaintextVersion,
	defaultHeader chat1.HeaderPlaintextUnsupported) VersionError

func NewMessageBoxedVersionError added in v1.0.19

func NewMessageBoxedVersionError(version chat1.MessageBoxedVersion) VersionError

func (VersionError) Error added in v1.0.19

func (e VersionError) Error() string

func (VersionError) ExportType added in v1.0.19

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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