message

package
v0.87.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NexusCreated announces a nexus has been created.
	NexusCreated = "NEXUS_CREATED"
	// NexusAnnounced announces a nexus has been announced.
	NexusAnnounced = "NEXUS_ANNOUNCED"
	// NexusWaiting announces a nexus has been announced.
	NexusWaiting = "NEXUS_WAITING"
	// NexusDestroyed announces a nexus has been destroyed.
	NexusDestroyed = "NEXUS_DESTROYED"
	// NexusDestroyed announces a nexus has been destroyed.
	NexusRevoked = "NEXUS_REVOKED"
)

nexus lifecycle events.

View Source
const (
	// Consumer layer name.
	Consumer = "CONSUMER"
	// Relay layer name.
	Relay = "RELAY"
	// OutgoingLocal layer name.
	OutgoingLocal = "OUTGOING_LOCAL"
	// IncomingWebsocket layer name.
	IncomingWebsocket = "INCOMING_WEBSOCKET"
	// IncomingLocal layer name.
	IncomingLocal = "INCOMING_LOCAL"
	// OutgoingWebsocket layer name.
	OutgoingWebsocket = "OUTGOING_WEBSOCKET"
	// OutgoingRendezvous layer name.
	OutgoingRendezvous = "OUTGOING_RENDEZVOUS"
	// IncomingRendezvous layer name.
	IncomingRendezvous = "INCOMING_RENDEZVOUS"
	// RequestRendezvous  layer name.
	RequestRendezvous = "REQUEST_RENDEZVOUS"
	// Provider layer name.
	Provider = "PROVIDER"
	// ProviderTransact layer name.
	ProviderTransact = "PROVIDER_TRANSACT"
	// Terminus layer name.
	Terminus = "TERMINUS"
	// Seller layer name.
	Seller = "SELLER"
)
View Source
const MessageClass = base.MessageClassKey

MessageClass is the class of the message.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherText []byte, key []byte) (string, error)

Decrypt decrypts cipher text string into plain text string.

func Encrypt

func Encrypt(msg []byte, key []byte) ([]byte, error)

Encrypt encrypts plain text string into cipher text string.

func FromText added in v0.54.0

func FromText(payload []byte) (base.MoneysocketMessage, base.MessageType, error)

FromText generates a moneysocket message from a layer.

func IsCypherText

func IsCypherText(text []byte) bool

IsCypherText checks if string is cipher (in actuality, this method checks whether a string is not json).

func LocalEncode

func LocalEncode(msg base.MoneysocketMessage, sharedSeed *beacon.SharedSeed) (encoded bool, msgBytes []byte)

LocalEncode encodes a message.

func WireDecode

func WireDecode(msgBytes []byte, sharedSeed *beacon.SharedSeed) (msg base.MoneysocketMessage, msgType base.MessageType, err error)

WireDecode decodes a message from a moneysocket message.

func WireEncode

func WireEncode(msg base.MoneysocketMessage, ss *beacon.SharedSeed) ([]byte, error)

WireEncode encodes a message, encrypt if shared seed is present.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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