encoder

package
v0.0.0-...-93e2160 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVEncoder

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

func (*CSVEncoder) Close

func (e *CSVEncoder) Close() error

func (*CSVEncoder) Encode

func (e *CSVEncoder) Encode(w io.Writer, data any) error

type Encoder

type Encoder interface {
	Encode(w io.Writer, data any) error
	Close() error
}

func New

func New(format string, opts ...Option) (Encoder, error)

type JSONEncoder

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

func (*JSONEncoder) Close

func (e *JSONEncoder) Close() error

func (*JSONEncoder) Encode

func (e *JSONEncoder) Encode(w io.Writer, data any) error

type NullEncoder

type NullEncoder struct{}

func (*NullEncoder) Close

func (e *NullEncoder) Close() error

func (*NullEncoder) Encode

func (e *NullEncoder) Encode(w io.Writer, data any) error

type Option

type Option func(e Encoder) error

func WithDataMapper

func WithDataMapper(mapper func(data any) ([]string, error)) Option

func WithIndentation

func WithIndentation() Option

type TextEncoder

type TextEncoder struct{}

func (*TextEncoder) Close

func (e *TextEncoder) Close() error

func (*TextEncoder) Encode

func (e *TextEncoder) Encode(w io.Writer, data any) error

type YAMLEncoder

type YAMLEncoder struct{}

func (*YAMLEncoder) Close

func (e *YAMLEncoder) Close() error

func (*YAMLEncoder) Encode

func (e *YAMLEncoder) Encode(w io.Writer, data any) error

Jump to

Keyboard shortcuts

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