nv

package
v0.0.0-...-5c345c6 Latest Latest
Warning

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

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

README

nv

nv

Usage

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.

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 {
}

NativeDecoder is a Decoder for native encoding.

func NewNativeDecoder
func NewNativeDecoder(r io.ReadSeeker) *NativeDecoder

NewNativeDecoder creates a new NativeDecoder.

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

Decode decodes data into a supplied target. 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 NativeEncoder
type NativeEncoder struct {
}

NativeEncoder is an Encoder for native encoding.

func NewNativeEncoder
func NewNativeEncoder(w io.Writer) *NativeEncoder

NewNativeEncoder creates a new NativeEncoder.

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

Encode encodes the supplied data with native encoding.

type XDRDecoder
type XDRDecoder struct {
	*xdr.Decoder
}

XDRDecoder is a Decoder for XDR encoding.

func NewXDRDecoder
func NewXDRDecoder(r io.ReadSeeker) *XDRDecoder

NewXDRDecoder creates a new XDRDecoder.

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

Decode decodes data into a supplied target. 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 {
}

XDREncoder is an Encoder for XDR encoding.

func NewXDREncoder
func NewXDREncoder(w io.Writer) XDREncoder

NewXDREncoder creates a new XDREncoder.

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

Encode encodes data using XDR encoding.

-- Generated with godocdown

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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
}

NativeDecoder is a Decoder for native encoding.

func NewNativeDecoder

func NewNativeDecoder(r io.ReadSeeker) *NativeDecoder

NewNativeDecoder creates a new NativeDecoder.

func (*NativeDecoder) Decode

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

Decode decodes data into a supplied target. 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 NativeEncoder

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

NativeEncoder is an Encoder for native encoding.

func NewNativeEncoder

func NewNativeEncoder(w io.Writer) *NativeEncoder

NewNativeEncoder creates a new NativeEncoder.

func (NativeEncoder) Encode

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

Encode encodes the supplied data with native encoding.

type XDRDecoder

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

XDRDecoder is a Decoder for XDR encoding.

func NewXDRDecoder

func NewXDRDecoder(r io.ReadSeeker) *XDRDecoder

NewXDRDecoder creates a new XDRDecoder.

func (*XDRDecoder) Decode

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

Decode decodes data into a supplied target. 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
}

XDREncoder is an Encoder for XDR encoding.

func NewXDREncoder

func NewXDREncoder(w io.Writer) XDREncoder

NewXDREncoder creates a new XDREncoder.

func (XDREncoder) Encode

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

Encode encodes data using XDR encoding.

Jump to

Keyboard shortcuts

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