eoseenvelope

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package eoseenvelope provides an encoder for the EOSE (End Of Stored Events) event that signifies that a REQ has found all stored events and from here on the request morphs into a subscription, until the limit, if requested, or until CLOSE or CLOSED.

Index

Constants

View Source
const L = "EOSE"

L is the label associated with this type of codec.Envelope.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	Subscription *subscription.Id
}

T is an EOSE envelope (End of Stored Events), that signals the end of events that are stored and the beginning of a subscription. This is necessitated by the confusing multiplexing of websockets for multiple requests, and an ugly merging of two distinct API calls, filter and subscribe.

func New

func New() *T

New creates a new eoseenvelope.T with a standard form subscription.Id.

func NewFrom

func NewFrom(id *subscription.Id) *T

NewFrom creates a new eoseenvelope.T using a provided subscription.Id.

func Parse

func Parse(b []byte) (t *T, rem []byte, err error)

Parse reads a EOSE envelope in minified JSON into a newly allocated eoseenvelope.T.

func (*T) Label

func (en *T) Label() string

Label returns the label of a EOSE envelope.

func (*T) Marshal

func (en *T) Marshal(dst []byte) (b []byte)

Marshal a eoseenvelope.T envelope in minified JSON, appending to a provided destination slice.

func (*T) Unmarshal

func (en *T) Unmarshal(b []byte) (r []byte, err error)

Unmarshal a eoseenvelope.T from minified JSON, returning the remainder after the end of the envelope.

func (*T) Write

func (en *T) Write(w io.Writer) (err error)

Write the eoseenvelope.T to a provided io.Writer.

Jump to

Keyboard shortcuts

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