nv

package
v0.0.0-...-d9821e3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNativeEncoder

func NewNativeEncoder(w io.Writer) *nativeEncoder

func PrettyPrint

func PrettyPrint(dst *bytes.Buffer, src []byte, indent string) error

PrettyPrint writes into `dst` a decoded form of `src` meant for human consumption. The nv/xdr types are printed in sorted order along with the name and value of the nvp.

Types

type Boolean

type Boolean bool

Boolean is used for encoding and decoding the nvlist BOOLEAN datatype, which is different than BOOLEAN_VALUE. An nvlist BOOLEAN data type consists of a string key and a zero length value. Instead of dealing with inconsistencies when working with go structs vs map[string]interface, special go property annotations, and/or inferring when to handle data as a BOOLEAN based on nil/interface{} values, this explicitly named go type is to be used.

type NativeDecoder

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

func NewNativeDecoder

func NewNativeDecoder(r io.ReadSeeker) *NativeDecoder

func (*NativeDecoder) Decode

func (d *NativeDecoder) Decode(target interface{}) (err error)

Decode Note: care should be taken when decoding into a `map[string]interface{}` as bytes/uint8s (and their array forms) can not be distinguished and will be treated as uint8/[]uint8.

type XDRDecoder

type XDRDecoder struct {
	*xdr.Decoder
	// contains filtered or unexported fields
}

func NewXDRDecoder

func NewXDRDecoder(r io.ReadSeeker) *XDRDecoder

func (*XDRDecoder) Decode

func (d *XDRDecoder) Decode(target interface{}) error

Decode Note: care should be taken when decoding into a `map[string]interface{}` as bytes/uint8s (and their array forms) can not be distinguished and will be treated as uint8/[]uint8.

type XDREncoder

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

func NewXDREncoder

func NewXDREncoder(w io.Writer) XDREncoder

func (XDREncoder) Encode

func (e XDREncoder) Encode(i interface{}) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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