outofband

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

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)
	// CreateRequestErrorCode is for failures in create request command.
	CreateRequestErrorCode
	// CreateInvitationErrorCode is for failures in create invitation command.
	CreateInvitationErrorCode
	// AcceptRequestErrorCode is for failures in accept request command.
	AcceptRequestErrorCode
	// 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"
	CreateRequest    = "CreateRequest"
	CreateInvitation = "CreateInvitation"
	AcceptRequest    = "AcceptRequest"
	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"`
}

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 AcceptRequestArgs

type AcceptRequestArgs struct {
	Request           *outofband.Request `json:"request"`
	MyLabel           string             `json:"my_label"`
	RouterConnections string             `json:"router_connections"`
}

AcceptRequestArgs model

This is used for accepting a request

type AcceptRequestResponse

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

AcceptRequestResponse model

Represents a AcceptRequest 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) AcceptRequest

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

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

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

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

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"`
	RouterConnectionID string        `json:"router_connection_id"`
}

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

type CreateRequestArgs

type CreateRequestArgs struct {
	Label              string        `json:"label"`
	Goal               string        `json:"goal"`
	GoalCode           string        `json:"goal_code"`
	Service            []interface{} `json:"service"`
	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"`
}

CreateRequestArgs model

This is used for creating a request

type CreateRequestResponse

type CreateRequestResponse struct {
	Request *outofband.Request `json:"request"`
}

CreateRequestResponse model

Represents a CreateRequest response message

Jump to

Keyboard shortcuts

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