reports

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetData

func GetData(queryID uint64) (string, error)

GetData returns the data for the provided QueryID

func LogEvent

func LogEvent(event Event) error

LogEvent adds an event to the eventQueue for later logging

func Shutdown

func Shutdown()

Shutdown stops the reports service

func Startup

func Startup()

Startup starts the reports service

Types

type Event

type Event struct {
	// Name - A human readable name for this event. (ie "session_new" is a new session event)
	Name string
	// Table - the DB table that this event modifies (or nil)
	Table string
	// SQLOp - the SQL operation needed to serialize the event to the DB
	// 1 - INSERT // 2 - UPDATE
	SQLOp int
	// The columns in the DB this inserts for INSERTS or qualifies if matches for UPDATES
	Columns map[string]interface{}
	// The columns to modify for UPDATE events
	ModifiedColumns map[string]interface{}
}

Event stores an arbitrary event

func CreateEvent

func CreateEvent(name string, table string, sqlOp int, columns map[string]interface{}, modifiedColumns map[string]interface{}) Event

CreateEvent creates an Event

type Query

type Query struct {
	ID   uint64
	Rows *sql.Rows
}

Query holds the results of a database query operation

func CreateQuery

func CreateQuery(reportEntry string) (*Query, error)

CreateQuery submits a database query and returns the results

Jump to

Keyboard shortcuts

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