decoder

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 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")
	ErrNilBody         = errors.New("body cannot be nil")
	ErrNilReader       = errors.New("reader cannot be nil")
	ErrNilDestination  = errors.New("destination cannot be nil")
	ErrNilDecoder      = errors.New("decoder is nil")
)

Functions

func ToReader

func ToReader(reader any) (io.Reader, error)

ToReader converts an any to an io.Reader

Parameters:

  • reader: The any to convert

Returns:

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

Types

type Decoder

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

Decoder interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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