Documentation ¶
Index ¶
- Constants
- func Decrypt(cipherText []byte, key []byte) (string, error)
- func Encrypt(msg []byte, key []byte) ([]byte, error)
- func FromText(payload []byte) (base.MoneysocketMessage, base.MessageType, error)
- func IsCypherText(text []byte) bool
- func LocalEncode(msg base.MoneysocketMessage, sharedSeed *beacon.SharedSeed) (encoded bool, msgBytes []byte)
- func WireDecode(msgBytes []byte, sharedSeed *beacon.SharedSeed) (msg base.MoneysocketMessage, msgType base.MessageType, err error)
- func WireEncode(msg base.MoneysocketMessage, ss *beacon.SharedSeed) ([]byte, error)
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 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 ¶
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.
Click to show internal directories.
Click to hide internal directories.