Skip to content
Snippets Groups Projects
Select Git revision
  • b6939ba6131535ac60c0ed4d31b641bead139f0f
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

MessengerConnect.swift

Blame
  • auth.go 2.28 KiB
    ///////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 xx network SEZC                                          //
    //                                                                           //
    // Use of this source code is governed by a license that can be found in the //
    // LICENSE file                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    
    package interfaces
    
    import (
    	"gitlab.com/elixxir/crypto/contact"
    	"gitlab.com/xx_network/primitives/id"
    )
    
    type RequestCallback func(requestor contact.Contact, message string)
    type ConfirmCallback func(partner contact.Contact)
    
    type Auth interface {
    	// Adds a general callback to be used on auth requests. This will be preempted
    	// by any specific callback
    	AddGeneralRequestCallback(cb RequestCallback)
    	// Adds a general callback to be used on auth requests. This will not be
    	// preempted by any specific callback. It is recommended that the specific
    	// callbacks are used, this is primarily for debugging.
    	AddOverrideRequestCallback(cb RequestCallback)
    	// Adds a specific callback to be used on auth requests. This will preempt a
    	// general callback, meaning the request will be heard on this callback and not
    	// the general. Request will still be heard on override callbacks.
    	AddSpecificRequestCallback(id *id.ID, cb RequestCallback)
    	// Removes a specific callback to be used on auth requests.
    	RemoveSpecificRequestCallback(id *id.ID)
    	// Adds a general callback to be used on auth confirms. This will be preempted
    	// by any specific callback
    	AddGeneralConfirmCallback(cb ConfirmCallback)
    	// Adds a general callback to be used on auth confirms. This will not be
    	// preempted by any specific callback. It is recommended that the specific
    	// callbacks are used, this is primarily for debugging.
    	AddOverrideConfirmCallback(cb ConfirmCallback)
    	// Adds a specific callback to be used on auth confirms. This will preempt a
    	// general callback, meaning the request will be heard on this callback and not
    	// the general. Request will still be heard on override callbacks.
    	AddSpecificConfirmCallback(id *id.ID, cb ConfirmCallback)
    	// Removes a specific callback to be used on auth confirm.
    	RemoveSpecificConfirmCallback(id *id.ID)
    }