db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTpl

func AddTpl(grpId, endpointId int, operateUser string) (error, m.TplTable)

func AddUser added in v1.0.1

func AddUser(user m.UserTable, creator string) error

func Aggregate

func Aggregate(data [][]float64, num int, method string) [][]float64

func CheckAggregate

func CheckAggregate(start int64, end int64, endpoint string, step, num int) int

func Classify

func Classify(obj interface{}, operation string, table string, force bool) string

func CloseAlarm

func CloseAlarm(id int) error

func CloseOpenAlarm added in v1.0.1

func CloseOpenAlarm(id int) error

func Default

func Default() *xorm.Engine

func DeleteCustomDashboard

func DeleteCustomDashboard(query *m.CustomDashboardTable) error

func DeleteEndpoint

func DeleteEndpoint(guid string) error

func DeleteStrategyByGrp added in v1.0.1

func DeleteStrategyByGrp(grpId int, tplId int) error

func DeleteTpl added in v1.0.1

func DeleteTpl(tplId int) error

func ExecuteTransactionSql

func ExecuteTransactionSql(sqls []string) error

func GetAlarms

func GetAlarms(query m.AlarmTable) (error, m.AlarmProblemList)

func GetBusinessList added in v1.0.1

func GetBusinessList(endpointId int) (err error, pathList []*m.BusinessMonitorTable)

func GetButton

func GetButton(bGroup int) (error, []*m.ButtonModel)

func GetCharts

func GetCharts(cGroup int, chartId int, panelId int) (error, []*m.ChartTable)

func GetCustomDashboard

func GetCustomDashboard(query *m.CustomDashboardTable) error

func GetDashboard

func GetDashboard(dType string) (error, m.DashboardTable)

func GetEndpoint

func GetEndpoint(query *m.EndpointTable) error

func GetEndpointMetric

func GetEndpointMetric(id int) (err error, result []*m.OptionModel)

func GetEndpointsByGrp

func GetEndpointsByGrp(grpId int) (error, []*m.EndpointTable)

func GetEndpointsByIp

func GetEndpointsByIp(ipList []string, exportType string) (err error, endpoints []m.EndpointTable)

func GetGrpStrategy added in v1.0.1

func GetGrpStrategy(idList []string) (err error, result []*m.GrpStrategyExportObj)

func GetLogMonitorByEndpoint

func GetLogMonitorByEndpoint(endpointId int) (err error, result []*m.LogMonitorTable)

func GetLogMonitorTable

func GetLogMonitorTable(id, strategyId, tplId int, path string) (err error, result []*m.LogMonitorTable)

func GetMainCustomDashboard

func GetMainCustomDashboard() (error, m.CustomDashboardTable)

func GetMaintainTable

func GetMaintainTable(endpointId int)

func GetOpenAlarm added in v1.0.1

func GetOpenAlarm() []*m.AlarmProblemQuery

func GetPanels

func GetPanels(pGroup int, endpoint string) (error, []*m.PanelTable)

func GetProcessList added in v1.0.1

func GetProcessList(endpointId int) (err error, processList []*m.ProcessMonitorTable)

func GetPromMetric

func GetPromMetric(endpoint []string, metric string) (error, string)

func GetPromMetricTable

func GetPromMetricTable(metricType string) (err error, result []*m.PromMetricTable)

func GetSearch

func GetSearch(id int) (error, m.SearchModel)

func GetSingleGrp

func GetSingleGrp(id int, name string) (error, m.GrpTable)

func GetStrategy

func GetStrategy(param m.StrategyTable) (error, m.StrategyTable)

func GetStrategyTable

func GetStrategyTable(id int) (error, m.StrategyTable)

func GetStrategys

func GetStrategys(query *m.TplQuery, ignoreLogMonitor bool) error

func GetTags

func GetTags(endpoint string, key string, metric string) (error, []*m.OptionModel)

func GetTpl

func GetTpl(tplId, grpId, endpointId int) (error, m.TplTable)

func GetUser added in v1.0.1

func GetUser(username string) (err error, user m.UserTable)

func InTransaction

func InTransaction(callback dbTransactionFunc) error

func InitDbConn

func InitDbConn()

func ListAlarmEndpoints

func ListAlarmEndpoints(query *m.AlarmEndpointQuery) error

func ListCustomDashboard

func ListCustomDashboard() (err error, result []*m.CustomDashboardTable)

func ListGrp

func ListGrp(query *m.GrpQuery) error

func ListLogMonitor

func ListLogMonitor(query *m.TplQuery) error

func RegisterEndpointMetric

func RegisterEndpointMetric(endpointId int, endpointMetrics []string) error

func SaveCustomDashboard

func SaveCustomDashboard(query *m.CustomDashboardTable) error

func SaveOpenAlarm added in v1.0.1

func SaveOpenAlarm(param m.OpenAlarmRequest) error

func SearchGrp

func SearchGrp(search string) (error, []*m.OptionModel)

func SearchHost

func SearchHost(endpoint string) (error, []*m.OptionModel)

func SetGrpStrategy added in v1.0.1

func SetGrpStrategy(paramObj []*m.GrpStrategyExportObj) error

func SetMainCustomDashboard

func SetMainCustomDashboard(id int) error

func Transaction

func Transaction(actions []*Action) error

func UpdateAlarms

func UpdateAlarms(alarms []*m.AlarmTable) error

func UpdateBusiness added in v1.0.1

func UpdateBusiness(param m.BusinessUpdateDto) error

func UpdateEndpoint

func UpdateEndpoint(endpoint *m.EndpointTable) error

func UpdateEndpointAlarmFlag added in v1.0.1

func UpdateEndpointAlarmFlag(isStop bool, exportType, instance, ip, port string) error

func UpdateGrp

func UpdateGrp(obj *m.UpdateGrp) error

func UpdateGrpEndpoint

func UpdateGrpEndpoint(param m.GrpEndpointParamNew) (error, bool)

func UpdateLogMonitor

func UpdateLogMonitor(obj *m.UpdateLogMonitor) error

func UpdateProcess added in v1.0.1

func UpdateProcess(param m.ProcessUpdateDto) error

func UpdatePromMetric

func UpdatePromMetric(data []m.PromMetricTable) error

func UpdateStrategy

func UpdateStrategy(obj *m.UpdateStrategy) error

func UpdateTpl

func UpdateTpl(tplId int, operateUser string) error

func UpdateUser added in v1.0.1

func UpdateUser(user m.UserTable) error

Types

type Action

type Action struct {
	Sql   string
	Param []interface{}
}

type DBObj

type DBObj struct {
	DbType   string
	ConnUser string
	ConnPwd  string
	ConnHost string
	ConnDb   string
	ConnPtl  string
	MaxIdle  int
	MaxOpen  int
	Timeout  int
	// contains filtered or unexported fields
}

func (*DBObj) InitXorm

func (d *DBObj) InitXorm()

Jump to

Keyboard shortcuts

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