introduce

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors
	// for invalid introduce controller requests.
	InvalidRequestErrorCode = command.Code(iota + command.Introduce)
	// SendProposalErrorCode is for failures in send proposal command.
	SendProposalErrorCode
	// SendProposalWithOOBRequestErrorCode is for failures in send proposal with OOBRequest command.
	SendProposalWithOOBRequestErrorCode
	// SendRequestErrorCode is for failures in send request command.
	SendRequestErrorCode
	// AcceptProposalWithOOBRequestErrorCode is for failures in accept proposal with OOBRequest command.
	AcceptProposalWithOOBRequestErrorCode
	// AcceptProposalErrorCode is for failures in accept proposal command.
	AcceptProposalErrorCode
	// AcceptRequestWithPublicOOBRequestErrorCode is for failures in accept request with public OOBRequest command.
	AcceptRequestWithPublicOOBRequestErrorCode
	// AcceptRequestWithRecipientsErrorCode is for failures in accept request with recipients command.
	AcceptRequestWithRecipientsErrorCode
	// DeclineProposalErrorCode failures in decline proposal command.
	DeclineProposalErrorCode
	// DeclineRequestErrorCode failures in decline request command.
	DeclineRequestErrorCode
	// ActionsErrorCode failures in actions command.
	ActionsErrorCode
	// AcceptProblemReportErrorCode is for failures in accept problem report command.
	AcceptProblemReportErrorCode
)
View Source
const (
	CommandName = "introduce"

	Actions                           = "Actions"
	SendProposal                      = "SendProposal"
	SendProposalWithOOBRequest        = "SendProposalWithOOBRequest"
	SendRequest                       = "SendRequest"
	AcceptProposalWithOOBRequest      = "AcceptProposalWithOOBRequest"
	AcceptProposal                    = "AcceptProposal"
	AcceptRequestWithPublicOOBRequest = "AcceptRequestWithPublicOOBRequest"
	AcceptRequestWithRecipients       = "AcceptRequestWithRecipients"
	DeclineProposal                   = "DeclineProposal"
	DeclineRequest                    = "DeclineRequest"
	AcceptProblemReport               = "AcceptProblemReport"
)

constants for command introduce.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptProblemReportArgs

type AcceptProblemReportArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
}

AcceptProblemReportArgs model

This is used for accepting a problem report

type AcceptProblemReportResponse

type AcceptProblemReportResponse struct{}

AcceptProblemReportResponse model

Represents a AcceptProblemReport response message

type AcceptProposalArgs

type AcceptProposalArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
}

AcceptProposalArgs model

This is used for accepting a proposal.

type AcceptProposalResponse

type AcceptProposalResponse struct{}

AcceptProposalResponse model

Represents a AcceptProposal response message

type AcceptProposalWithOOBRequestArgs

type AcceptProposalWithOOBRequestArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Request is the out-of-band protocol's 'request' message.
	Request *outofband.Request `json:"request"`
}

AcceptProposalWithOOBRequestArgs model

This is used for accepting a proposal with public OOBRequest

type AcceptProposalWithOOBRequestResponse

type AcceptProposalWithOOBRequestResponse struct{}

AcceptProposalWithOOBRequestResponse model

Represents a AcceptProposalWithOOBRequest response message

type AcceptRequestWithPublicOOBRequestArgs

type AcceptRequestWithPublicOOBRequestArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Request is the out-of-band protocol's 'request' message.
	Request *outofband.Request `json:"request"`
	// To keeps information about the introduction
	To *introduce.To `json:"to"`
}

AcceptRequestWithPublicOOBRequestArgs model

This is used for accepting a request with public OOBRequest

type AcceptRequestWithPublicOOBRequestResponse

type AcceptRequestWithPublicOOBRequestResponse struct{}

AcceptRequestWithPublicOOBRequestResponse model

Represents a AcceptRequestWithPublicOOBRequest response message

type AcceptRequestWithRecipientsArgs

type AcceptRequestWithRecipientsArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Recipient specifies to whom proposal will be sent
	Recipient *introduce.Recipient `json:"recipient"`
	// To keeps information about the introduction
	To *introduce.To `json:"to"`
}

AcceptRequestWithRecipientsArgs model

This is used for accepting a request with recipients

type AcceptRequestWithRecipientsResponse

type AcceptRequestWithRecipientsResponse struct{}

AcceptRequestWithRecipientsResponse model

Represents a AcceptRequestWithRecipients response message

type ActionsResponse

type ActionsResponse struct {
	Actions []introduce.Action `json:"actions"`
}

ActionsResponse model

Represents Actions response message

type Command

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

Command is controller command for introduce.

func New

func New(ctx introduce.Provider, notifier command.Notifier) (*Command, error)

New returns new introduce controller command instance.

func (*Command) AcceptProblemReport

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

AcceptProblemReport is used for accepting problem report.

func (*Command) AcceptProposal

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

AcceptProposal is used when introducee wants to accept a proposal without providing a OOBRequest.

func (*Command) AcceptProposalWithOOBRequest

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

AcceptProposalWithOOBRequest is used when introducee wants to provide an out-of-band request.

func (*Command) AcceptRequestWithPublicOOBRequest

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

AcceptRequestWithPublicOOBRequest is used when introducer wants to provide a published out-of-band request. nolint: dupl

func (*Command) AcceptRequestWithRecipients

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

AcceptRequestWithRecipients is used when the introducer does not have a published out-of-band message on hand but he is willing to introduce agents to each other. nolint: dupl

func (*Command) Actions

func (c *Command) Actions(rw io.Writer, _ io.Reader) command.Error

Actions returns pending actions that have not yet to be executed or canceled.

func (*Command) DeclineProposal

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

DeclineProposal is used to reject the proposal. nolint: dupl

func (*Command) DeclineRequest

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

DeclineRequest is used to reject the request. nolint: dupl

func (*Command) GetHandlers

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

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

func (*Command) SendProposal

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

SendProposal sends a proposal to the introducees (the client has not published an out-of-band message).

func (*Command) SendProposalWithOOBRequest

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

SendProposalWithOOBRequest sends a proposal to the introducee (the client has published an out-of-band request).

func (*Command) SendRequest

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

SendRequest sends a request. Sending a request means that the introducee is willing to share their own out-of-band message.

type DeclineProposalArgs

type DeclineProposalArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Reason why proposal is declined
	Reason string `json:"reason"`
}

DeclineProposalArgs model

This is used when proposal needs to be rejected

type DeclineProposalResponse

type DeclineProposalResponse struct{}

DeclineProposalResponse model

Represents a DeclineProposal response message

type DeclineRequestArgs

type DeclineRequestArgs struct {
	// PIID Protocol instance ID
	PIID string `json:"piid"`
	// Reason why request is declined
	Reason string `json:"reason"`
}

DeclineRequestArgs model

This is used when request needs to be rejected

type DeclineRequestResponse

type DeclineRequestResponse struct{}

DeclineRequestResponse model

Represents a DeclineRequest response message

type SendProposalArgs

type SendProposalArgs struct {
	// Recipients specifies to whom proposal will be sent
	Recipients []*introduce.Recipient `json:"recipients"`
}

SendProposalArgs model

This is used for sending a proposal

type SendProposalResponse

type SendProposalResponse struct {
	// PIID Protocol instance ID. It can be used as a correlation ID
	PIID string `json:"piid"`
}

SendProposalResponse model

Represents a SendProposal response message

type SendProposalWithOOBRequestArgs

type SendProposalWithOOBRequestArgs struct {
	// Request is the out-of-band protocol's 'request' message.
	Request *outofband.Request `json:"request"`
	// Recipient specifies to whom proposal will be sent
	Recipient *introduce.Recipient `json:"recipient"`
}

SendProposalWithOOBRequestArgs model

This is used for sending a proposal with OOBRequest

type SendProposalWithOOBRequestResponse

type SendProposalWithOOBRequestResponse struct {
	// PIID Protocol instance ID. It can be used as a correlation ID
	PIID string `json:"piid"`
}

SendProposalWithOOBRequestResponse model

Represents a SendProposalWithOOBRequest response message

type SendRequestArgs

type SendRequestArgs struct {
	// PleaseIntroduceTo keeps information about the introduction
	PleaseIntroduceTo *introduce.PleaseIntroduceTo `json:"please_introduce_to"`
	// MyDID sender's did
	MyDID string `json:"my_did"`
	// TheirDID receiver's did
	TheirDID string `json:"their_did"`
}

SendRequestArgs model

This is used for sending a request

type SendRequestResponse

type SendRequestResponse struct {
	// PIID Protocol instance ID. It can be used as a correlation ID
	PIID string `json:"piid"`
}

SendRequestResponse model

Represents a SendRequest response message

Jump to

Keyboard shortcuts

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