messenger

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const MessengerStore = "messenger_store"

MessengerStore is messenger store name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Messenger

type Messenger struct {
	// contains filtered or unexported fields
}

Messenger describes the messenger structure.

func NewMessenger

func NewMessenger(ctx Provider) (*Messenger, error)

NewMessenger returns a new instance of the Messenger.

func (*Messenger) HandleInbound

func (m *Messenger) HandleInbound(msg service.DIDCommMsgMap, ctx service.DIDCommContext) error

HandleInbound handles all inbound messages.

func (*Messenger) ReplyTo

func (m *Messenger) ReplyTo(msgID string, msg service.DIDCommMsgMap, opts ...service.Opt) error

ReplyTo replies to the message by given msgID. The function adds ~thread decorator to the message according to the given msgID. Do not provide a message with ~thread decorator. It will be rewritten.

func (*Messenger) ReplyToMsg added in v0.1.5

func (m *Messenger) ReplyToMsg(in, out service.DIDCommMsgMap, myDID, theirDID string, opts ...service.Opt) error

ReplyToMsg replies to the given message. The function adds ~thread decorator to the message according to the given msgID. Do not provide a message with ~thread decorator. It will be rewritten.

func (*Messenger) ReplyToNested

func (m *Messenger) ReplyToNested(msg service.DIDCommMsgMap, opts *service.NestedReplyOpts) error

ReplyToNested sends the message by starting a new thread. Do not provide a message with ~thread decorator. It will be rewritten. The function adds ~thread decorator to the message according to the given threadID. NOTE: Given threadID (from opts or from message record) becomes parent threadID.

func (*Messenger) Send

func (m *Messenger) Send(msg service.DIDCommMsgMap, myDID, theirDID string, opts ...service.Opt) error

Send sends the message by starting a new thread. Do not provide a message with ~thread decorator. It will be removed. Use ReplyTo function instead. It will keep ~thread decorator automatically.

func (*Messenger) SendToDestination added in v0.1.3

func (m *Messenger) SendToDestination(msg service.DIDCommMsgMap, sender string,
	destination *service.Destination, opts ...service.Opt) error

SendToDestination sends the message to given destination by starting a new thread. Do not provide a message with ~thread decorator. It will be removed. Use ReplyTo function instead. It will keep ~thread decorator automatically.

type Provider

type Provider interface {
	OutboundDispatcher() dispatcher.Outbound
	StorageProvider() storage.Provider
}

Provider contains dependencies for the Messenger.

Jump to

Keyboard shortcuts

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