encode

package
v0.0.0-...-610f8f3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode(v any) any
}

func NewEncoder

func NewEncoder(opt ...EncoderOption) Encoder

NewEncoder creates a new encoder with the following default conversions: - float NaN/Inf are converted to nil - zero time.Time are converted to nil - durations are converted to seconds using WithDuration() - fmt.Stringer are converted to string - time.Time are converted to RFC3339 string

type EncoderOption

type EncoderOption func(*encoder)

func WithDuration

func WithDuration() EncoderOption

Jump to

Keyboard shortcuts

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