util

package
v8.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignStructVals

func AssignStructVals(i interface{}, results []rowData, cm ColumnMap)

func GetTypeInfo

func GetTypeInfo(i interface{}, val reflect.Value) (reflect.Type, reflect.Kind, bool)

func IsBool

func IsBool(k reflect.Kind) bool

func IsEmptyValue added in v8.1.0

func IsEmptyValue(v reflect.Value) bool

func IsFloat

func IsFloat(k reflect.Kind) bool

func IsInt

func IsInt(k reflect.Kind) bool

func IsInvalid

func IsInvalid(k reflect.Kind) bool

func IsPointer

func IsPointer(k reflect.Kind) bool

func IsSlice

func IsSlice(k reflect.Kind) bool

func IsString

func IsString(k reflect.Kind) bool

func IsStruct

func IsStruct(k reflect.Kind) bool

func IsUint

func IsUint(k reflect.Kind) bool

func SafeGetFieldByIndex added in v8.2.0

func SafeGetFieldByIndex(v reflect.Value, fieldIndex []int) (result reflect.Value, isAvailable bool)

func SetColumnRenameFunction

func SetColumnRenameFunction(newFunction func(string) string)

Types

type ColumnData

type ColumnData struct {
	ColumnName     string
	FieldIndex     []int
	ShouldInsert   bool
	ShouldUpdate   bool
	DefaultIfEmpty bool
	GoType         reflect.Type
}

type ColumnMap

type ColumnMap map[string]ColumnData

func GetColumnMap

func GetColumnMap(i interface{}) (ColumnMap, error)

func (ColumnMap) Cols

func (cm ColumnMap) Cols() []string

type ValueSlice

type ValueSlice []reflect.Value

func (ValueSlice) Equal

func (vs ValueSlice) Equal(other ValueSlice) bool

func (ValueSlice) Len

func (vs ValueSlice) Len() int

func (ValueSlice) Less

func (vs ValueSlice) Less(i, j int) bool

func (ValueSlice) String

func (vs ValueSlice) String() string

func (ValueSlice) Swap

func (vs ValueSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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