Documentation ¶
Index ¶
- Constants
- Variables
- func GetApiName(msgType MessageType) string
- func IsReceiver(did string, routers []string) bool
- func MergeRouter(myRouters, theirRouters []string) []string
- func ParseConnectionMsg(c *gin.Context, packager *ecdsa.Packager) (*message.Connection, *packager.MessageData, error)
- func ParseMessage(enablePackage bool, ctx *gin.Context, packager *ecdsa.Packager, ...) (interface{}, bool, error)
- func ReverseConnection(conn message.Connection) message.Connection
- func RouterLastIndexOf(did string, routers []string) (int, error)
- type Gin
- type Message
- type MessageType
- type MsgService
- func (m *MsgService) GetNextRouter(routers []string) (string, error)
- func (m *MsgService) GetServiceURL(msg OutboundMsg) (string, error)
- func (m *MsgService) GetServiceURLByRouter(router string, msgType MessageType) (string, error)
- func (m *MsgService) HandleOutBound(omsg OutboundMsg) error
- func (m *MsgService) NeedForwardMsg(router string, routers []string) bool
- func (m *MsgService) SendMsg(msg OutboundMsg)
- type OutboundMsg
- type Response
- type Route
- type Router
- type Routes
Constants ¶
View Source
const ( InviteApi = "/api/v1/invitation" ConnectRequestApi = "/api/v1/connectionrequest" ConnectResponseApi = "/api/v1/connectionresponse" ConnectAckApi = "/api/v1/connectionack" SendDisconnectApi = "/api/v1/senddisconnect" DisconnectApi = "/api/v1/disconnect" SendProposalCredentialReqApi = "/api/v1/sendproposalcredential" ProposalCredentialReqApi = "/api/v1/proposalcredential" OfferCredentialApi = "/api/v1/offercredential" SendRequestCredentialApi = "/api/v1/sendrequestcredential" RequestCredentialApi = "/api/v1/requestcredential" IssueCredentialApi = "/api/v1/issuecredentail" CredentialAckApi = "/api/v1/credentialack" DeleteCredentialApi = "/api/v1/deletecredential" QueryCredentialApi = "/api/v1/querycredential" SendRequestPresentationApi = "/api/v1/sendrequestpresentation" RequestPresentationApi = "/api/v1/requestpresentation" PresentationProofApi = "/api/v1/presentproof" PresentationAckApi = "/api/v1/presentationack" QueryPresentationApi = "/api/v1/querypresentation" DeletePresentationApi = "/api/v1/deletepresentation" SendBasicMsgApi = "/api/v1/sendbasicmsg" ReceiveBasicMsgApi = "/api/v1/receivebasicmsg" QueryBasicMsgApi = "/api/v1/querybasicmsg" QueryConnectionsApi = "/api/v1/queryconnections" )
Variables ¶
View Source
var (
EnablePackage bool
)
Functions ¶
func GetApiName ¶
func GetApiName(msgType MessageType) string
func IsReceiver ¶
func MergeRouter ¶
func ParseConnectionMsg ¶
func ParseConnectionMsg(c *gin.Context, packager *ecdsa.Packager) (*message.Connection, *packager.MessageData, error)
func ParseMessage ¶
func ParseMessage(enablePackage bool, ctx *gin.Context, packager *ecdsa.Packager, messageType MessageType, msgSvr *MsgService) (interface{}, bool, error)
func ReverseConnection ¶
func ReverseConnection(conn message.Connection) message.Connection
Types ¶
type Message ¶
type Message struct { MessageType `json:"type"` Content interface{} `json:"content"` }
type MessageType ¶
type MessageType int
const ( InvitationType MessageType = iota ConnectionRequestType ConnectionResponseType ConnectionAckType SendDisconnectType DisconnectType SendProposalCredentialType ProposalCredentialType OfferCredentialType SendRequestCredentialType RequestCredentialType IssueCredentialType CredentialAckType DeleteCredentialType QueryCredentialType SendRequestPresentationType RequestPresentationType PresentationType PresentationAckType DeletePresentationType QueryPresentationType SendBasicMsgType ReceiveBasicMsgType QueryBasicMessageType QueryConnectionsType )
func TransferForwardMsgType ¶
func TransferForwardMsgType(msgType MessageType) MessageType
type MsgService ¶
MsgService is basic message service implementation
func NewMessageService ¶
func NewMessageService(v vdri.VDRI, ontSdk *sdk.OntologySdk, acct *sdk.Account, enableEnvelop bool, conf *config.Cfg) *MsgService
func (*MsgService) GetNextRouter ¶
func (m *MsgService) GetNextRouter(routers []string) (string, error)
func (*MsgService) GetServiceURL ¶
func (m *MsgService) GetServiceURL(msg OutboundMsg) (string, error)
func (*MsgService) GetServiceURLByRouter ¶
func (m *MsgService) GetServiceURLByRouter(router string, msgType MessageType) (string, error)
func (*MsgService) HandleOutBound ¶
func (m *MsgService) HandleOutBound(omsg OutboundMsg) error
func (*MsgService) NeedForwardMsg ¶
func (m *MsgService) NeedForwardMsg(router string, routers []string) bool
func (*MsgService) SendMsg ¶
func (m *MsgService) SendMsg(msg OutboundMsg)
type OutboundMsg ¶
type OutboundMsg struct { Msg Message Conn message.Connection IsForward bool }
Click to show internal directories.
Click to hide internal directories.