decoder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: GPL-3.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInstance = errors.New("invalid instance provided to create a reader")
)

Functions

func ToReader

func ToReader(any interface{}) (io.Reader, error)

ToReader converts an interface{} to an io.Reader

Parameters:

  • any: The interface{} to convert (can be io.Reader, string, or []byte)

Returns:

- io.Reader: The converted io.Reader - error: Error if the conversion fails

Types

type Decoder

type Decoder interface {
	Decode(
		body interface{},
		dest interface{},
	) error
	DecodeReader(
		reader io.Reader,
		dest interface{},
	) error
}

Decoder interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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