gapr

package module
v0.0.0-...-f7ec3e8 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 7 Imported by: 0

README

gapr

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupportedType = errors.New("input is not a supported type")
	ErrNotStringKey     = errors.New("key type is not string - not supported right now")
)
View Source
var (
	LowercaseKeyMapper KeyMapper = KeyMapperFunc(func(orig string) string {
		return strings.ToLower(orig)
	})

	UppercaseKeyMapper KeyMapper = KeyMapperFunc(func(orig string) string {
		return strings.ToUpper(orig)
	})

	CamelCaseKeyMapper = genericFirstKeyMapper(unicode.ToLower)

	PascalCaseKeyMapper = genericFirstKeyMapper(unicode.ToUpper)
)

Functions

func WithMapper

func WithMapper(mapper KeyMapper) optionFunc

func WithRandomSeed

func WithRandomSeed(i int64) optionFunc

func WithTagName

func WithTagName(tag string) optionFunc

Types

type Gapr

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

func New

func New(opts ...Option) *Gapr

func (*Gapr) Map

func (g *Gapr) Map(input any) (any, error)

type KeyMapper

type KeyMapper interface {
	MapKey(orig string) string
}

type KeyMapperFunc

type KeyMapperFunc func(orig string) string

func (KeyMapperFunc) MapKey

func (f KeyMapperFunc) MapKey(orig string) string

type Option

type Option interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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