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: 10 Imported by: 24

Documentation

Index

Constants

View Source
const (
	// RequestMsgType is the request message's '@type'.
	RequestMsgType = outofband.RequestMsgType
	// InvitationMsgType is the '@type' for the invitation message.
	InvitationMsgType = outofband.InvitationMsgType
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	service.Event
	// contains filtered or unexported fields
}

Client for the Out-Of-Band protocol: https://github.com/hyperledger/aries-rfcs/blob/master/features/0434-outofband/README.md

func New

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

New returns a new Client for the Out-Of-Band protocol.

func (*Client) AcceptInvitation

func (c *Client) AcceptInvitation(i *Invitation) (string, error)

AcceptInvitation from another agent and return the ID of the new connection records.

func (*Client) AcceptRequest

func (c *Client) AcceptRequest(r *Request) (string, error)

AcceptRequest from another agent and return the ID of a new connection record.

func (*Client) CreateInvitation

func (c *Client) CreateInvitation(protocols []string, opts ...MessageOption) (*Invitation, error)

CreateInvitation creates and saves an out-of-band invitation. Protocols is an optional list of protocol identifier URIs that can be used to form connections. A default will be set if none are provided.

func (*Client) CreateRequest

func (c *Client) CreateRequest(attchmnts []*decorator.Attachment, opts ...MessageOption) (*Request, error)

CreateRequest creates and saves an Out-Of-Band request message. At least one attachment must be provided. Service entries can be optionally provided. If none are provided then a new one will be automatically created for you.

type Event

type Event interface {
	// ConnectionID of the connection record, once it's created.
	// This becomes available in a post-state event unless an error condition is encountered.
	ConnectionID() string
	// Error is non-nil if an error is encountered.
	Error() error
}

Event is a container of out-of-band protocol-specific properties for DIDCommActions and StateMsgs.

type Invitation

type Invitation outofband.Invitation

Invitation is this protocol's `invitation` message

type MessageOption

type MessageOption func(*message) error

MessageOption allow you to customize the way out-of-band messages are built.

func WithGoal

func WithGoal(goal, goalCode string) MessageOption

WithGoal allows you to specify the `goal` and `goalCode` for the message.

func WithLabel

func WithLabel(l string) MessageOption

WithLabel allows you to specify the label on the message.

func WithServices

func WithServices(svcs ...interface{}) MessageOption

WithServices allows you to specify service entries to include in the request message. Each entry must be either a valid DID (string) or a `service` object.

type Provider

type Provider interface {
	ServiceEndpoint() string
	Service(id string) (interface{}, error)
	LegacyKMS() legacykms.KeyManager
}

Provider provides the dependencies for the client.

type Request

type Request outofband.Request

Request is the out-of-band protocol's 'request' message.

Jump to

Keyboard shortcuts

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