utils

package
v0.0.0-...-d9d72d2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToInt64

func ByteToInt64(data []byte) int64

func CallMethod

func CallMethod(method reflect.Value, args []reflect.Value) []interface{}

func ClearTable

func ClearTable(db *sql.DB, tableName string) error

func CreateTable

func CreateTable(db *sql.DB, tableName string, columns []string, tableConstraints ...string) error

func DeleteById

func DeleteById(db *sql.DB, tableName string, id int64) error

func FormatSqlValue

func FormatSqlValue(value interface{}) string

func GetMethod

func GetMethod(i interface{}, methodName string) reflect.Value

func GetParamType

func GetParamType(method reflect.Value, paramIndex int) (bool, reflect.Type)

func ID2String

func ID2String(id int64) string

func InsertRow

func InsertRow(db *sql.DB, tableName string, args ...interface{}) error

func JsonNumberToInt

func JsonNumberToInt(value interface{}) (int, error)

func JsonNumberToInt64

func JsonNumberToInt64(value interface{}) (int64, error)

func RandAlnum

func RandAlnum(n int) string

func RandAlpha

func RandAlpha(n int) string

func RandDigits

func RandDigits(n int) string

func RandSeq

func RandSeq(chars string, n int) string

func SendJsonError

func SendJsonError(rw http.ResponseWriter, value interface{}, code int)

func SendJsonResponse

func SendJsonResponse(rw http.ResponseWriter, value interface{})

func String2ID

func String2ID(strid string) int64

func UUIDGen

func UUIDGen() int64

func UpdateRows

func UpdateRows(db *sql.DB, tableName string, whereClause string, args ...interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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