dal

package
v0.0.0-...-a4a1dc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SQL_CATEGORY_BYNAME = `SELECT id, description
	FROM category
	WHERE description = :desc`
)
View Source
const (
	SQL_DEVICE_BYSERIAL = `SELECT id, name, serial
	FROM device
	WHERE serial = :serial`
)
View Source
const (
	SQL_FILE_BYDATE = `SELECT id, begin_dt, end_dt, count_lines
	FROM file
	WHERE begin_dt = :begin`
)
View Source
const (
	SQL_HOST_BYNAME = `SELECT id, name, category
	FROM host
	WHERE name = :name`
)
View Source
const (
	SQL_LOGLEVEL_BYDESC = `SELECT id, name
	FROM loglevel
	WHERE name = :name`
)
View Source
const (
	SQL_LOGTYPE_BYNAME = `SELECT id, level1, level2
	FROM logtype
	WHERE level1 = :level1 AND level2 = :level2`
)
View Source
const (
	SQL_PROFILE_BYNAME = `SELECT id, name
	FROM profile
	WHERE name = :name`
)
View Source
const (
	SQL_SERVICE_BYNAME = `SELECT id, name
	FROM service
	WHERE name = :name`
)
View Source
const (
	SQL_USER_BYNAME = `SELECT id, name
	FROM user
	WHERE name = :name`
)
View Source
const (
	SQL_UTMSTATUS_BYNAME = `SELECT id, name
	FROM utmstatus
	WHERE name = :name`
)

Variables

This section is empty.

Functions

func GetCategoryByDescription

func GetCategoryByDescription(
	txn *gorp.Transaction,
	desc string) (*models.Category, error)

func GetDeviceBySerial

func GetDeviceBySerial(txn *gorp.Transaction, serial string) (*models.Device, error)

func GetFileByDate

func GetFileByDate(
	txn *gorp.Transaction,
	begin time.Time) (*models.File, error)

func GetHostByName

func GetHostByName(
	txn *gorp.Transaction,
	name string) (*models.Host, error)

func GetLoglevelByName

func GetLoglevelByName(
	txn *gorp.Transaction,
	name string) (*models.LogLevel, error)

func GetLogtypeByNames

func GetLogtypeByNames(
	txn *gorp.Transaction,
	level1, level2 string) (*models.LogType, error)

func GetOrInsertByUnique

func GetOrInsertByUnique(
	txn *gorp.Transaction,
	query string,
	qrows interface{},
	unique map[string]interface{},
	insert func() interface{}) (interface{}, error)

func GetOrInsertCategoryByDescription

func GetOrInsertCategoryByDescription(
	txn *gorp.Transaction,
	desc string) (*models.Category, error)

func GetOrInsertDeviceBySerial

func GetOrInsertDeviceBySerial(
	txn *gorp.Transaction,
	serial, device string) (*models.Device, error)

func GetOrInsertHostByName

func GetOrInsertHostByName(
	txn *gorp.Transaction,
	name string,
	category *models.Category) (*models.Host, error)

func GetOrInsertLogtypeByNames

func GetOrInsertLogtypeByNames(
	txn *gorp.Transaction,
	level1, level2 string) (*models.LogType, error)

func GetOrInsertProfileByName

func GetOrInsertProfileByName(
	txn *gorp.Transaction,
	name string) (*models.Profile, error)

func GetOrInsertServiceByName

func GetOrInsertServiceByName(
	txn *gorp.Transaction,
	name string) (*models.Service, error)

func GetOrInsertUserByName

func GetOrInsertUserByName(
	txn *gorp.Transaction,
	name string) (*models.User, error)

func GetProfileByName

func GetProfileByName(txn *gorp.Transaction, name string) (*models.Profile, error)

func GetRowByUnique

func GetRowByUnique(
	txn *gorp.Transaction,
	query string,
	qrows interface{},
	unique map[string]interface{}) (interface{}, error)

func GetServiceByName

func GetServiceByName(txn *gorp.Transaction, name string) (*models.Service, error)

func GetUserByName

func GetUserByName(txn *gorp.Transaction, name string) (*models.User, error)

func GetUtmstatusByName

func GetUtmstatusByName(
	txn *gorp.Transaction,
	name string) (*models.UtmStatus, error)

func MakeGenericSlice

func MakeGenericSlice(slice interface{}) []interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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