Documentation
¶
Overview ¶
Package pickup implements the DIDComm Pickup Protocol 2.0.
This protocol enables retrieving messages from a mediator when the recipient is offline or uses asynchronous message delivery.
Protocol URI: https://didcomm.org/messagepickup/2.0/
See: https://identity.foundation/didcomm-messaging/spec/#pickup-protocol-20
Index ¶
- Constants
- func NewDelivery(request *message.Message, attachments []MessageAttachment) (*message.Message, error)
- func NewDeliveryRequest(from, to string, limit int, recipientKey string) (*message.Message, error)
- func NewLiveDeliveryChange(from, to string, enable bool) (*message.Message, error)
- func NewMessagesReceived(from, to string, messageIDs []string) (*message.Message, error)
- func NewStatus(request *message.Message, status *Status) (*message.Message, error)
- func NewStatusRequest(from, to string, recipientKey string) (*message.Message, error)
- type AttachmentData
- type Delivery
- type DeliveryRequest
- type LiveDeliveryChange
- type MessageAttachment
- type MessagesReceived
- type Status
- type StatusRequest
Constants ¶
const ( ProtocolURI = "https://didcomm.org/messagepickup/2.0" TypeStatusRequest = ProtocolURI + "/status-request" TypeStatus = ProtocolURI + "/status" TypeDeliveryRequest = ProtocolURI + "/delivery-request" TypeDelivery = ProtocolURI + "/delivery" TypeMessagesReceived = ProtocolURI + "/messages-received" TypeLiveDeliveryChange = ProtocolURI + "/live-delivery-change" )
Variables ¶
This section is empty.
Functions ¶
func NewDelivery ¶
func NewDelivery(request *message.Message, attachments []MessageAttachment) (*message.Message, error)
NewDelivery creates a delivery message with attached messages.
func NewDeliveryRequest ¶
NewDeliveryRequest creates a message delivery request.
func NewLiveDeliveryChange ¶
NewLiveDeliveryChange creates a live delivery mode change request.
func NewMessagesReceived ¶
NewMessagesReceived creates an acknowledgment of received messages.
Types ¶
type AttachmentData ¶
type AttachmentData struct {
Base64 string `json:"base64,omitempty"`
JSON json.RawMessage `json:"json,omitempty"`
}
AttachmentData holds the message content.
type Delivery ¶
type Delivery struct {
RecipientKey string `json:"recipient_key,omitempty"`
Attachments []MessageAttachment `json:"~attach"`
}
Delivery contains messages being delivered.
type DeliveryRequest ¶
type DeliveryRequest struct {
Limit int `json:"limit,omitempty"`
RecipientKey string `json:"recipient_key,omitempty"`
}
DeliveryRequest requests delivery of messages.
func ParseDeliveryRequest ¶
func ParseDeliveryRequest(msg *message.Message) (*DeliveryRequest, error)
ParseDeliveryRequest parses a delivery request message.
type LiveDeliveryChange ¶
type LiveDeliveryChange struct {
LiveDelivery bool `json:"live_delivery"`
}
LiveDeliveryChange requests a change in live delivery mode.
type MessageAttachment ¶
type MessageAttachment struct {
ID string `json:"@id"`
Data AttachmentData `json:"data"`
}
MessageAttachment contains a message being delivered.
type MessagesReceived ¶
type MessagesReceived struct {
MessageIDList []string `json:"message_id_list"`
}
MessagesReceived acknowledges receipt of messages.
func ParseMessagesReceived ¶
func ParseMessagesReceived(msg *message.Message) (*MessagesReceived, error)
ParseMessagesReceived parses a messages-received acknowledgment.
type Status ¶
type Status struct {
RecipientKey string `json:"recipient_key,omitempty"`
MessageCount int `json:"message_count"`
LongestWaitedSeconds int64 `json:"longest_waited_seconds,omitempty"`
NewestReceivedTime string `json:"newest_received_time,omitempty"`
TotalBytes int64 `json:"total_bytes,omitempty"`
LiveDelivery bool `json:"live_delivery,omitempty"`
}
Status contains information about available messages at the mediator.
type StatusRequest ¶
type StatusRequest struct {
RecipientKey string `json:"recipient_key,omitempty"`
}
StatusRequest requests the current status of available messages.
func ParseStatusRequest ¶
func ParseStatusRequest(msg *message.Message) (*StatusRequest, error)
ParseStatusRequest parses a status request message.