decode

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package decode provides decoders for output of a runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	// Decode decodes the data in reader to structure in the second
	// argument of the method.
	Decode(io.Reader, any) error
}

Decoder defines a decoder.

func Gob added in v0.20.10

func Gob() Decoder

Gob returns a new binary value decoder.

func JSON

func JSON() Decoder

JSON creates a JSON decoder.

func XML added in v0.20.10

func XML() Decoder

XML creates a JSON decoder.

type GobDecoder added in v0.20.10

type GobDecoder struct{}

GobDecoder is a Decoder that decodes a gob into a struct.

func (GobDecoder) Decode added in v0.20.10

func (g GobDecoder) Decode(r io.Reader, v any) error

Decode decodes Gob to the data structure v.

type JSONDecoder added in v0.20.10

type JSONDecoder struct{}

JSONDecoder is a Decoder that decodes a json into a struct.

func (JSONDecoder) Decode added in v0.20.10

func (j JSONDecoder) Decode(r io.Reader, v any) error

Decode decodes JSON to the data structure v.

type XMLDecoder added in v0.20.10

type XMLDecoder struct{}

XMLDecoder is a Decoder that decodes a json into a struct.

func (XMLDecoder) Decode added in v0.20.10

func (j XMLDecoder) Decode(r io.Reader, v any) error

Decode decodes JSON to the data structure v.

Jump to

Keyboard shortcuts

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