util

package
v0.0.0-...-ab40c3c Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

BytesToString converts zero terminated byte array to string Whole array is used when there is no zero in the string

func CheckTxIsolation

func CheckTxIsolation(tx *sql.Tx, level string) error

CheckTxIsolation return nil if transaction isolation is "level"

func ExecSQL

func ExecSQL(d *sql.DB, query string, param ...interface{}) error

ExecSQL executes SQL query

func HTTPGet

func HTTPGet(url string) (body []byte, err error)

HTTPGet helper which returns response as a byte array

func HTTPPostJSON

func HTTPPostJSON(url string, body string) error

HTTPPostJSON posts given JSON message to give URL

func QueryRowSQL

func QueryRowSQL(d *sql.DB, query string, param ...interface{}) *sql.Row

QueryRowSQL executes SQL query which return single row

func QuerySQL

func QuerySQL(d *sql.DB, query string, param ...interface{}) (*sql.Rows, error)

QuerySQL executes SQL query

Types

This section is empty.

Jump to

Keyboard shortcuts

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