outofband

package
v0.0.0-...-293da44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name of this protocol service.
	Name = "out-of-band"
	// RequestMsgType is the '@type' for the request message.
	RequestMsgType = "https://didcomm.org/oob-request/1.0/request"
	// InvitationMsgType is the '@type' for the invitation message.
	InvitationMsgType = "https://didcomm.org/out-of-band/1.0/invitation"

	// StateRequested is one of the possible states of this protocol.
	StateRequested = "requested"
	// StateInvited is this protocol's state after accepting an invitation.
	StateInvited = "invited"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Protocol instance ID
	PIID         string
	Msg          service.DIDCommMsgMap
	ProtocolName string
	MyDID        string
	TheirDID     string
}

Action contains helpful information about action.

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"`
	Service   []interface{} `json:"service"` // Service is an array of either DIDs or 'service' block entries.
	Protocols []string      `json:"handshake_protocols"`
}

Invitation is this protocol's `invitation` message.

type Options

type Options interface {
	// MyLabel is the label to share with the other agent in the subsequent did-exchange.
	MyLabel() string
	RouterConnections() []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
	OutboundMessageHandler() service.OutboundHandler
}

Provider provides this service's dependencies.

type Request

type Request 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"`
	Requests []*decorator.Attachment `json:"request~attach"`
	Service  []interface{}           `json:"service"` // Service is an array of either DIDs or 'service' block entries.
}

Request is this protocol's 'request' message.

type Service

type Service struct {
	service.Action
	service.Message
	// contains filtered or unexported fields
}

Service implements the Out-Of-Band protocol.

func New

func New(p Provider) (*Service, error)

New creates a new instance of the out-of-band service.

func (*Service) Accept

func (s *Service) Accept(msgType string) bool

Accept determines whether this service can handle the given type of message.

func (*Service) AcceptInvitation

func (s *Service) AcceptInvitation(i *Invitation, myLabel string, routerConnections []string) (string, error)

AcceptInvitation from another agent and return the connection ID.

func (*Service) AcceptRequest

func (s *Service) AcceptRequest(r *Request, myLabel string, routerConnections []string) (string, error)

AcceptRequest from another agent and return the connection ID.

func (*Service) ActionContinue

func (s *Service) ActionContinue(piID string, opts Options) error

ActionContinue allows proceeding with the action by the piID.

func (*Service) ActionStop

func (s *Service) ActionStop(piID string, _ error) error

ActionStop allows stopping the action by the piID.

func (*Service) Actions

func (s *Service) Actions() ([]Action, error)

Actions returns actions for the async usage.

func (*Service) HandleInbound

func (s *Service) HandleInbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error)

HandleInbound handles inbound messages.

func (*Service) HandleOutbound

func (s *Service) HandleOutbound(_ service.DIDCommMsg, _, _ string) (string, error)

HandleOutbound handles outbound messages.

func (*Service) Name

func (s *Service) Name() string

Name is this service's name.

func (*Service) SaveInvitation

func (s *Service) SaveInvitation(i *Invitation) error

SaveInvitation created by the outofband client.

func (*Service) SaveRequest

func (s *Service) SaveRequest(r *Request) error

SaveRequest created by the outofband client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL