closeenvelope

package
v1.18.4 Latest Latest
Warning

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

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

Documentation

Overview

Package closeenvelope provides the encoder for the client message CLOSE which is a request to terminate a subscription.

Index

Constants

View Source
const L = "CLOSE"

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 {
	ID *subscription.Id
}

T is a CLOSE envelope, which is a signal from client to relay to stop a specified subscription.

func New

func New() *T

New creates an empty new standard formatted closeenvelope.T.

func NewFrom

func NewFrom(id *subscription.Id) *T

NewFrom creates a new closeenvelope.T populated with subscription Id.

func Parse

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

Parse reads a CLOSE envelope from minified JSON into a newly allocated closeenvelope.T.

func (*T) Label

func (en *T) Label() string

Label returns the label of a closeenvelope.T.

func (*T) Marshal

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

Marshal a closeenvelope.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 closeenvelope.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 closeenvelope.T to a provided io.Writer.

Jump to

Keyboard shortcuts

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