messenger

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MessengerStore is messenger store name.
	MessengerStore = "messenger_store"
)

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, myDID, theirDID string) error

HandleInbound handles all inbound messages.

func (*Messenger) ReplyTo

func (m *Messenger) ReplyTo(msgID string, msg service.DIDCommMsgMap) 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

func (m *Messenger) ReplyToMsg(in, out service.DIDCommMsgMap, myDID, theirDID string) 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) 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

func (m *Messenger) SendToDestination(msg service.DIDCommMsgMap, sender string,
	destination *service.Destination) 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