convert

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Converters = map[string]func(text string) (interface{}, error){
	"string": func(text string) (interface{}, error) {
		return text, nil
	},
	"number": func(text string) (interface{}, error) {
		return strconv.ParseFloat(text, 64)
	},
	"bool": func(text string) (interface{}, error) {
		return strconv.ParseBool(text)
	},
	"timestamp": func(text string) (interface{}, error) {
		return strconv.ParseInt(text, 10, 64)
	},
	"int": func(text string) (interface{}, error) {
		return strconv.ParseInt(text, 10, 64)
	},
	"float": func(text string) (interface{}, error) {
		return strconv.ParseFloat(text, 64)
	},
}

Converters .

Functions

func Converter

func Converter(typ string) func(text string) (interface{}, error)

Converter .

Types

This section is empty.

Jump to

Keyboard shortcuts

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