Versions in this module Expand all Collapse all v0 v0.1.0 Dec 3, 2026 Changes in this version + const FlagCompressed + const FlagRequiresAck + const FrameVersion + const HeaderSize + const Magic + const MaxPayloadSize + const MsgAck + const MsgBrowseReq + const MsgBrowseResp + const MsgError + const MsgEventAck + const MsgGoodbye + const MsgHeartbeat + const MsgHeartbeatAck + const MsgHello + const MsgHelloAck + const MsgHistoryBatch + const MsgHistoryBatchAck + const MsgPing + const MsgPong + const MsgSnapshotReq + const MsgSnapshotResp + const MsgSubscribe + const MsgTagDelta + const MsgTagDeltaAck + const MsgTagWriteAck + const MsgTagWriteCmd + const QualityBad + const QualityGood + const QualityNotConnected + const QualityUncertain + const StatusExpired + const StatusFailed + const StatusSucceeded + const StatusUnknown + const TypeBool + const TypeEnum + const TypeFloat32 + const TypeFloat64 + const TypeInt16 + const TypeInt32 + const TypeJSON + const TypeString + const TypeUInt16 + const TypeUInt32 + var ErrBadCRC = errors.New("lunalink: crc mismatch") + var ErrBadMagic = errors.New("lunalink: bad magic") + var ErrFrameTooLarge = errors.New("lunalink: frame too large") + var ErrMsgpack = errors.New("lunalink: invalid msgpack") + var ErrWriteUnknown = errors.New("lunalink: write outcome unknown") + func CRC16(data []byte) uint16 + func Decode(b []byte) (any, error) + func DecodeError(p []byte) (code int64, msg string) + func DecodeValue(dataType int, b []byte) any + func EncodeAck(ackedSeq uint32) []byte + func EncodeFrame(f Frame, computeCRC bool) []byte + func EncodeGoodbye(reason string) []byte + func EncodeHeartbeat(tsMs, pendingBatches, pendingValues, pendingBytes int64, oldestAgeSec float64, ...) []byte + func EncodeHello(h Hello) []byte + func EncodeItem(it Item) ([]byte, error) + func EncodeTagDelta(items [][]byte, batchTsMs, nodeSeq int64, resync bool) []byte + func EncodeTagWriteAck(seqRef uint32, status int, commandID string, hasCommand bool) []byte + func EncodeValue(dataType int, v any) ([]byte, error) + func StatusName(s int) string + type Config struct + AckTimeout time.Duration + Addr string + AuthToken string + CollapseAt int + Logf func(format string, args ...any) + MaxPayload int + NodeID string + NodeName string + OnWrite WriteHandler + ReconnectDelay time.Duration + StorePath string + TLS *tls.Config + Version string + Window int + type Encoder struct + B []byte + func (e *Encoder) Array(n int) + func (e *Encoder) Bin(b []byte) + func (e *Encoder) Bool(v bool) + func (e *Encoder) Float32(v float32) + func (e *Encoder) Float64(v float64) + func (e *Encoder) Int(v int64) + func (e *Encoder) Nil() + func (e *Encoder) Raw(b []byte) + func (e *Encoder) Str(s string) + func (e *Encoder) Uint(v uint64) + type Frame struct + Flags byte + Payload []byte + Seq uint32 + Type byte + Version byte + func ReadFrame(r io.Reader, maxPayload int, checkCRC bool) (Frame, error) + type GUID [16]byte + func GUIDFromWire(w []byte) (GUID, bool) + func ParseGUID(s string) (GUID, error) + func (g GUID) String() string + func (g GUID) Wire() []byte + type Hello struct + AuthToken string + Capabilities []string + NodeID string + NodeName string + TimestampMs int64 + Version string + type HelloAck struct + Accepted bool + AssignedNodeID string + Capabilities []string + HeartbeatInterval int64 + RejectReason string + ServerTimeMs int64 + SupportedVersions []int64 + func DecodeHelloAck(p []byte) (HelloAck, error) + type Item struct + DataType int + Name string + Quality int + TagID GUID + TimestampMs int64 + Value any + type Node struct + func NewNode(cfg Config) (*Node, error) + func (n *Node) Close() error + func (n *Node) DropConnection() + func (n *Node) Publish(items []Item) error + func (n *Node) Run(ctx context.Context) error + func (n *Node) Store() *Store + type OutboxEntry struct + Payload []byte + Seq int64 + type Store struct + func OpenStore(path string) (*Store, error) + func (s *Store) After(seq int64, n int) ([]OutboxEntry, error) + func (s *Store) Close() error + func (s *Store) CommandStatus(id string) (status int, found bool) + func (s *Store) DeleteUpTo(seq int64) error + func (s *Store) Enqueue(items [][]byte, tagIDs []GUID, batchTsMs int64) (int64, error) + func (s *Store) Has(seq int64) bool + func (s *Store) LastSequence() int64 + func (s *Store) Latest() [][]byte + func (s *Store) SetCommandStatus(id string, status int) error + func (s *Store) Stats() (batches, bytes, highest int64) + type TagDeltaAck struct + Accepted bool + Duplicate bool + Error string + ExpectedSequence int64 + NodeSequence int64 + func DecodeTagDeltaAck(p []byte) (TagDeltaAck, error) + type WriteCmd struct + CommandID string + DataType int + ExpiresAtMs int64 + HasCommand bool + QueryOnly bool + SeqRef uint32 + TagID GUID + TagName string + ValueBytes []byte + func DecodeWriteCmd(p []byte) (WriteCmd, error) + type WriteHandler func(tag GUID, name string, dataType int, value any) error