github.com/hyperledger/aries-framework-go@v0.3.2/pkg/didcomm/dispatcher/api.go (about) 1 /* 2 Copyright SecureKey Technologies Inc. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package dispatcher 8 9 import ( 10 "github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service" 11 ) 12 13 // ProtocolService is service interface for protocol services available in framework 14 // for matching acceptance criteria based on message type. 15 type ProtocolService interface { 16 service.Handler 17 Accept(msgType string) bool 18 Name() string 19 Initialize(interface{}) error 20 } 21 22 // MessageService is service for handling generic messages 23 // matching accept criteria based on message header. 24 type MessageService interface { 25 service.InboundHandler 26 Accept(msgType string, purpose []string) bool 27 Name() string 28 } 29 30 // Outbound interface. 31 type Outbound interface { 32 // Send the message after packing with the sender key and recipient keys. 33 Send(interface{}, string, *service.Destination) error 34 35 // SendToDID Sends the message after packing with the keys derived from DIDs. 36 SendToDID(msg interface{}, myDID, theirDID string) error 37 38 // Forward forwards the message without packing to the destination. 39 Forward(interface{}, *service.Destination) error 40 } 41 42 // MessageTypeTarget represents a service message type mapping value to an OOB target action. 43 type MessageTypeTarget struct { 44 MsgType string 45 Target string 46 }