Documentation ¶
Index ¶
- Constants
- type Action
- type HandshakeReuse
- type HandshakeReuseAccepted
- type Invitation
- type Options
- type Provider
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) AcceptInvitation(i *Invitation, options Options) (string, error)
- func (s *Service) ActionContinue(piID string, opts Options) error
- func (s *Service) ActionStop(piID string, _ error) error
- func (s *Service) Actions() ([]Action, 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(i *Invitation) error
Constants ¶
const ( // Name of this protocol service. Name = "out-of-band" // PIURI is the Out-of-Band protocol's protocol instance URI. PIURI = "https://didcomm.org/out-of-band/1.0" // InvitationMsgType is the '@type' for the invitation message. InvitationMsgType = PIURI + "/invitation" // OldInvitationMsgType is the `@type` for the old invitation message. OldInvitationMsgType = oldPIURI + "/invitation" // HandshakeReuseMsgType is the '@type' for the reuse message. HandshakeReuseMsgType = PIURI + "/handshake-reuse" // HandshakeReuseAcceptedMsgType is the '@type' for the reuse-accepted message. HandshakeReuseAcceptedMsgType = PIURI + "/handshake-reuse-accepted" )
const ( // StateNameInitial is the initial state. StateNameInitial = "initial" // StateNameAwaitResponse is the state where a sender or a receiver are awaiting a response. StateNameAwaitResponse = "await-response" // StateNamePrepareResponse is the state where a receiver is preparing a response to the sender. StateNamePrepareResponse = "prepare-response" // StateNameDone is the final state. StateNameDone = "done" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶ added in v0.1.4
type Action struct { // Protocol instance ID PIID string Msg service.DIDCommMsgMap ProtocolName string MyDID string TheirDID string }
Action contains helpful information about action.
type HandshakeReuse ¶ added in v0.1.7
HandshakeReuse is this protocol's 'handshake-reuse' message.
type HandshakeReuseAccepted ¶ added in v0.1.7
HandshakeReuseAccepted is this protocol's 'handshake-reuse-accepted' message.
type Invitation ¶
type Invitation struct { ID string `json:"@id"` Type string `json:"@type"` Label string `json:"label,omitempty"` Goal string `json:"goal,omitempty"` GoalCode string `json:"goal_code,omitempty"` Services []interface{} `json:"services"` // Services is an array of either DIDs or 'services' block entries Accept []string `json:"accept,omitempty"` Protocols []string `json:"handshake_protocols,omitempty"` Requests []*decorator.Attachment `json:"request~attach,omitempty"` }
Invitation is this protocol's `invitation` message.
type Options ¶ added in v0.1.4
type Options interface { // MyLabel is the label to share with the other agent in the subsequent did-exchange. MyLabel() string RouterConnections() []string ReuseAnyConnection() bool ReuseConnection() string }
Options is a container for optional values provided by the user.
type Provider ¶
type Provider interface { Service(id string) (interface{}, error) StorageProvider() storage.Provider ProtocolStateStorageProvider() storage.Provider InboundDIDCommMessageHandler() func() service.InboundHandler Messenger() service.Messenger MediaTypeProfiles() []string }
Provider provides this service's dependencies.
type Service ¶
Service implements the Out-Of-Band 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, options Options) (string, error)
AcceptInvitation from another agent and return the connection ID.
func (*Service) ActionContinue ¶ added in v0.1.4
ActionContinue allows proceeding with the action by the piID.
func (*Service) ActionStop ¶ added in v0.1.4
ActionStop allows stopping the action by the piID.
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 ¶ added in v0.1.8
Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.
func (*Service) SaveInvitation ¶
func (s *Service) SaveInvitation(i *Invitation) error
SaveInvitation created by the outofband client.