util

package
v9.10.2-0...-7114063 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSliceElement

func AppendSliceElement(slice, val reflect.Value)

AppendSliceElement will append val to slice. Handles slice of pointers and not pointers. Val needs to be a pointer.

func AssignStructVals

func AssignStructVals(i interface{}, rd rowData, cm ColumnMap)

AssignStructVals will assign the data from rd to i.

func GetSliceElementType

func GetSliceElementType(val reflect.Value) reflect.Type

GetSliceElementType returns the type for a slices elements.

func GetTypeInfo

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

func IsBool

func IsBool(k reflect.Kind) bool

func IsEmptyValue

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

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

func SafeSetFieldByIndex

func SafeSetFieldByIndex(v reflect.Value, fieldIndex []int, src interface{}) (result reflect.Value)

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

func (ColumnMap) Merge

func (cm ColumnMap) Merge(colMaps []ColumnMap) ColumnMap

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