Documentation
¶
Overview ¶
Package mediatorclient provides client features for aries mediator commands.
Index ¶
Constants ¶
const ( // CommandName package command name. CommandName = "mediatorclient" // Connect command name. Connect = "Connect" // CreateInvitation command name. CreateInvitation = "CreateInvitation" // SendCreateConnectionRequest command name. SendCreateConnectionRequest = "SendCreateConnectionRequest" )
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) CreateInvitation ¶
CreateInvitation creates out-of-band invitation from one of the mediator connections.
func (*Command) GetHandlers ¶
GetHandlers returns list of all commands supported by this controller command.
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.