convert

package module
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 3

README

go-convert

Simple transit from interface to standard GO types.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseFloat64Err added in v0.1.7

func BaseFloat64Err(in any, debugKeys ...string) (float64, error)

func Bool

func Bool(in any) bool

func BoolErr

func BoolErr(in any) (bool, error)

func CheckMapStringType

func CheckMapStringType(t any) (map[string]any, bool)

func Float32

func Float32(in any, debugKeys ...string) float32

func Float32Err

func Float32Err(in any, debugKeys ...string) (float32, error)

func Float64

func Float64(in any, debugKeys ...string) float64

func Float64Err

func Float64Err(in any, debugKeys ...string) (float64, error)

func Int

func Int(in any, debugKeys ...string) int

func Int32

func Int32(in any, debugKeys ...string) int32

func Int32Err

func Int32Err(in any, debugKeys ...string) (int32, error)

func Int64

func Int64(in any, debugKeys ...string) int64

func Int64Err

func Int64Err(in any, debugKeys ...string) (int64, error)

func ListOfInt32Err

func ListOfInt32Err(in any, checkLen bool, debugKeys ...string) ([]int32, error)

func ListOfInt64Err

func ListOfInt64Err(in any, checkLen bool, debugKeys ...string) ([]int64, error)

func ListOfStrings added in v0.0.3

func ListOfStrings(in any, debugKeys ...string) []string

func ListOfStringsErr added in v0.0.3

func ListOfStringsErr(in any, checkLen bool, debugKeys ...string) ([]string, error)

func ListOfStringsP added in v0.0.3

func ListOfStringsP(in any, debugKeys ...string) []string

ListOfStringsP ("List Of Strings Positive") is exactly the same as ListOfStringsPErr, but always returns a list (can be empty).

func ListOfStringsPErr added in v0.0.3

func ListOfStringsPErr(in any, checkLen bool, debugKeys ...string) ([]string, error)

ListOfStringsPErr ("List Of Strings Positive with Error") returns a list of no-empty strings extracted from the input interface. If the list contains an empty string, the function skips it. If checkLen is true and the result list is empty, the function returns an error.

func ListOfStringsStrictPErr added in v0.1.12

func ListOfStringsStrictPErr(in any, checkLen bool, debugKeys ...string) ([]string, error)

ListOfStringsStrictPErr ("List Of Strings Strict Positive with Error") returns a list of no-empty strings extracted from the input interface. If the list has empty string function returns the error.

func String

func String(in any, _ ...string) string

func StringTS added in v0.1.3

func StringTS(in any, debugKeys ...string) string

StringTS returns spaces trimmed string

func Uint32

func Uint32(in any, debugKeys ...string) uint32

func Uint32Err

func Uint32Err(in any, debugKeys ...string) (uint32, error)

func Uint64

func Uint64(in any, debugKeys ...string) uint64

func Uint64Err

func Uint64Err(in any, debugKeys ...string) (uint64, error)

Types

type It

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

func Iterator

func Iterator(i any, checkLen ...bool) (*It, error)

func (*It) Len

func (it *It) Len() int

func (*It) NextNotEmptyString

func (it *It) NextNotEmptyString() string

func (*It) NextNotNil

func (it *It) NextNotNil() any

func (*It) NextNotNilMapString

func (it *It) NextNotNilMapString() (map[string]any, bool)

type MapIt added in v0.1.1

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

func MapIterator added in v0.1.1

func MapIterator(i any, checkLen ...bool) (*MapIt, error)

func (*MapIt) HasNext added in v0.1.1

func (it *MapIt) HasNext() bool

func (*MapIt) Len added in v0.1.1

func (it *MapIt) Len() int

func (*MapIt) Next added in v0.1.1

func (it *MapIt) Next() (any, any)

type StringListRunner added in v0.1.12

type StringListRunner string
const (
	PassAll     StringListRunner = "pass_all"
	FallOnEmpty StringListRunner = "fall_on_empty"
	SkipEmpty   StringListRunner = "skip_empty"
)

Jump to

Keyboard shortcuts

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