message

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotifyProvider         = "NOTIFY_PROVIDER"
	NotifyProviderNotReady = "NOTIFY_PROVIDER_NOT_READY"
	NotifyPing             = "NOTIFY_PING"
	NotifyPong             = "NOTIFY_PONG"
	// rendezcous notificaton types
	NotifyRendezvous         = "NOTIFY_RENDEZVOUS"
	NotifyRendezvousNotReady = "NOTIFY_RENDEZVOUS_NOT_READY"
	NotifyRendezvousEnd      = "NOTIFY_RENDEZVOUS_END"
)

notification types

View Source
const (
	NexusCreated   = "NEXUS_CREATED"
	NexusAnnounced = "NEXUS_ANNOUNCED"
	NexusWaiting   = "NEXUS_WAITING"
	NexusDestroyed = "NEXUS_DESTROYED"
	NexusRevoked   = "NEXUS_REVOKED"
)

nexus lifecycle events

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

keys

View Source
const NotificationName = "notification_name"
View Source
const RequestName = request.RequestNameKey

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 IsCypherText

func IsCypherText(text []byte) bool

check 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)

func MessageFromText

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

func WireDecode

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

func WireEncode

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

encode 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