Versions in this module Expand all Collapse all v0 v0.2.1 Aug 31, 2026 Changes in this version type Option + func WithStrictTags() Option v0.2.0 Aug 31, 2026 Changes in this version type Option + func Alias[Named, Base any]() Option + func BetweenOK[In, Out any](fn func(In) Out) Option + func Between[In, Out any](fn func(In) (Out, error)) Option + func TimeLayout(layouts ...string) Option v0.1.0 Aug 26, 2026 Changes in this version + const DefaultTag + var ErrInvalidTag = errors.New("gofret: invalid struct tag") + var ErrNotPointer = errors.New("gofret: output must be a non-nil pointer") + var ErrOverflow = errors.New("gofret: value overflows destination type") + var ErrSkip = errors.New("gofret: skip hook") + var ErrUnconvertible = errors.New("gofret: unconvertible value") + var ErrUnsupportedType = errors.New("gofret: unsupported type") + var ErrUnusedKeys = errors.New("gofret: unused keys in input") + func CamelCase(s string) string + func FoldKey(s string) string + func KebabCase(s string) string + func LooseKey(s string) string + func LowerCase(s string) string + func PascalCase(s string) string + func SnakeCase(s string) string + func ToInto(in, out any) error + func To[T any](in any) (T, error) + type Codec struct + func New(opts ...Option) *Codec + func (c *Codec) ToInto(in, out any) error + func (c *Codec) ToIntoMeta(in, out any, md *Metadata) error + func (c *Codec) To[T any](in any) (T, error) + type Error struct + Err error + From reflect.Type + Path string + To reflect.Type + func Errors(err error) []*Error + func (e *Error) Error() string + func (e *Error) Unwrap() error + type Hook func(HookCtx) (any, error) + var DurationHook Hook = HookBetween(func(s string) (time.Duration, error) { ... }) + var NilHook Hook = func(ctx HookCtx) (any, error) { ... } + func HookBetween[In, Out any](fn func(In) (Out, error)) Hook + func HookFrom[T any](fn func(T) (any, error)) Hook + func HookTo[T any](fn func(any) (T, error)) Hook + func TimeFormatHook(layout string) Hook + func TimeHook(layouts ...string) Hook + type HookCtx struct + From reflect.Type + Tag Tag + To reflect.Type + Value reflect.Value + func (c HookCtx) Data() any + func (c HookCtx) Path() string + type KeyFunc func(string) string + type KeyNormalizer func(string) string + type Metadata struct + Keys []string + Unset []string + Unused []string + func (m *Metadata) Reset() + type Opt uint16 + const OptDeref + const OptInline + const OptKeep + const OptOmitEmpty + const OptRemain + const OptSkip + const OptString + func (o Opt) String() string + type Option func(*config) + func WithDerefPointers() Option + func WithErrorUnused() Option + func WithFailFast() Option + func WithHooks(hooks ...Hook) Option + func WithInlineEmbedded() Option + func WithKeyFunc(fn KeyFunc) Option + func WithKeyNormalizer(fn KeyNormalizer) Option + func WithLooseKeys() Option + func WithMaxErrors(n int) Option + func WithOmitNil() Option + func WithShallow() Option + func WithStrictKeys() Option + func WithStrictTypes() Option + func WithTag(tag string) Option + func WithTagFallback(tags ...string) Option + func WithTaggedOnly() Option + func WithWeakTypes() Option + func WithZeroFields() Option + type Tag struct + Name string + Opts Opt + func (t Tag) Has(opt Opt) bool + func (t Tag) HasAny(opt Opt) bool + type ValueDecoder interface + DecodeValue func(any) error + type ValueEncoder interface + EncodeValue func() (any, error)