func Bool(valuea ...interface{}) bool
Bool returns a boolean value. It mainly depends on the output of strconv.ParseBool, but also checks for integer values.
▹ Example
func Bytes(valuea ...interface{}) []byte
Bytes returns a slice of bytes.
▹ Example
func DBType(str string) string
DBType returns a Database Type of a string.
func DBTypeMultiple(val []string) string
DBTypeMultiple returns the lowest common denominator of a type for all inserted DBTypes
func Duration(valuea ...interface{}) time.Duration
Duration converts input values to time.Duration. It mainly depends on time.ParseDuration.
func FixedLengthAfter(str string, spacer string, length int) string
FixedLengthAfter appends spacer chars after a string
func FixedLengthBefore(str string, spacer string, length int) string
FixedLengthBefore prepends spacer chars before a string
func FixedLengthCenter(str string, spacer string, length int) string
FixedLengthCenter adds spacer chars after and before a string
func Float(valuea ...interface{}) float64
Float converts it's input to type float64. int, uint and float gets converted as expected, time is transformed to a float of the corresponding timestamp. strings and byte slices gets converted via strconv.ParseFloat.
func FloatFromXString(valuea ...string) float64
FloatFromXString converts strings to float64. Most values can be converted to float via Float(), but floats as strings in e.g. german spelling should be converted with this function.
func Int(valuea ...interface{}) int64
Int returns an int64 of the input value. Float values and float values in strings will be rounded via "round half towards positive infinity". strings get converted via strconv.ParseFloat.
func String(valuea ...interface{}) string
String converts input values to string. Time and Duration gets converted via standard functions. Most types gets "converted" via fmt.Sprintf.
▹ Example
func Time(valuea ...interface{}) time.Time
Time converts inputs values to time.Time. Time formats in the variable timeformats can be used.
▹ Example
func Trimmed(valuea ...interface{}) string
Trimmed takes the first given value, converts it to a string, trims the whitespace an returns it.
func Type(valuea ...interface{}) (string, error)
Type returns a type (string) of a string.
▹ Example
▹ Example (Json)
func Uint(valuea ...interface{}) uint64
Uint returns an uint64 of the input value. Float values and float values in strings will be rounded via "round half towards positive infinity". strings get converted via strconv.ParseFloat.
type Dynamic struct { Type string Data interface{} }
func (d *Dynamic) UnmarshalJSON(buf []byte) error
UnmarshalJSON implements json.Unmarshaler inferface for the Dynamic Type.
type Int64 int64
func (i Int64) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface for the Int64 Type.
func (i *Int64) UnmarshalJSON(buf []byte) error
UnmarshalJSON implements json.Unmarshaler inferface for the Int64 Type.