Documentation ¶
Index ¶
- Constants
- type AcceptOption
- type Invitation
- type InvitationBody
- type Provider
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) AcceptInvitation(i *Invitation, opts ...AcceptOption) (string, error)
- func (s *Service) HandleInbound(msg service.DIDCommMsg, didCommCtx service.DIDCommContext) (string, error)
- func (s *Service) HandleOutbound(_ service.DIDCommMsg, _, _ string) (string, error)
- func (s *Service) Initialize(prov interface{}) error
- func (s *Service) Name() string
- func (s *Service) SaveInvitation(inv *Invitation) error
Constants ¶
const ( // Name of this protocol service. Name = "out-of-band/2.0" // PIURI is the Out-of-Band protocol's protocol instance URI. PIURI = "https://didcomm.org/" + Name // InvitationMsgType is the '@type' for the invitation message. InvitationMsgType = PIURI + "/invitation" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptOption ¶
type AcceptOption func(opts *acceptOpts)
AcceptOption boilerplate adds configured parameter to Service.AcceptInvitation.
func WithRouterConnections ¶
func WithRouterConnections(routerConnections []string) AcceptOption
WithRouterConnections option sets router connections for the connection created with this Invitation acceptance.
type Invitation ¶
type Invitation struct { ID string `json:"id"` Type string `json:"type"` Label string `json:"label,omitempty"` From string `json:"from"` Body *InvitationBody `json:"body"` Requests []*decorator.AttachmentV2 `json:"attachments,omitempty"` }
Invitation is this protocol's `invitation` message.
type InvitationBody ¶
type InvitationBody struct { Goal string `json:"goal,omitempty"` GoalCode string `json:"goal_code,omitempty"` Accept []string `json:"accept,omitempty"` }
InvitationBody contains invitation's goal and accept headers.
type Provider ¶
type Provider interface { Service(id string) (interface{}, error) StorageProvider() storage.Provider VDRegistry() vdrapi.Registry ProtocolStateStorageProvider() storage.Provider InboundDIDCommMessageHandler() func() service.InboundHandler Messenger() service.Messenger KMS() kms.KeyManager KeyType() kms.KeyType KeyAgreementType() kms.KeyType MediaTypeProfiles() []string ServiceMsgTypeTargets() []dispatcher.MessageTypeTarget AllServices() []dispatcher.ProtocolService }
Provider provides this service's dependencies.
type Service ¶
Service implements the Out-Of-Band V2 protocol.
func (*Service) Accept ¶
Accept determines whether this service can handle the given type of message.
func (*Service) AcceptInvitation ¶
func (s *Service) AcceptInvitation(i *Invitation, opts ...AcceptOption) (string, error)
AcceptInvitation from another agent.
func (*Service) HandleInbound ¶
func (s *Service) HandleInbound(msg service.DIDCommMsg, didCommCtx service.DIDCommContext) (string, error)
HandleInbound handles inbound messages.
func (*Service) HandleOutbound ¶
HandleOutbound handles outbound messages.
func (*Service) Initialize ¶
Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.
func (*Service) SaveInvitation ¶
func (s *Service) SaveInvitation(inv *Invitation) error
SaveInvitation saves OOB v2 Invitation.