Documentation ¶
Index ¶
- func AddAgent(database *sql.DB, agentId string, path string) error
- func AgentIDExists(database *sql.DB, agentId string) bool
- func CreateDB(dbName string) (*sql.DB, error)
- func GetAgents(database *sql.DB) []string
- func GetCustomMetricNames(database *sql.DB) []string
- func GetDBPathForAgent(database *sql.DB, agentId string) string
- func GetLogFromDB(database *sql.DB, logType string, from int64, to int64, time int64) []string
- func GetLogFromDBCount(database *sql.DB, logType string, count int64) []string
- func OpenDB(db *sql.DB, path string) (*sql.DB, error)
- func RemoveAgent(database *sql.DB, agentId string) error
- func SaveLogToDB(database *sql.DB, unixTime string, jsonStr string, logType string) error
- type MySql
- func (mysql *MySql) AddAgent(agentId string, timezone string) error
- func (mysql *MySql) AgentIDExists(agentId string) bool
- func (mysql *MySql) Close()
- func (mysql *MySql) Connect(user string, password string, host string, database string, ...)
- func (mysql *MySql) GetAgents() []string
- func (mysql *MySql) GetCustomMetricNames(serverName string) []string
- func (mysql *MySql) GetLogFromDB(serverName string, logType string, from int64, to int64, time int64) []string
- func (mysql *MySql) GetLogFromDBCount(serverId string, logType string, count int64) []string
- func (mysql *MySql) Init() error
- func (mysql *MySql) RemoveAgent(agentId string) error
- func (mysql *MySql) SaveLogToDB(serverName string, unixTime string, jsonStr string, logType string) error
- func (mysql *MySql) Select(query string, args ...interface{}) (Table, error)
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentIDExists ¶
AgenIDExists checks if agent is added to the db
func GetCustomMetricNames ¶
func GetDBPathForAgent ¶
GetDBPathForAgent returns the db path of the given agent
func GetLogFromDB ¶
GetLogFromDB returns log records of the given log type in the given time/range
func GetLogFromDBCount ¶
GetLogFromDBCount returns log records of the given log type
func RemoveAgent ¶
RemoveAgent removes agent info
Types ¶
type MySql ¶ added in v0.0.22
type MySql struct { DB *sql.DB SqlErr error Connected bool User string Host string Database string }
func (*MySql) AgentIDExists ¶ added in v0.0.22
func (*MySql) GetCustomMetricNames ¶ added in v0.0.22
func (*MySql) GetLogFromDB ¶ added in v0.0.22
func (*MySql) GetLogFromDBCount ¶ added in v0.0.22
func (*MySql) RemoveAgent ¶ added in v0.0.22
func (*MySql) SaveLogToDB ¶ added in v0.0.22
Click to show internal directories.
Click to hide internal directories.