tldmsg

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Zlib Imports: 2 Imported by: 2

Documentation

Overview

This is a simple package to implement the TLDMP protocol.

More info on the protocol: https://files.almaember.com/tld-messages.txt

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error uint8

Error type specifically for tldmsg

const (
	// The input didn't contain a full message
	InputTooShort Error = iota
)

func (Error) Error

func (self Error) Error() string

Get a textual representation of the error

type Message

type Message struct {
	// The type of the message
	MType uint8
	// The contents
	Content []byte
}

A simple message structure.

The content length is implied from the length of the slice.

func ReadFromStream

func ReadFromStream(rd io.Reader) (Message, error)

Read a message from a stream

func (Message) WriteToStream

func (msg Message) WriteToStream(wr io.Writer) error

Write a message to a stream

Jump to

Keyboard shortcuts

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