messagepickup

package
v0.0.0-...-57c6170 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MessagePickup defines the protocol name.
	MessagePickup = "messagepickup"
	// Spec defines the protocol spec.
	Spec = "https://didcomm.org/messagepickup/1.0/"
	// StatusMsgType defines the protocol propose-credential message type.
	StatusMsgType = Spec + "status"
	// StatusRequestMsgType defines the protocol propose-credential message type.
	StatusRequestMsgType = Spec + "status-request"
	// BatchPickupMsgType defines the protocol offer-credential message type.
	BatchPickupMsgType = Spec + "batch-pickup"
	// BatchMsgType defines the protocol offer-credential message type.
	BatchMsgType = Spec + "batch"
	// NoopMsgType defines the protocol request-credential message type.
	NoopMsgType = Spec + "noop"
)
View Source
const (

	// Namespace is namespace of messagepickup store name.
	Namespace = "mailbox"
)

Variables

View Source
var (
	ErrConnectionNotFound = errors.New("connection not found")
)

ErrConnectionNotFound connection not found error.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Type     string            `json:"@type,omitempty"`
	ID       string            `json:"@id,omitempty"`
	Messages []*Message        `json:"messages~attach"`
	Thread   *decorator.Thread `json:"~thread,omitempty"`
}

Batch a message that contains multiple waiting messages. https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#batch

type BatchPickup

type BatchPickup struct {
	Type      string            `json:"@type,omitempty"`
	ID        string            `json:"@id,omitempty"`
	BatchSize int               `json:"batch_size"`
	Thread    *decorator.Thread `json:"~thread,omitempty"`
}

BatchPickup a request to have multiple waiting messages sent inside a batch message. https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#batch-pickup

type Message

type Message struct {
	ID        string    `json:"id"`
	AddedTime time.Time `json:"added_time"`
	Message   []byte    `json:"msg,omitempty"`
}

Message messagepickup wrapper.

type Noop

type Noop struct {
	Type string `json:"@type,omitempty"`
	ID   string `json:"@id,omitempty"`
}

Noop message https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#noop

type ProtocolService

type ProtocolService interface {
	AddMessage(message []byte, theirDID string) error
}

ProtocolService service interface for message pickup.

type Service

type Service struct {
	service.Action
	service.Message
	// contains filtered or unexported fields
}

Service for the messagepickup protocol.

func New

func New(prov provider) (*Service, error)

New returns the messagepickup service.

func (*Service) Accept

func (s *Service) Accept(msgType string) bool

Accept checks whether the service can handle the message type.

func (*Service) AddMessage

func (s *Service) AddMessage(message []byte, theirDID string) error

AddMessage add message to inbox.

func (*Service) BatchPickup

func (s *Service) BatchPickup(connectionID string, size int) (int, error)

BatchPickup a request to have multiple waiting messages sent inside a batch message.

func (*Service) HandleInbound

func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)

HandleInbound handles inbound message pick up messages.

func (*Service) HandleOutbound

func (s *Service) HandleOutbound(_ service.DIDCommMsg, _, _ string) (string, error)

HandleOutbound adherence to dispatcher.ProtocolService.

func (*Service) Initialize

func (s *Service) Initialize(p interface{}) error

Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.

func (*Service) Name

func (s *Service) Name() string

Name of the service.

func (*Service) Noop

func (s *Service) Noop(connectionID string) error

Noop a noop message.

func (*Service) StatusRequest

func (s *Service) StatusRequest(connectionID string) (*Status, error)

StatusRequest request a status message.

type Status

type Status struct {
	Type              string            `json:"@type,omitempty"`
	ID                string            `json:"@id,omitempty"`
	MessageCount      int               `json:"message_count"`
	DurationWaited    int               `json:"duration_waited,omitempty"`
	LastAddedTime     time.Time         `json:"last_added_time,omitempty"`
	LastDeliveredTime time.Time         `json:"last_delivered_time,omitempty"`
	LastRemovedTime   time.Time         `json:"last_removed_time,omitempty"`
	TotalSize         int               `json:"total_size,omitempty"`
	Thread            *decorator.Thread `json:"~thread,omitempty"`
}

Status details about pending messages https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#status

type StatusRequest

type StatusRequest struct {
	Type   string            `json:"@type,omitempty"`
	ID     string            `json:"@id,omitempty"`
	Thread *decorator.Thread `json:"~thread,omitempty"`
}

StatusRequest sent by the recipient to the message_holder to request a status message./0212-pickup#statusrequest https://github.com/hyperledger/aries-rfcs/tree/master/features/0212-pickup#statusrequest

Jump to

Keyboard shortcuts

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