diff --git a/backup/backup.go b/backup/backup.go index 7ee125ecfbd0b0689f59d78c2a712cdc3d3c9f81..992968668b08cce3a8d9819bbc6991f738b1ce18 100644 --- a/backup/backup.go +++ b/backup/backup.go @@ -8,11 +8,11 @@ package backup import ( + "gitlab.com/elixxir/client/xxdk" "sync" "time" "gitlab.com/elixxir/client/storage/versioned" - "gitlab.com/elixxir/client/xxdk/e2eApi" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/primitives/fact" "gitlab.com/xx_network/primitives/id" @@ -41,7 +41,7 @@ type Backup struct { // Callback that is called with the encrypted backup when triggered updateBackupCb UpdateBackupFn - container *e2eApi.Container + container *xxdk.Container jsonParams string @@ -91,7 +91,7 @@ type UpdateBackupFn func(encryptedBackup []byte) // Call this to turn on backups for the first time or to replace the user's // password. func InitializeBackup(password string, updateBackupCb UpdateBackupFn, - container *e2eApi.Container, e2e E2e, session Session, ud UserDiscovery, + container *xxdk.Container, e2e E2e, session Session, ud UserDiscovery, kv *versioned.KV, rng *fastRNG.StreamGenerator) (*Backup, error) { b := &Backup{ updateBackupCb: updateBackupCb, @@ -135,7 +135,7 @@ func InitializeBackup(password string, updateBackupCb UpdateBackupFn, // ResumeBackup resumes a backup by restoring the Backup object and registering // a new callback. Call this to resume backups that have already been // initialized. Returns an error if backups have not already been initialized. -func ResumeBackup(updateBackupCb UpdateBackupFn, container *e2eApi.Container, +func ResumeBackup(updateBackupCb UpdateBackupFn, container *xxdk.Container, e2e E2e, session Session, ud UserDiscovery, kv *versioned.KV, rng *fastRNG.StreamGenerator) (*Backup, error) { _, _, _, err := loadBackup(kv) diff --git a/cmd/callbacks.go b/cmd/callbacks.go index 3de83ee11690c72f819ff7bb7243da44b9f63d72..66a6ba9f2784540811ad192334d8270ded4005d1 100644 --- a/cmd/callbacks.go +++ b/cmd/callbacks.go @@ -10,7 +10,7 @@ package cmd import ( "fmt" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/catalog" @@ -25,10 +25,10 @@ import ( type authCallbacks struct { autoConfirm bool confCh chan *id.ID - client *e2eApi.E2e + client *xxdk.E2e } -func makeAuthCallbacks(client *e2eApi.E2e, autoConfirm bool) *authCallbacks { +func makeAuthCallbacks(client *xxdk.E2e, autoConfirm bool) *authCallbacks { return &authCallbacks{ autoConfirm: autoConfirm, confCh: make(chan *id.ID, 10), @@ -71,7 +71,7 @@ func (a *authCallbacks) Reset(requestor contact.Contact, fmt.Printf(msg) } -func registerMessageListener(client *e2eApi.E2e) chan receive.Message { +func registerMessageListener(client *xxdk.E2e) chan receive.Message { recvCh := make(chan receive.Message, 10000) listenerID := client.GetE2E().RegisterChannel("DefaultCLIReceiver", receive.AnyUser(), catalog.NoType, recvCh) diff --git a/cmd/fileTransfer.go b/cmd/fileTransfer.go index cc89c7ab942caacd1458bbf5cd53469d771c4b45..2097d44d497a8bb7ac6e35294f8358de4c645349 100644 --- a/cmd/fileTransfer.go +++ b/cmd/fileTransfer.go @@ -9,7 +9,7 @@ package cmd import ( "fmt" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "io/ioutil" "time" @@ -132,7 +132,7 @@ type receivedFtResults struct { // initFileTransferManager creates a new file transfer manager with a new // reception callback. Returns the file transfer manager and the channel that // will be triggered when the callback is called. -func initFileTransferManager(client *e2eApi.E2e, maxThroughput int) ( +func initFileTransferManager(client *xxdk.E2e, maxThroughput int) ( *ftE2e.Wrapper, chan receivedFtResults) { // Create interfaces.ReceiveCallback that returns the results on a channel diff --git a/cmd/group.go b/cmd/group.go index d4e1f30f0f4cc4f59e53ec29485005934af83cf2..8ea7fd73870ec504605674be1f3c2817412abe75 100644 --- a/cmd/group.go +++ b/cmd/group.go @@ -14,7 +14,7 @@ import ( "fmt" "gitlab.com/elixxir/client/cmix/identity/receptionID" "gitlab.com/elixxir/client/cmix/rounds" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "gitlab.com/elixxir/primitives/format" "os" "time" @@ -115,7 +115,7 @@ var groupCmd = &cobra.Command{ // initGroupManager creates a new group chat manager and starts the process // service. -func initGroupManager(client *e2eApi.E2e) (groupChat.GroupChat, +func initGroupManager(client *xxdk.E2e) (groupChat.GroupChat, chan groupChat.MessageReceive, chan groupStore.Group) { recChan := make(chan groupChat.MessageReceive, 10) diff --git a/cmd/init.go b/cmd/init.go index b095c6173c0dc1fbf9b81fc612ab65a503a78e4c..6c42b9cfc6a887d5f1dd3aacec85eb36ab47fb9e 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -10,11 +10,11 @@ package cmd import ( "fmt" + "gitlab.com/elixxir/client/xxdk" "github.com/spf13/cobra" jww "github.com/spf13/jwalterweatherman" "github.com/spf13/viper" - "gitlab.com/elixxir/client/xxdk/e2eApi" ) // initCmd creates a new user object with the given NDF @@ -24,7 +24,7 @@ var initCmd = &cobra.Command{ Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { client := createClient() - e2e, err := e2eApi.LoadOrInitE2e(client) + e2e, err := xxdk.LoadOrInitE2e(client) if err != nil { jww.FATAL.Panicf("%+v", err) } diff --git a/cmd/precan.go b/cmd/precan.go index 7602d472d8e5a27e2a13e64e4a7aba05932d7c80..64a558ee167f0d3ad9bdb5e1e04326947f510d3d 100644 --- a/cmd/precan.go +++ b/cmd/precan.go @@ -11,7 +11,7 @@ package cmd import ( "encoding/binary" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "strconv" jww "github.com/spf13/jwalterweatherman" @@ -67,7 +67,7 @@ func getPrecanID(recipientID *id.ID) uint { return uint(recipientID.Bytes()[7]) } -func addPrecanAuthenticatedChannel(client *e2eApi.E2e, recipientID *id.ID, +func addPrecanAuthenticatedChannel(client *xxdk.E2e, recipientID *id.ID, recipient contact.Contact) { jww.WARN.Printf("Precanned user id detected: %s", recipientID) preUsr, err := client.MakePrecannedAuthenticatedChannel( diff --git a/connect/authenticated.go b/connect/authenticated.go index 01a76ee5cdc0b08ec338afb55af665396c75aa66..0638c292c02f7f1fff154013a4bebba6f3e339bb 100644 --- a/connect/authenticated.go +++ b/connect/authenticated.go @@ -13,7 +13,7 @@ import ( "gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/cmix" clientE2e "gitlab.com/elixxir/client/e2e" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/fastRNG" @@ -52,7 +52,7 @@ type AuthenticatedCallback func(connection AuthenticatedConnection) // ConnectWithAuthentication is called by the client, ie the one establishing // connection with the server. Once a connect.Connection has been established // with the server and then authenticate their identity to the server. -func ConnectWithAuthentication(recipient contact.Contact, e2eClient *e2eApi.E2e, +func ConnectWithAuthentication(recipient contact.Contact, e2eClient *xxdk.E2e, p Params) (AuthenticatedConnection, error) { // Track the time since we started to attempt to establish a connection diff --git a/connect/connect.go b/connect/connect.go index 31e31ee15410a9340ad0fe304a705f50cd1a56f6..6ebb2b7c4893d3cc0891cd43ad73c8e36b3f8498 100644 --- a/connect/connect.go +++ b/connect/connect.go @@ -10,7 +10,7 @@ import ( "encoding/json" "gitlab.com/elixxir/client/cmix" "gitlab.com/elixxir/client/storage/versioned" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "gitlab.com/elixxir/crypto/cyclic" "gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/ekv" @@ -119,7 +119,7 @@ func GetParameters(params string) (Params, error) { // and returns a Connection object for the newly-created partner.Manager // This function is to be used sender-side and will block until the // partner.Manager is confirmed. -func Connect(recipient contact.Contact, e2eClient *e2eApi.E2e, +func Connect(recipient contact.Contact, e2eClient *xxdk.E2e, p Params) (Connection, error) { // Build callback for E2E negotiation diff --git a/xxmutils/restoreContacts.go b/xxmutils/restoreContacts.go index 42950a0e5b265116da7ec7a357818d83a8a78599..0f8b6a565b0903fd8ea98b279610a0e307902383 100644 --- a/xxmutils/restoreContacts.go +++ b/xxmutils/restoreContacts.go @@ -12,7 +12,7 @@ import ( "errors" "fmt" "gitlab.com/elixxir/client/single" - "gitlab.com/elixxir/client/xxdk/e2eApi" + "gitlab.com/elixxir/client/xxdk" "gitlab.com/xx_network/primitives/netTime" "math" "strings" @@ -37,7 +37,7 @@ import ( // xxDK users should not use this function. This function is used by // the mobile phone apps and are not intended to be part of the xxDK. It // should be treated as internal functions specific to the phone apps. -func RestoreContactsFromBackup(backupPartnerIDs []byte, client *e2eApi.E2e, +func RestoreContactsFromBackup(backupPartnerIDs []byte, client *xxdk.E2e, udManager *ud.Manager, updatesCb interfaces.RestoreContactsUpdater) ([]*id.ID, []*id.ID, []error, error) { @@ -178,7 +178,7 @@ func RestoreContactsFromBackup(backupPartnerIDs []byte, client *e2eApi.E2e, // the mobile phone apps and are not intended to be part of the xxDK. It // should be treated as internal functions specific to the phone apps. func LookupContacts(in chan *id.ID, out chan *contact.Contact, - failCh chan failure, client *e2eApi.E2e, udContact contact.Contact, + failCh chan failure, client *xxdk.E2e, udContact contact.Contact, wg *sync.WaitGroup) { defer wg.Done() // Start looking up contacts with user discovery and feed this @@ -205,7 +205,7 @@ func LookupContacts(in chan *id.ID, out chan *contact.Contact, // the mobile phone apps and are not intended to be part of the xxDK. It // should be treated as internal functions specific to the phone apps. func ResetSessions(in, out chan *contact.Contact, failCh chan failure, - client *e2eApi.E2e, wg *sync.WaitGroup) { + client *xxdk.E2e, wg *sync.WaitGroup) { defer wg.Done() for c := range in { _, err := client.GetAuth().Reset(*c) @@ -224,7 +224,7 @@ func ResetSessions(in, out chan *contact.Contact, failCh chan failure, // xxDK users should not use this function. This function is used by // the mobile phone apps and are not intended to be part of the xxDK. It // should be treated as internal functions specific to the phone apps. -func LookupContact(userID *id.ID, client *e2eApi.E2e, udContact contact.Contact) ( +func LookupContact(userID *id.ID, client *xxdk.E2e, udContact contact.Contact) ( *contact.Contact, error) { // This is a little wonky, but wait until we get called then // set the result to the contact objects details if there is