Documentation ¶
Index ¶
- Constants
- type AwaitReply
- type Command
- func (o *Command) GetHandlers() []command.Handler
- func (o *Command) RegisterHTTPService(rw io.Writer, req io.Reader) command.Error
- func (o *Command) RegisterService(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Reply(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Send(rw io.Writer, req io.Reader) command.Error
- func (o *Command) Services(rw io.Writer, req io.Reader) command.Error
- func (o *Command) UnregisterService(rw io.Writer, req io.Reader) command.Error
- type RegisterHTTPMsgSvcArgs
- type RegisterMsgSvcArgs
- type RegisteredServicesResponse
- type SendMessageResponse
- type SendNewMessageArgs
- type SendReplyMessageArgs
- type ServiceEndpointDestinationParams
- type UnregisterMsgSvcArgs
Constants ¶
const ( // command name. CommandName = "messaging" // command methods. RegisteredServicesCommandMethod = "Services" RegisterMessageServiceCommandMethod = "RegisterService" UnregisterMessageServiceCommandMethod = "UnregisterService" RegisterHTTPMessageServiceCommandMethod = "RegisterHTTPService" SendNewMessageCommandMethod = "Send" SendReplyMessageCommandMethod = "Reply" )
constants for the Messaging controller.
const ( // InvalidRequestErrorCode is typically a code for invalid requests. InvalidRequestErrorCode = command.Code(iota + command.Messaging) // RegisterMsgSvcError is for failures while registering new message service. RegisterMsgSvcError // UnregisterMsgSvcError is for failures while unregistering a message service. UnregisterMsgSvcError // SendMsgError is for failures while sending messages. SendMsgError // SendMsgReplyError is for failures while sending message replies. SendMsgReplyError )
Error codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AwaitReply ¶
type AwaitReply struct { // ReplyMessageType message type of incoming reply ReplyMessageType string `json:"messageType,omitempty"` // Timeout (in milliseconds) waiting for reply Timeout time.Duration `json:"timeout,omitempty"` }
AwaitReply contains await for reply parameters.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command contains basic command operations provided by messaging controller command.
func New ¶
func New(ctx provider, registrar command.MessageHandler, notifier command.Notifier) (*Command, error)
New returns new command instance for messaging controller API.
func (*Command) GetHandlers ¶
GetHandlers returns list of all commands supported by this controller command.
func (*Command) RegisterHTTPService ¶
RegisterHTTPService registers new http over didcomm service to message handler registrar.
func (*Command) RegisterService ¶
RegisterService registers new message service to message handler registrar.
type RegisterHTTPMsgSvcArgs ¶
type RegisterHTTPMsgSvcArgs struct { // Name of the HTTP over DIDComm message service Name string `json:"name"` // Acceptance criteria for http over did comm message service based on message purpose. // In case of multiple purposes, operation will follow `A tagging system` purpose field validation from RFC-0351 // If not provided then all incoming messages of HTTP over DIDComm type will be handled by operation. Purpose []string `json:"purpose"` }
RegisterHTTPMsgSvcArgs contains parameters for registering an HTTP over DIDComm message service to message handler.
type RegisterMsgSvcArgs ¶
type RegisterMsgSvcArgs struct { // Name of the message service Name string `json:"name"` // Acceptance criteria for message service based on message purpose // in case of multiple purposes, message will be dispatched if any one of the purpose matches // with the purpose of incoming message. // Can be provided in conjunction with other acceptance criteria. Purpose []string `json:"purpose"` // Acceptance criteria for message service based on message type. // Can be provided in conjunction with other acceptance criteria. Type string `json:"type"` }
RegisterMsgSvcArgs contains parameters for registering a message service to message handler.
type RegisteredServicesResponse ¶
type RegisteredServicesResponse struct { // Registered service names Names []string `json:"names"` }
RegisteredServicesResponse is for returning list of registered service names.
type SendMessageResponse ¶
type SendMessageResponse struct { // Response will contain raw message reply content if AwaitReply is used in send message request. Response json.RawMessage `json:"response,omitempty"` }
SendMessageResponse is response for send/reply message feature.
type SendNewMessageArgs ¶
type SendNewMessageArgs struct { // Connection ID of the message destination // This parameter takes precedence over all the other destination parameters. ConnectionID string `json:"connection_ID,omitempty"` // DID of the destination. // This parameter takes precedence over `ServiceEndpoint` destination parameter. TheirDID string `json:"their_did,omitempty"` // ServiceEndpointDestination service endpoint destination. // This param can be used to send messages outside connection. ServiceEndpointDestination *ServiceEndpointDestinationParams `json:"service_endpoint,omitempty"` // Message body of the message MessageBody json.RawMessage `json:"message_body"` // Await reply from receiver of this message // If provided, then send message feature will wait response of this type for same thread AwaitReply AwaitReply `json:"await_reply"` }
SendNewMessageArgs contains parameters for sending new message with one of three destination options below,
- ConnectionID - ID of the connection between sender and receiver of this message.
- TheirDID - TheirDID of the DID exchange connection record between sender and receiver of this message.
- ServiceEndpoint (With recipient Keys, endpoint and optional routing keys) - To Send message outside connection.
Note: Precedence logic when multiple destination options are provided are according to above order.
type SendReplyMessageArgs ¶
type SendReplyMessageArgs struct { // ID of the message replying to MessageID string `json:"message_ID"` // Message body of the reply message MessageBody json.RawMessage `json:"message_body"` // StartNewThread if provided, replies to message by starting a new thread. StartNewThread bool `json:"start_new_thread"` // Await reply from receiver of this message // If provided, then reply message feature will wait response of this type for same thread AwaitReply AwaitReply `json:"await_reply"` }
SendReplyMessageArgs contains parameters for sending message reply.
type ServiceEndpointDestinationParams ¶
type ServiceEndpointDestinationParams struct { // Recipient keys of service endpoint RecipientKeys []string `json:"recipientKeys,omitempty"` // Service endpoint ServiceEndpoint string `json:"serviceEndpoint,omitempty"` // Routing Keys of service endpoint RoutingKeys []string `json:"routingKeys,omitempty"` }
ServiceEndpointDestinationParams contains service endpoint params.
type UnregisterMsgSvcArgs ¶
type UnregisterMsgSvcArgs struct { // Name of the message service to be unregistered // required: true Name string `json:"name"` }
UnregisterMsgSvcArgs contains parameters for unregistering a message service from message handler.