mailbox

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNetworkNotSupportedError

func IsNetworkNotSupportedError(err error) bool

IsNetworkNotSupportedError network not supported errors can be resolved by selecting a different client or configuring the network.

func ReadMessage

func ReadMessage(txData []byte, decrypter cipher.Decrypter, cache stores.Cache) (*mail.Message, error)

ReadMessage gets the messages, decrypts and checks to see if it's valid - Check transaction data - Decrypt location - Get message - Decrypt message - Check hash

func SendMessage

func SendMessage(ctx context.Context, protocol, network string, msg *mail.Message, encrypter cipher.Encrypter,
	msgSender sender.Message, sent stores.Sent, msgSigner signer.Signer, envelopeKind byte) error

SendMessage performs all the actions required to send a message. - Create a hash of encoded message - Encrypt message - Store sent message - Encrypt message location - Create transaction data with encrypted location and message hash - Send transaction

Types

type PubKeyFinder

type PubKeyFinder interface {
	PublicKeyFromAddress(ctx context.Context, protocol, network string, address []byte) (crypto.PublicKey, error)
}

PubKeyFinder find public key to encrypt message with

type Receiver

type Receiver interface {
	Receive(ctx context.Context, protocol, network string, address []byte) ([]stores.Transaction, error)
	Kind() string
}

Receiver gets encrypted data from blockchain.

Directories

Path Synopsis
Package mailboxtest is a generated GoMock package.
Package mailboxtest is a generated GoMock package.
signertest
Package signertest is a generated GoMock package.
Package signertest is a generated GoMock package.

Jump to

Keyboard shortcuts

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