mediatorclient

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Overview

Package mediatorclient provides client features for aries mediator commands.

Index

Constants

View Source
const (
	// CommandName package command name.
	CommandName = "mediatorclient"
	// Connect command name.
	Connect = "Connect"
	// CreateInvitation command name.
	CreateInvitation = "CreateInvitation"
	// SendCreateConnectionRequest command name.
	SendCreateConnectionRequest = "SendCreateConnectionRequest"
)
View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors.
	InvalidRequestErrorCode = command.Code(iota + command.MediatorClient)

	// ConnectMediatorError is typically a code for mediator connect errors.
	ConnectMediatorError
	// CreateInvitationError is typically a code for mediator create invitation command errors.
	CreateInvitationError
	// SendCreateConnectionRequestError is typically a code for mediator send create connection request command errors.
	SendCreateConnectionRequestError
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command is controller command for mediator client.

func New

func New(p Provider, msgHandler ariescmd.MessageHandler, notifier ariescmd.Notifier) (*Command, error)

New returns new mediator client controller command instance.

func (*Command) Connect

func (c *Command) Connect(rw io.Writer, req io.Reader) command.Error

Connect connects agent to given router endpoint.

func (*Command) CreateInvitation

func (c *Command) CreateInvitation(rw io.Writer, req io.Reader) command.Error

CreateInvitation creates out-of-band invitation from one of the mediator connections.

func (*Command) GetHandlers

func (c *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command.

func (*Command) SendCreateConnectionRequest

func (c *Command) SendCreateConnectionRequest(rw io.Writer, req io.Reader) command.Error

SendCreateConnectionRequest sends create connection request to mediator.

type ConnectionRequest

type ConnectionRequest struct {
	// Invitation is out-of-band (V1 or V2) invitation from mediator.
	Invitation *service.DIDCommMsgMap `json:"invitation"`

	// MyLabel is custom label to be used as receiver label of this invitation
	// Optional: if missing, agent default label will be used.
	MyLabel string `json:"mylabel,omitempty"`

	// StateCompleteMessageType is optional did exchange completion notification message type from inviter.
	// If provided, then agent will wait for notification of this message type from inviter before performing
	// mediator registration.
	// If not provided, then this agent will go ahead with mediator registration once did exchange state is
	// completed at invitee.
	StateCompleteMessageType string `json:"stateCompleteMessageType,omitempty"`
}

ConnectionRequest model

This is used for connecting to given router.

type ConnectionResponse

type ConnectionResponse struct {
	ConnectionID string `json:"connectionID"`
}

ConnectionResponse contains response.

type CreateConnectionRequest

type CreateConnectionRequest struct {
	DIDDocument json.RawMessage `json:"didDoc"`
}

CreateConnectionRequest model

This is used for sending create connection request.

type CreateConnectionResponse

type CreateConnectionResponse struct {
	Payload json.RawMessage `json:"payload"`
}

CreateConnectionResponse model

This is used for getting create connection response.

type CreateInvitationRequest

type CreateInvitationRequest struct {
	Label     string        `json:"label"`
	Goal      string        `json:"goal"`
	GoalCode  string        `json:"goal_code"`
	Service   []interface{} `json:"service"`
	Protocols []string      `json:"protocols"`
	From      string        `json:"from"`
}

CreateInvitationRequest model

This is used for creating an invitation using mediator.

type CreateInvitationResponse

type CreateInvitationResponse struct {
	// Invitation is out-of-band invitation from mediator.
	Invitation *outofband.Invitation `json:"invitation"`

	InvitationV2 *outofbandv2.Invitation `json:"invitation-v2"`
}

CreateInvitationResponse model

Response for creating invitation through mediator.

type Provider

type Provider interface {
	Service(id string) (interface{}, error)
	KMS() kms.KeyManager
	ServiceEndpoint() string
	StorageProvider() storage.Provider
	ProtocolStateStorageProvider() storage.Provider
	VDRegistry() vdr.Registry
	Messenger() service.Messenger
	KeyType() kms.KeyType
	KeyAgreementType() kms.KeyType
	MediaTypeProfiles() []string
}

Provider describes dependencies for this command.

Jump to

Keyboard shortcuts

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