Skip to content
Snippets Groups Projects
Select Git revision
  • a52eeb1a3b8c6316ebeb97060f8b6008e43f0318
  • release default protected
  • 11-22-implement-kv-interface-defined-in-collectiveversionedkvgo
  • hotfix/TestHostPool_UpdateNdf_AddFilter
  • XX-4719/announcementChannels
  • xx-4717/logLevel
  • jonah/noob-channel
  • master protected
  • XX-4707/tagDiskJson
  • xx-4698/notification-retry
  • hotfix/notifylockup
  • syncNodes
  • hotfix/localCB
  • XX-4677/NewChanManagerMobile
  • XX-4689/DmSync
  • duplicatePrefix
  • XX-4601/HavenInvites
  • finalizedUICallbacks
  • XX-4673/AdminKeySync
  • debugNotifID
  • anne/test
  • v4.7.5
  • v4.7.4
  • v4.7.3
  • v4.7.2
  • v4.7.1
  • v4.6.3
  • v4.6.1
  • v4.5.0
  • v4.4.4
  • v4.3.11
  • v4.3.8
  • v4.3.7
  • v4.3.6
  • v4.3.5
  • v4.2.0
  • v4.3.0
  • v4.3.4
  • v4.3.3
  • v4.3.2
  • v4.3.1
41 results

byID_test.go

Blame
  • comms.go 3.76 KiB
    ////////////////////////////////////////////////////////////////////////////////
    // Copyright © 2022 xx foundation                                             //
    //                                                                            //
    // Use of this source code is governed by a license that can be found in the  //
    // LICENSE file.                                                              //
    ////////////////////////////////////////////////////////////////////////////////
    
    package ud
    
    import (
    	pb "gitlab.com/elixxir/comms/mixmessages"
    	"gitlab.com/xx_network/comms/connect"
    	"gitlab.com/xx_network/comms/messages"
    	"gitlab.com/xx_network/primitives/id"
    )
    
    // Comms is a sub-interface of the client.Comms interface. This contains
    // RPCs and methods relevant to sending to the UD service.
    type Comms interface {
    	// SendRegisterUser is the gRPC send function for the user registering
    	// their username with the UD service.
    	SendRegisterUser(host *connect.Host, message *pb.UDBUserRegistration) (*messages.Ack, error)
    	// SendRegisterFact is the gRPC send function for the user registering
    	// a fact.Fact (email/phone number) with the UD service.
    	SendRegisterFact(host *connect.Host, message *pb.FactRegisterRequest) (*pb.FactRegisterResponse, error)
    	// SendConfirmFact is the gRPC send function for the user confirming
    	// their fact.Fact has been registered successfully with the UD service.
    	SendConfirmFact(host *connect.Host, message *pb.FactConfirmRequest) (*messages.Ack, error)
    	// SendRemoveFact is the gRPC send function for the user removing
    	// a registered fact.Fact from the UD service. This fact.Fact must be
    	// owned by the user.
    	SendRemoveFact(host *connect.Host, message *pb.FactRemovalRequest) (*messages.Ack, error)
    	// SendRemoveUser is the gRPC send function for the user removing
    	// their username from the UD service.
    	SendRemoveUser(host *connect.Host, message *pb.FactRemovalRequest) (*messages.Ack, error)
    	// AddHost is a function which adds a connect.Host object to the internal
    	// comms manager. This will be used here exclusively for adding
    	// the UD service if it does not currently exist within the internal
    	// manger.
    	AddHost(hid *id.ID, address string,
    		cert []byte, params connect.HostParams) (host *connect.Host, err error)
    	// GetHost retrieves a connect.Host object from the internal comms manager.
    	// This will be used exclusively to retrieve the UD service's connect.Host
    	// object. This will be used to send to the UD service on the above
    	// gRPC send functions.
    	GetHost(hostId *id.ID) (*connect.Host, bool)
    
    	channelLeaseComms
    }
    
    // removeFactComms is a sub-interface of the Comms interface for the
    // removeFact comm.
    type removeFactComms interface {
    	SendRemoveFact(host *connect.Host, message *pb.FactRemovalRequest) (*messages.Ack, error)
    }
    
    // removeUserComms is a sub-interface of the Comms interface for the
    // permanentDeleteAccount comm.
    type removeUserComms interface {
    	SendRemoveUser(host *connect.Host, message *pb.FactRemovalRequest) (*messages.Ack, error)
    }
    
    // confirmFactComm is a sub-interface of the Comms interface for the
    // confirmFact comm.
    type confirmFactComm interface {
    	SendConfirmFact(host *connect.Host, message *pb.FactConfirmRequest) (*messages.Ack, error)
    }
    
    // registerUserComms is a sub-interface of the Comms interface for the
    // registerUser comm.
    type registerUserComms interface {
    	SendRegisterUser(*connect.Host, *pb.UDBUserRegistration) (*messages.Ack, error)
    }
    
    // addFactComms is a sub-interface of the Comms interface for the
    // addFact comms
    type addFactComms interface {
    	SendRegisterFact(host *connect.Host, message *pb.FactRegisterRequest) (*pb.FactRegisterResponse, error)
    }
    
    type channelLeaseComms interface {
    	SendChannelLeaseRequest(host *connect.Host, message *pb.ChannelLeaseRequest) (*pb.ChannelLeaseResponse, error)
    }