Documentation ¶
Index ¶
- Constants
- func AssertionFromComponent(actx libkb.AssertionContext, c keybase1.ContactComponent, coercedValue string) (string, error)
- func MakeContact(name string, args ...keybase1.ContactComponent) keybase1.Contact
- func MakeEmailComponent(label string, email string) keybase1.ContactComponent
- func MakePhoneComponent(label string, phone string) keybase1.ContactComponent
- func ResolveAndSaveContacts(mctx libkb.MetaContext, provider ContactsProvider, contacts []keybase1.Contact) (newlyResolved []keybase1.ProcessedContact, err error)
- func ResolveContacts(mctx libkb.MetaContext, provider ContactsProvider, contacts []keybase1.Contact) (res []keybase1.ProcessedContact, err error)
- func SendEncryptedContactResolutionToServer(mctx libkb.MetaContext, resolutions []ContactResolution) error
- func ServiceInit(g *libkb.GlobalContext)
- type CachedContactsProvider
- func (c *CachedContactsProvider) FindFollowing(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]bool, error)
- func (c *CachedContactsProvider) FindServiceMaps(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]libkb.UserServiceSummary, error)
- func (c *CachedContactsProvider) FindUsernames(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error)
- func (c *CachedContactsProvider) LookupAll(mctx libkb.MetaContext, emails []keybase1.EmailAddress, ...) (res ContactLookupResults, err error)
- func (c *CachedContactsProvider) LookupAllWithToken(mctx libkb.MetaContext, emails []keybase1.EmailAddress, ...) (res ContactLookupResults, err error)
- type ContactCacheStore
- type ContactLookupKey
- type ContactLookupResult
- type ContactLookupResults
- type ContactResolution
- type ContactResolutionForEncryption
- type ContactUsernameAndFullName
- type ContactsProvider
- type EncryptedContactResolution
- type ErrorContactsProvider
- func (c *ErrorContactsProvider) FindFollowing(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]bool, error)
- func (c *ErrorContactsProvider) FindServiceMaps(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]libkb.UserServiceSummary, error)
- func (c *ErrorContactsProvider) FindUsernames(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error)
- func (c *ErrorContactsProvider) LookupAll(mctx libkb.MetaContext, emails []keybase1.EmailAddress, ...) (ret ContactLookupResults, err error)
- func (c *ErrorContactsProvider) LookupAllWithToken(mctx libkb.MetaContext, emails []keybase1.EmailAddress, ...) (ret ContactLookupResults, err error)
- type MockContactsProvider
- func (c *MockContactsProvider) FindFollowing(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]bool, error)
- func (c *MockContactsProvider) FindServiceMaps(mctx libkb.MetaContext, uids []keybase1.UID) (res map[keybase1.UID]libkb.UserServiceSummary, err error)
- func (c *MockContactsProvider) FindUsernames(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error)
- func (c *MockContactsProvider) LookupAll(mctx libkb.MetaContext, emails []keybase1.EmailAddress, ...) (ContactLookupResults, error)
- func (c *MockContactsProvider) LookupAllWithToken(mctx libkb.MetaContext, emails []keybase1.EmailAddress, ...) (ContactLookupResults, error)
- type MockLookupUser
- type SavedContactsStore
- func (s *SavedContactsStore) RetrieveAssertionToName(mctx libkb.MetaContext) (ret map[string]string, err error)
- func (s *SavedContactsStore) RetrieveContacts(mctx libkb.MetaContext) (ret []keybase1.ProcessedContact, err error)
- func (s *SavedContactsStore) SaveProcessedContacts(mctx libkb.MetaContext, contacts []keybase1.ProcessedContact) (err error)
- func (s *SavedContactsStore) UnresolveContactsWithComponent(mctx libkb.MetaContext, phoneNumber *keybase1.PhoneNumber, ...)
- type Token
Constants ¶
View Source
const ContactResolutionEncryptionVersion = 1
Variables ¶
This section is empty.
Functions ¶
func AssertionFromComponent ¶
func AssertionFromComponent(actx libkb.AssertionContext, c keybase1.ContactComponent, coercedValue string) (string, error)
func MakeContact ¶
func MakeContact(name string, args ...keybase1.ContactComponent) keybase1.Contact
func MakeEmailComponent ¶
func MakeEmailComponent(label string, email string) keybase1.ContactComponent
func MakePhoneComponent ¶
func MakePhoneComponent(label string, phone string) keybase1.ContactComponent
func ResolveAndSaveContacts ¶
func ResolveAndSaveContacts(mctx libkb.MetaContext, provider ContactsProvider, contacts []keybase1.Contact) (newlyResolved []keybase1.ProcessedContact, err error)
func ResolveContacts ¶
func ResolveContacts(mctx libkb.MetaContext, provider ContactsProvider, contacts []keybase1.Contact) (res []keybase1.ProcessedContact, err error)
ResolveContacts resolves contacts with cache for UI. See API documentation in phone_numbers.avdl
func SendEncryptedContactResolutionToServer ¶
func SendEncryptedContactResolutionToServer(mctx libkb.MetaContext, resolutions []ContactResolution) error
func ServiceInit ¶
func ServiceInit(g *libkb.GlobalContext)
Types ¶
type CachedContactsProvider ¶
type CachedContactsProvider struct { Provider ContactsProvider Store *ContactCacheStore // contains filtered or unexported fields }
func (*CachedContactsProvider) FindFollowing ¶
func (c *CachedContactsProvider) FindFollowing(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]bool, error)
func (*CachedContactsProvider) FindServiceMaps ¶
func (c *CachedContactsProvider) FindServiceMaps(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]libkb.UserServiceSummary, error)
func (*CachedContactsProvider) FindUsernames ¶
func (c *CachedContactsProvider) FindUsernames(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error)
func (*CachedContactsProvider) LookupAll ¶
func (c *CachedContactsProvider) LookupAll(mctx libkb.MetaContext, emails []keybase1.EmailAddress, numbers []keybase1.RawPhoneNumber) (res ContactLookupResults, err error)
func (*CachedContactsProvider) LookupAllWithToken ¶
func (c *CachedContactsProvider) LookupAllWithToken(mctx libkb.MetaContext, emails []keybase1.EmailAddress, numbers []keybase1.RawPhoneNumber, _ Token) (res ContactLookupResults, err error)
type ContactCacheStore ¶
type ContactCacheStore struct {
// contains filtered or unexported fields
}
ContactCacheStore is used by CachedContactsProvider to store contact cache encrypted with device key.
func NewContactCacheStore ¶
func NewContactCacheStore(g *libkb.GlobalContext) *ContactCacheStore
NewContactCacheStore creates new ContactCacheStore for global context. The store is used to securely store cached contact resolutions.
func (*ContactCacheStore) ClearCache ¶
func (s *ContactCacheStore) ClearCache(mctx libkb.MetaContext) error
func (*ContactCacheStore) RemoveContactsCacheEntries ¶
func (s *ContactCacheStore) RemoveContactsCacheEntries(mctx libkb.MetaContext, phone *keybase1.PhoneNumber, email *keybase1.EmailAddress)
RemoveContactsCachePhoneEntry removes cached lookup for phone number.
type ContactLookupKey ¶
type ContactLookupKey string
func MakeEmailLookupKey ¶
func MakeEmailLookupKey(e keybase1.EmailAddress) ContactLookupKey
func MakePhoneLookupKey ¶
func MakePhoneLookupKey(p keybase1.RawPhoneNumber) ContactLookupKey
type ContactLookupResult ¶
type ContactLookupResults ¶
type ContactLookupResults struct { Results map[ContactLookupKey]ContactLookupResult // Results provided - or not provided - by this provider // should are valid for the following amount of time: ResolvedFreshness time.Duration UnresolvedFreshness time.Duration Token Token }
func BulkLookupContacts ¶
func BulkLookupContacts(mctx libkb.MetaContext, emailsContacts []keybase1.EmailAddress, phoneNumberContacts []keybase1.RawPhoneNumber, token Token) (res ContactLookupResults, err error)
func NewContactLookupResults ¶
func NewContactLookupResults() ContactLookupResults
func (*ContactLookupResults) FindComponent ¶
func (r *ContactLookupResults) FindComponent(component keybase1.ContactComponent) (res ContactLookupResult, found bool)
type ContactResolution ¶
func DecryptContactBlob ¶
func DecryptContactBlob(mctx libkb.MetaContext, contactResBlob string) (res ContactResolution, err error)
type ContactResolutionForEncryption ¶
type ContactResolutionForEncryption struct { ContactResolution EncryptionVersion int }
type ContactsProvider ¶
type ContactsProvider interface { LookupAllWithToken(libkb.MetaContext, []keybase1.EmailAddress, []keybase1.RawPhoneNumber, Token) (ContactLookupResults, error) LookupAll(libkb.MetaContext, []keybase1.EmailAddress, []keybase1.RawPhoneNumber) (ContactLookupResults, error) FindUsernames(libkb.MetaContext, []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error) FindFollowing(libkb.MetaContext, []keybase1.UID) (map[keybase1.UID]bool, error) FindServiceMaps(libkb.MetaContext, []keybase1.UID) (map[keybase1.UID]libkb.UserServiceSummary, error) }
type EncryptedContactResolution ¶
type EncryptedContactResolution struct { Blob []byte PukGeneration keybase1.PerUserKeyGeneration }
type ErrorContactsProvider ¶
func (*ErrorContactsProvider) FindFollowing ¶
func (c *ErrorContactsProvider) FindFollowing(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]bool, error)
func (*ErrorContactsProvider) FindServiceMaps ¶
func (c *ErrorContactsProvider) FindServiceMaps(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]libkb.UserServiceSummary, error)
func (*ErrorContactsProvider) FindUsernames ¶
func (c *ErrorContactsProvider) FindUsernames(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error)
func (*ErrorContactsProvider) LookupAll ¶
func (c *ErrorContactsProvider) LookupAll(mctx libkb.MetaContext, emails []keybase1.EmailAddress, numbers []keybase1.RawPhoneNumber) (ret ContactLookupResults, err error)
func (*ErrorContactsProvider) LookupAllWithToken ¶
func (c *ErrorContactsProvider) LookupAllWithToken(mctx libkb.MetaContext, emails []keybase1.EmailAddress, numbers []keybase1.RawPhoneNumber, _ Token) (ret ContactLookupResults, err error)
type MockContactsProvider ¶
type MockContactsProvider struct { T libkb.TestingTB PhoneNumbers map[keybase1.RawPhoneNumber]MockLookupUser PhoneNumberErrors map[keybase1.RawPhoneNumber]string Emails map[keybase1.EmailAddress]MockLookupUser Following map[keybase1.UID]bool }
func MakeMockProvider ¶
func MakeMockProvider(t libkb.TestingTB) *MockContactsProvider
func (*MockContactsProvider) FindFollowing ¶
func (c *MockContactsProvider) FindFollowing(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]bool, error)
func (*MockContactsProvider) FindServiceMaps ¶
func (c *MockContactsProvider) FindServiceMaps(mctx libkb.MetaContext, uids []keybase1.UID) (res map[keybase1.UID]libkb.UserServiceSummary, err error)
func (*MockContactsProvider) FindUsernames ¶
func (c *MockContactsProvider) FindUsernames(mctx libkb.MetaContext, uids []keybase1.UID) (map[keybase1.UID]ContactUsernameAndFullName, error)
func (*MockContactsProvider) LookupAll ¶
func (c *MockContactsProvider) LookupAll(mctx libkb.MetaContext, emails []keybase1.EmailAddress, numbers []keybase1.RawPhoneNumber) (ContactLookupResults, error)
func (*MockContactsProvider) LookupAllWithToken ¶
func (c *MockContactsProvider) LookupAllWithToken(mctx libkb.MetaContext, emails []keybase1.EmailAddress, numbers []keybase1.RawPhoneNumber, _ Token) (ContactLookupResults, error)
type MockLookupUser ¶
type MockLookupUser struct { UID keybase1.UID Username string Fullname string ServiceMap libkb.UserServiceSummary }
func MakeMockLookupUser ¶
func MakeMockLookupUser(username, fullname string) MockLookupUser
type SavedContactsStore ¶
type SavedContactsStore struct {
// contains filtered or unexported fields
}
func NewSavedContactsStore ¶
func NewSavedContactsStore(g *libkb.GlobalContext) *SavedContactsStore
NewSavedContactsStore creates a new SavedContactsStore for global context. The store is used to securely store list of resolved contacts.
func (*SavedContactsStore) RetrieveAssertionToName ¶
func (s *SavedContactsStore) RetrieveAssertionToName(mctx libkb.MetaContext) (ret map[string]string, err error)
func (*SavedContactsStore) RetrieveContacts ¶
func (s *SavedContactsStore) RetrieveContacts(mctx libkb.MetaContext) (ret []keybase1.ProcessedContact, err error)
func (*SavedContactsStore) SaveProcessedContacts ¶
func (s *SavedContactsStore) SaveProcessedContacts(mctx libkb.MetaContext, contacts []keybase1.ProcessedContact) (err error)
func (*SavedContactsStore) UnresolveContactsWithComponent ¶
func (s *SavedContactsStore) UnresolveContactsWithComponent(mctx libkb.MetaContext, phoneNumber *keybase1.PhoneNumber, email *keybase1.EmailAddress)
Click to show internal directories.
Click to hide internal directories.