rawmessage

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package rawmessage contains a RTMP raw message reader/writer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ChunkStreamID   byte
	Timestamp       time.Duration
	Type            uint8
	MessageStreamID uint32
	Body            []byte
}

Message is a raw message.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a raw message reader.

func NewReader

func NewReader(
	r io.Reader,
	bcr *bytecounter.Reader,
	onAckNeeded func(uint32) error,
) *Reader

NewReader allocates a Reader.

func (*Reader) Read

func (r *Reader) Read() (*Message, error)

Read reads a Message.

func (*Reader) SetChunkSize

func (r *Reader) SetChunkSize(v uint32) error

SetChunkSize sets the maximum chunk size.

func (*Reader) SetWindowAckSize

func (r *Reader) SetWindowAckSize(v uint32)

SetWindowAckSize sets the window acknowledgement size.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer is a raw message writer.

func NewWriter

func NewWriter(
	w io.Writer,
	bcw *bytecounter.Writer,
	checkAcknowledge bool,
) *Writer

NewWriter allocates a Writer.

func (*Writer) SetAcknowledgeValue

func (w *Writer) SetAcknowledgeValue(v uint32)

SetAcknowledgeValue sets the acknowledge sequence number.

func (*Writer) SetChunkSize

func (w *Writer) SetChunkSize(v uint32)

SetChunkSize sets the maximum chunk size.

func (*Writer) SetWindowAckSize

func (w *Writer) SetWindowAckSize(v uint32)

SetWindowAckSize sets the window acknowledgement size.

func (*Writer) Write

func (w *Writer) Write(msg *Message) error

Write writes a Message.

Jump to

Keyboard shortcuts

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