message

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const FeatureSSHRendezvous = "ssh-rendezvous-v1"

FeatureSSHRendezvous marks the unencrypted PAKE negotiation for a shared SSH terminal. Relays may use this fixed marker for aggregate telemetry; it contains no invitation, room, role, or terminal data.

Variables

View Source
var ErrMessageTooLarge = errors.New("message too large after decompression")

ErrMessageTooLarge indicates that a message would exceed the maximum JSON size accepted by Decode after decompression.

Functions

func Encode

func Encode(key []byte, m Message) (b []byte, err error)

Encode will convert to bytes

func Send

func Send(c *comm.Comm, key []byte, m Message) (err error)

Send will send out

Types

type Message

type Message struct {
	Type     Type     `json:"t,omitempty"`
	Version  int      `json:"v,omitempty"`
	Message  string   `json:"m,omitempty"`
	Bytes    []byte   `json:"b,omitempty"`
	Bytes2   []byte   `json:"b2,omitempty"`
	Num      int      `json:"n,omitempty"`
	Features []string `json:"f,omitempty"`
}

Message is the possible payload for messaging

func Decode

func Decode(key []byte, b []byte) (m Message, err error)

Decode will convert from bytes

func DecodeWithLimit

func DecodeWithLimit(key []byte, b []byte, maxJSONSize int64) (m Message, err error)

DecodeWithLimit decodes a message while bounding its decompressed JSON size.

func (Message) String

func (m Message) String() string

type Type

type Type string

Type is a message type

const (
	TypePAKE             Type = "pake"
	TypePAKEConfirm      Type = "pake-confirm"
	TypeTailcatOffer     Type = "tailcat-offer"
	TypeTailcatStatus    Type = "tailcat-status"
	TypeTransportSelect  Type = "transport-select"
	TypeExternalIP       Type = "externalip"
	TypeFinished         Type = "finished"
	TypeError            Type = "error"
	TypeCloseRecipient   Type = "close-recipient"
	TypeCloseSender      Type = "close-sender"
	TypeRecipientReady   Type = "recipientready"
	TypeFileInfo         Type = "fileinfo"
	TypeFileInfoStart    Type = "fileinfo-start"
	TypeFileInfoBatch    Type = "fileinfo-batch"
	TypeFileInfoEnd      Type = "fileinfo-end"
	TypeFilePrepared     Type = "file-prepared"
	TypeExactHashRequest Type = "exact-hash-request"
	TypeExactHashResult  Type = "exact-hash-result"
	TypeRelayStandby     Type = "relay-standby"
	TypeRelayRamp        Type = "relay-ramp"
	TypeSSHAuthorize     Type = "ssh-authorize"
	TypeSSHOffer         Type = "ssh-offer"
)

Jump to

Keyboard shortcuts

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