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