pki

package
v0.0.0-...-f65740e Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(db *sqlx.DB, tableName string, params map[string]string) error

CreateTable creates a new table defined by a given name and specified column fields. CreateTable returns an error if a table could not be correctly created or when an SQL injection attacks was detected.

func InsertIntoTable

func InsertIntoTable(db *sqlx.DB, tableName string, id, typ string, config []byte) error

InsertIntoTable allows to insert a new record into the specified table. The table name is checked for SQL injection attacks. The given input values are not explicitly checked, since the Exec build-in function should do this. The function returns an error if an SQL injection attack is detected or when insertion fails.

func OpenDatabase

func OpenDatabase(dataSourceName, dbDriver string) (*sqlx.DB, error)

OpenDatabase opens a connection with a specified database. OpenDatabase returns the database object and an error.

func QueryDatabase

func QueryDatabase(db *sqlx.DB, tableName string, condition string) (*sqlx.Rows, error)

QueryDatabase allows to query for records from a specified table, which Typ column satisfies a given condition. QueryDatabase checks for SQL injection in the tableName argument or condition argument. QueryDatabase returns a set of rows and an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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