database

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAgent

func AddAgent(database *sql.DB, agentId string, path string) error

AddAgent adds the agent to the given DB

func AgentIDExists

func AgentIDExists(database *sql.DB, agentId string) bool

AgenIDExists checks if agent is added to the db

func CreateDB

func CreateDB(dbName string) (*sql.DB, error)

CreateDB create and return SQLite DB

func GetAgents

func GetAgents(database *sql.DB) []string

func GetClientKey

func GetClientKey(clientId string) string

func GetCustomMetricNames

func GetCustomMetricNames(database *sql.DB) []string

func GetDBPathForAgent

func GetDBPathForAgent(database *sql.DB, agentId string) string

GetDBPathForAgent returns the db path of the given agent

func GetLogFromDB

func GetLogFromDB(database *sql.DB, logType string, from int64, to int64, time int64) []string

GetLogFromDB returns log records of the given log type in the given time/range

func GetLogFromDBCount

func GetLogFromDBCount(database *sql.DB, logType string, count int64) []string

GetLogFromDBCount returns log records of the given log type

func OpenDB

func OpenDB(db *sql.DB, path string) (*sql.DB, error)

OpenDB opens a SQLite DB file

func RemoveAgent

func RemoveAgent(database *sql.DB, agentId string) error

RemoveAgent removes agent info

func SaveLogToDB

func SaveLogToDB(database *sql.DB, unixTime string, jsonStr string, logType string) error

SaveLogToDB saves given monitor log to the sqlite DB

Types

This section is empty.

Jump to

Keyboard shortcuts

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