Documentation ¶
Index ¶
- Variables
- func AllocAndPack(inputs ...Packable) []byte
- func Log(value interface{}, format string, args ...interface{})
- func Pack(buffer []byte, input interface{}) uint
- func PackSome(buffer []byte, inputs ...interface{})
- func PackString(buffer []byte, maxLen uint, input string) (uint, error)
- func Unpack(data []byte, output interface{}) (uint, error)
- func UnpackSome(data []byte, outputs ...interface{}) (uint, error)
- func UnpackString(buffer []byte, len uint, output *string) (uint, error)
- type BadReader
- type BadWriter
- type LogTarget
- type Packable
- type Unpackable
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadRead = errors.New("bad read")
ErrBadRead is the error that occurs when reading from BadReader.
View Source
var ErrBadWrite = errors.New("bad write")
ErrBadWrite is the error that occurs when writing to BadWriter.
Functions ¶
func AllocAndPack ¶
AllocAndPack allocates a buffer and then packs the data inside it.
func Log ¶
func Log(value interface{}, format string, args ...interface{})
Log sends a message to the Logger.
func PackString ¶
PackString packs a string into the buffer
func UnpackSome ¶
UnpackSome unpacks multiple values.
Types ¶
type LogTarget ¶
type LogTarget interface {
Printf(format string, args ...interface{})
}
A LogTarget is used to log certain messages.
var Logger LogTarget
Logger is the log target for asynchronous and non-critical errors.
type Unpackable ¶
Unpackable is implemented by types that can be initialized by reading from a byte slice.
Click to show internal directories.
Click to hide internal directories.