outofband

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: 14 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode is typically a code for validation errors
	// for invalid outofband controller requests.
	InvalidRequestErrorCode = command.Code(iota + command.Outofband)
	// CreateInvitationErrorCode is for failures in create invitation command.
	CreateInvitationErrorCode
	// AcceptInvitationErrorCode is for failures in accept invitation command.
	AcceptInvitationErrorCode
	// ActionStopErrorCode is for failures in action stop command.
	ActionStopErrorCode
	// ActionsErrorCode is for failures in actions command.
	ActionsErrorCode
	// ActionContinueErrorCode is for failures in action continue command.
	ActionContinueErrorCode
)
View Source
const (
	// command name.
	CommandName      = "outofband"
	CreateInvitation = "CreateInvitation"
	AcceptInvitation = "AcceptInvitation"
	ActionStop       = "ActionStop"
	Actions          = "Actions"
	ActionContinue   = "ActionContinue"
)

constants for out-of-band.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptInvitationArgs

type AcceptInvitationArgs struct {
	Invitation         *outofband.Invitation `json:"invitation"`
	MyLabel            string                `json:"my_label"`
	RouterConnections  string                `json:"router_connections"`
	ReuseConnection    string                `json:"reuse_connection"`
	ReuseAnyConnection bool                  `json:"reuse_any_connection"`
}

AcceptInvitationArgs model

This is used for accepting an invitation.

type AcceptInvitationResponse

type AcceptInvitationResponse struct {
	ConnectionID string `json:"connection_id"`
}

AcceptInvitationResponse model

Represents a AcceptInvitation response message.

type ActionContinueArgs

type ActionContinueArgs struct {
	// PIID Protocol instance ID
	PIID              string `json:"piid"`
	Label             string `json:"label"`
	RouterConnections string `json:"router_connections"`
}

ActionContinueArgs model

This is used when we need to proceed with the protocol.

type ActionContinueResponse

type ActionContinueResponse struct{}

ActionContinueResponse model

Represents a ActionContinue response message.

type ActionStopArgs

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

ActionStopArgs model

This is used when action needs to be rejected.

type ActionStopResponse

type ActionStopResponse struct{}

ActionStopResponse model

Represents a ActionStop response message.

type ActionsResponse

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

ActionsResponse model

Represents Actions response message.

type Command

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

Command is controller command for outofband.

func New

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

New returns new outofband controller command instance.

func (*Command) AcceptInvitation

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

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

func (*Command) ActionContinue

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

ActionContinue allows continuing with the protocol after an action event was triggered.

func (*Command) ActionStop

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

ActionStop stops the protocol after an action event was triggered.

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

func (c *Command) CreateInvitation(rw io.Writer, req io.Reader) command.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 (*Command) GetHandlers

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

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

type CreateInvitationArgs

type CreateInvitationArgs struct {
	Label              string        `json:"label"`
	Goal               string        `json:"goal"`
	GoalCode           string        `json:"goal_code"`
	Service            []interface{} `json:"service"`
	Protocols          []string      `json:"protocols"`
	Accept             []string      `json:"accept"`
	RouterConnectionID string        `json:"router_connection_id"`
	// Attachments is intended to provide the possibility to include files, links or even JSON payload to the message.
	Attachments []*decorator.Attachment `json:"attachments"`
}

CreateInvitationArgs model

This is used for creating an invitation.

type CreateInvitationResponse

type CreateInvitationResponse struct {
	Invitation *outofband.Invitation `json:"invitation"`
}

CreateInvitationResponse model

Represents a CreateInvitation response message.

Jump to

Keyboard shortcuts

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