Documentation ¶
Overview ¶
Package util contains utility functions that are used in dirrent places of the codebase.
Index ¶
- Variables
- func AddExtraSpaceIfExist(str string) string
- func ColumnAsArray(columns []string, values ...interface{}) (results [][]interface{})
- func EqualAsString(a interface{}, b interface{}) bool
- func GetInterfaceAsSQL(value interface{}) (string, error)
- func GetValueFromFields(value reflect.Value, fieldNames []string) (results []interface{})
- func IsBlank(value reflect.Value) bool
- func MakeSlice(elemType reflect.Type) interface{}
- func ToDBName(name string) string
- func ToQueryMarks(primaryValues [][]interface{}) string
- func ToQueryValues(values [][]interface{}) (results []interface{})
- func ToSearchableMap(attrs ...interface{}) (result interface{})
- func ToString(str interface{}) string
- func WrapTX(tx string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var B *bpool.BufferPool
Functions ¶
func AddExtraSpaceIfExist ¶
AddExtraSpaceIfExist adds an extra space at the beginning of the string if the string is not empty.
func ColumnAsArray ¶
func ColumnAsArray(columns []string, values ...interface{}) (results [][]interface{})
ColumnAsArray returns an array of column values
func EqualAsString ¶
func EqualAsString(a interface{}, b interface{}) bool
func GetInterfaceAsSQL ¶
GetInterfaceAsSQL returns sql value representation of the value.
func GetValueFromFields ¶
GetValueFromFields return given fields's value
func ToQueryMarks ¶
func ToQueryMarks(primaryValues [][]interface{}) string
func ToQueryValues ¶
func ToQueryValues(values [][]interface{}) (results []interface{})
func ToSearchableMap ¶
func ToSearchableMap(attrs ...interface{}) (result interface{})
ToSearchableMap transform attrs to a map.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.