util

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package util contains utility functions that are used in dirrent places of the codebase.

Index

Constants

This section is empty.

Variables

Functions

func AddExtraSpaceIfExist

func AddExtraSpaceIfExist(str string) string

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

func GetInterfaceAsSQL(value interface{}) (string, error)

GetInterfaceAsSQL returns sql value representation of the value.

func GetValueFromFields

func GetValueFromFields(value reflect.Value, fieldNames []string) (results []interface{})

GetValueFromFields return given fields's value

func IsBlank

func IsBlank(value reflect.Value) bool

IsBlank returns true if the value represent a zero value of the specified value ype.

func MakeSlice

func MakeSlice(elemType reflect.Type) interface{}

func ToDBName

func ToDBName(name string) string

ToDBName convert string to db name

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.

func ToString

func ToString(str interface{}) string

func WrapTX

func WrapTX(tx string) string

WrapTX returnstx intranstaction block

Types

This section is empty.

Jump to

Keyboard shortcuts

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