outofband

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 13 Imported by: 9

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/oob-invitation/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 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:"protocols"`
}

Invitation is this protocol's `invitation` message

type Provider

type Provider interface {
	Service(id string) (interface{}, error)
	StorageProvider() storage.Provider
	TransientStorageProvider() 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) (string, error)

AcceptInvitation from another agent and return the connection ID.

func (*Service) AcceptRequest

func (s *Service) AcceptRequest(r *Request) (string, error)

AcceptRequest from another agent and return the connection ID.

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) 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