structify

package
v0.0.0-...-f0e227c Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapStructifier

type MapStructifier = func(map[string]interface{}) (interface{}, error)

func MakeMapStructifier

func MakeMapStructifier(t reflect.Type, tag string, initer func(any)) MapStructifier

MakeMapStructifier builds a function which parses a map's string values into a new struct of type t and returns a pointer to it. tag specifies which tag connects struct fields to map keys. MakeMapStructifier panics if it detects an unsupported type (suitable for usage in init() or global vars).

Jump to

Keyboard shortcuts

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