introduce

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 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
	// AcceptRequestWithPublicOOBInvitationErrorCode is for failures in accept request with public OOBRequest command.
	AcceptRequestWithPublicOOBInvitationErrorCode
	// 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"
	SendProposalWithOOBInvitation        = "SendProposalWithOOBInvitation"
	SendRequest                          = "SendRequest"
	AcceptProposalWithOOBInvitation      = "AcceptProposalWithOOBInvitation"
	AcceptProposal                       = "AcceptProposal"
	AcceptRequestWithPublicOOBInvitation = "AcceptRequestWithPublicOOBInvitation"
	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 AcceptProposalWithOOBInvitationArgs

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

AcceptProposalWithOOBInvitationArgs model

This is used for accepting a proposal with public OOBRequest.

type AcceptProposalWithOOBInvitationResponse

type AcceptProposalWithOOBInvitationResponse struct{}

AcceptProposalWithOOBInvitationResponse model

Represents a AcceptProposalWithOOBInvitation response message.

type AcceptRequestWithPublicOOBInvitationArgs

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

AcceptRequestWithPublicOOBInvitationArgs model

This is used for accepting a request with public OOBRequest.

type AcceptRequestWithPublicOOBInvitationResponse

type AcceptRequestWithPublicOOBInvitationResponse struct{}

AcceptRequestWithPublicOOBInvitationResponse model

Represents a AcceptRequestWithPublicOOBInvitation 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) AcceptProposalWithOOBInvitation

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

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

func (*Command) AcceptRequestWithPublicOOBInvitation

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

AcceptRequestWithPublicOOBInvitation is used when introducer wants to provide a published out-of-band request.

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.

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.

func (*Command) DeclineRequest

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

DeclineRequest is used to reject the request.

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

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

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

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 SendProposalWithOOBInvitationArgs

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

SendProposalWithOOBInvitationArgs 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 SendProposalWithOOBInvitation 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