converter

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT, Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ArrayBool    = reflect.Bool + array
	ArrayInt     = reflect.Int + array
	ArrayInt8    = reflect.Int8 + array
	ArrayInt16   = reflect.Int16 + array
	ArrayInt32   = reflect.Int32 + array
	ArrayInt64   = reflect.Int64 + array
	ArrayUint    = reflect.Uint + array
	ArrayUint8   = reflect.Uint8 + array
	ArrayUint16  = reflect.Uint16 + array
	ArrayUint32  = reflect.Uint32 + array
	ArrayUint64  = reflect.Uint64 + array
	ArrayFloat32 = reflect.Float32 + array
	ArrayFloat64 = reflect.Float64 + array
	ArrayString  = reflect.String + array
)
View Source
const (
	SliceBool    = reflect.Bool + slice
	SliceInt     = reflect.Int + slice
	SliceInt8    = reflect.Int8 + slice
	SliceInt16   = reflect.Int16 + slice
	SliceInt32   = reflect.Int32 + slice
	SliceInt64   = reflect.Int64 + slice
	SliceUint    = reflect.Uint + slice
	SliceUint8   = reflect.Uint8 + slice
	SliceUint16  = reflect.Uint16 + slice
	SliceUint32  = reflect.Uint32 + slice
	SliceUint64  = reflect.Uint64 + slice
	SliceFloat32 = reflect.Float32 + slice
	SliceFloat64 = reflect.Float64 + slice
	SliceString  = reflect.String + slice
)

Variables

This section is empty.

Functions

func CastInt64

func CastInt64(v any) int64

func String

func String(value reflect.Value) string

func StringConvert

func StringConvert(kind reflect.Kind, value string) (any, error)

func StringConvertBool added in v0.3.0

func StringConvertBool(value string) (bool, error)

func StringConvertFloat32 added in v0.3.0

func StringConvertFloat32(value string) (float32, error)

func StringConvertFloat64 added in v0.3.0

func StringConvertFloat64(value string) (float64, error)

func StringConvertFor

func StringConvertFor[T any](value string) (T, error)

func StringConvertIntFor added in v0.3.0

func StringConvertIntFor[T constraints.Signed](value string) (T, error)

func StringConvertNumberFor added in v0.3.0

func StringConvertNumberFor[T constraintsi.Number](value string) (T, error)

func StringConvertUintFor added in v0.3.0

func StringConvertUintFor[T constraints.Unsigned](value string) (T, error)

func StringFor

func StringFor[T any](t T) string

Types

type StringConverter

type StringConverter func(string) any

func GetStringConverter added in v0.3.0

func GetStringConverter(kind reflect.Kind) StringConverter

type StringConverterE

type StringConverterE func(string) (any, error)

func GetStringConverterE added in v0.3.0

func GetStringConverterE(kind reflect.Kind) StringConverterE

func (StringConverterE) IgnoreError added in v0.3.0

func (c StringConverterE) IgnoreError() StringConverter

Jump to

Keyboard shortcuts

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