parse

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package parse provides a parser for messages with key/value pairs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Text []byte   // message text
	List [][]byte // key/value pairs
	// contains filtered or unexported fields
}

Message represents a message with text and any assocated key/value pairs.

func Bytes

func Bytes(input []byte) *Message

Bytes parses the input bytes and returns a message.

Memory allocations are kept to a minimum. The message is allocated from a memory pool. Call Release() to return the message to the pool for re-use.

func (*Message) Release

func (m *Message) Release()

Release returns the message to the pool for re-use.

Notes

Bugs

  • Uses the unsafe package to cast a byte slice to a string. This could break in future versions of Go. The reason for this conversion is that there is no equivalent to strconv.UnquoteChar that works on a byte slice.

Jump to

Keyboard shortcuts

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