basic

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package basic handles en-/decoding of basic types to 9p wire format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesDecode

func BytesDecode(r io.Reader) ([]byte, int64, error)

BytesDecode reads a variable number of bytes into a byte slice.

Returns a byte slice, the count of read bytes and a possible error.

func BytesEncode

func BytesEncode(w io.Writer, b []byte) (int64, error)

BytesEncode writes a byte slice.

Returns the count of written bytes and a possible error.

func StringDecode

func StringDecode(r io.Reader) (string, int64, error)

StringDecode reads a string.

Returns a string, the count of read bytes and a possible error.

func StringEncode

func StringEncode(w io.Writer, s string) (int64, error)

StringEncode writes a string.

Returns the count of written bytes and a possible error.

func Uint16Decode

func Uint16Decode(r io.Reader) (uint16, int64, error)

Uint16Decode reads a 16 bit value from an io.Reader.

Returns the decoded uint16 value, the count of read bytes and a possible error.

func Uint16Encode

func Uint16Encode(w io.Writer, x uint16) (int64, error)

Uint16Encode writes a uint16 value.

Returns the count of written bytes and a possible error.

func Uint32Decode

func Uint32Decode(r io.Reader) (uint32, int64, error)

Uint32Decode reads a 32 bit value from an io.Reader.

Returns the decoded uint32 value, the count of read bytes and a possible error.

func Uint32Encode

func Uint32Encode(w io.Writer, x uint32) (int64, error)

Uint32Encode writes a uint32 value.

Returns the count of written bytes and a possible error.

func Uint64Decode

func Uint64Decode(r io.Reader) (uint64, int64, error)

Uint64Decode reads a 64 bit value from an io.Reader.

Returns the decoded uint64 value, the count of read bytes and a possible error.

func Uint64Encode

func Uint64Encode(w io.Writer, x uint64) (int64, error)

Uint64Encode writes a uint64 value.

Returns the count of written bytes and a possible error.

func Uint8Decode

func Uint8Decode(r io.Reader) (uint8, int64, error)

Uint8Decode reads a single byte.

Returns the decoded byte, the count of read bytes and a possible error.

func Uint8Encode

func Uint8Encode(w io.Writer, x uint8) (int64, error)

Uint8Encode writes a single byte.

Returns the count of written bytes and a possible error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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