Documentation
¶
Overview ¶
Package msgsess contains session message definitions and parsing methods, to be sent over relay or directly.
Session message interface definitions are sealed within this package.
Index ¶
Constants ¶
View Source
const ( PingMessage = MessageType(0x00) PongMessage = MessageType(0x01) RendezvousMessage = MessageType(0xFF) )
View Source
const NaclBoxNonceLen = 24
Variables ¶
View Source
var Magic = string(MagicBytes)
Magic is the 8 byte header of all session messages "🪄🧦" F0 9F AA 84 F0 9F A7 A6
View Source
var MagicBytes = []byte{0xF0, 0x9F, 0xAA, 0x84, 0xF0, 0x9F, 0xA7, 0xA6}
Functions ¶
Types ¶
type ClearMessage ¶
type ClearMessage struct { Session key.SessionPublic Message SessionMessage }
ClearMessage represents a full session wire message in decrypted view
type MessageType ¶
type MessageType byte
type Ping ¶
type Ping struct { TxID TxID // Allegedly the sender's nodekey address NodeKey key.NodePublic // TODO implement padding Padding int }
func (*Ping) MarshalSessionMessage ¶
type Pong ¶
type Pong struct { TxID [12]byte Src netip.AddrPort // 18 bytes (16+2) on the wire; v4-mapped ipv6 for IPv4 }
func (*Pong) MarshalSessionMessage ¶
type Rendezvous ¶
func (*Rendezvous) Debug ¶
func (r *Rendezvous) Debug() string
func (*Rendezvous) MarshalSessionMessage ¶
func (r *Rendezvous) MarshalSessionMessage() []byte
type SessionMessage ¶
type SessionMessage interface { MarshalSessionMessage() []byte // todo maybe convert to slog.Group? Debug() string }
func ParseSessionMessage ¶
func ParseSessionMessage(usrMsg []byte) (SessionMessage, error)
type VersionMarker ¶
type VersionMarker byte
Click to show internal directories.
Click to hide internal directories.