db

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ArchiveEnable bool
)

Functions

func AddBusinessTable added in v1.8.0

func AddBusinessTable(param m.BusinessUpdateDto) error

func AddCustomMetric added in v1.3.0

func AddCustomMetric(param m.TransGatewayMetricDto) error

func AddDbMonitor added in v1.5.4

func AddDbMonitor(param m.DbMonitorUpdateDto) error

func AddKubernetesCluster added in v1.7.0

func AddKubernetesCluster(param m.KubernetesClusterParam) error

func AddKubernetesPod added in v1.11.0

func AddKubernetesPod(cluster *m.KubernetesClusterTable, podGuid, podName, namespace string) (err error, id int64, endpointGuid string)

func AddTpl

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

func AddUser added in v1.0.1

func AddUser(user m.UserTable) error

func Aggregate

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

func AutoUpdateLogMonitor added in v1.6.0

func AutoUpdateLogMonitor(obj *m.UpdateLogMonitor) error

func ChartCreate added in v1.11.1

func ChartCreate(param []*models.ChartTable) error

func ChartDelete added in v1.11.1

func ChartDelete(ids []string) error

func ChartList added in v1.11.1

func ChartList(id, groupId int) (result []*models.ChartTable, err error)

func ChartUpdate added in v1.11.1

func ChartUpdate(param []*models.ChartTable) error

func CheckAggregate

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

func CheckDbMonitor added in v1.5.4

func CheckDbMonitor(param m.DbMonitorUpdateDto) error

func CheckEndpointActiveAlert added in v1.8.0

func CheckEndpointActiveAlert(endpoint string) bool

func CheckEndpointBusiness added in v1.4.0

func CheckEndpointBusiness(endpoint string) bool

func CheckLogKeyword added in v1.5.4

func CheckLogKeyword()

func CheckNodeExporterProcessConfig added in v1.5.4

func CheckNodeExporterProcessConfig(endpointId int, processList []m.ProcessMonitorTable) (err error, illegal bool, msg string)

func CheckRoleList added in v1.3.0

func CheckRoleList(param string) string

func CloseAlarm

func CloseAlarm(id int) error

func CloseOpenAlarm added in v1.0.1

func CloseOpenAlarm(id int) error

func CompareSubData added in v1.5.1

func CompareSubData(data [][]float64, sub float64) [][]float64

func DeleteCustomDashboard

func DeleteCustomDashboard(query *m.CustomDashboardTable) error

func DeleteDbMonitor added in v1.5.4

func DeleteDbMonitor(id int) error

func DeleteEndpoint

func DeleteEndpoint(guid string) error

func DeleteKubernetesCluster added in v1.7.0

func DeleteKubernetesCluster(id int, clusterName string) error

func DeleteKubernetesPod added in v1.11.0

func DeleteKubernetesPod(podGuid, endpointGuid string) (err error, id int64)

func DeletePromMetric added in v1.11.1

func DeletePromMetric(metric string) (tplIds []int, err error)

func DeleteRecursivePanel added in v1.2.0

func DeleteRecursivePanel(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 DoCheckProgress added in v1.5.2

func DoCheckProgress() error

func GetAgentManager added in v1.5.0

func GetAgentManager(guid string) (result []*m.AgentManagerTable, err error)

func GetAlarmEvent added in v1.3.0

func GetAlarmEvent(alarmType, inputGuid string, id int, alarmStatus string) (result m.AlarmEntityObj, err error)

func GetAlarms

func GetAlarms(query m.AlarmTable, limit int, extLogMonitor, extOpenAlarm bool) (error, m.AlarmProblemList)

func GetAlertWindowList added in v1.8.0

func GetAlertWindowList(endpoint string) (result []*m.AlertWindowObj, err error)

func GetAliveCheckQueue added in v1.5.2

func GetAliveCheckQueue(param string) (err error, result []*m.AliveCheckQueueTable)

func GetArchiveData added in v1.5.2

func GetArchiveData(query *m.QueryMonitorData, agg string) (err error, step int, result []*m.SerialModel)

func GetAutoDisplay added in v1.5.4

func GetAutoDisplay(businessMonitorMap map[int][]string, tagKey string, charts []*m.ChartTable) (result []*m.ChartModel, fetch bool)

func GetBusinessList added in v1.0.1

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

func GetBusinessListNew added in v1.8.0

func GetBusinessListNew(endpointId int, ownerEndpoint string) (err error, result m.BusinessUpdateDto)

func GetBusinessPanelChart added in v1.4.0

func GetBusinessPanelChart() (charts []*m.ChartTable, panels []*m.PanelTable)

func GetBusinessPromMetric added in v1.8.0

func GetBusinessPromMetric(keys []string) (err error, result []*m.PromMetricTable)

func GetBusinessRealEndpoint added in v1.8.0

func GetBusinessRealEndpoint(endpoint string) string

func GetButton

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

func GetChartTitle added in v1.4.0

func GetChartTitle(metric string, id int) string

func GetCharts

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

func GetCheckProgressContent added in v1.5.2

func GetCheckProgressContent(param string) m.AlarmEntityObj

func GetCoreEventList added in v1.3.0

func GetCoreEventList() (result m.CoreProcessResult, err error)

func GetCustomDashboard

func GetCustomDashboard(query *m.CustomDashboardTable) error

func GetCustomDashboardAlarms added in v1.6.0

func GetCustomDashboardAlarms(id int) (err error, result m.AlarmProblemQueryResult)

func GetCustomDashboardRole added in v1.6.0

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

func GetDashboard

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

func GetDashboardPanelList added in v1.10.0

func GetDashboardPanelList(endpointType, searchMetric string) m.PanelResult

func GetDbMonitorByPanel added in v1.5.4

func GetDbMonitorByPanel(guid string) (result []*m.DbMonitorTable, err error)

func GetDbMonitorChart added in v1.5.4

func GetDbMonitorChart() (result []*m.ChartTable, err error)

func GetDbPromMetric added in v1.5.4

func GetDbPromMetric(endpoint, metric, legend string) (error, string)

func GetEndpoint

func GetEndpoint(query *m.EndpointTable) error

func GetEndpointByType added in v1.11.1

func GetEndpointByType(endpointType string) (result []*models.EndpointTable, err error)

func GetEndpointMetric

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

func GetEndpointMetricByEndpointType added in v1.11.1

func GetEndpointMetricByEndpointType(endpointType string) (err error, result []*m.OptionModel)

func GetEndpointTelnet added in v1.4.0

func GetEndpointTelnet(guid string) (result []*m.EndpointTelnetTable, err error)

func GetEndpointTypeList added in v1.11.1

func GetEndpointTypeList() (result []string, err error)

func GetEndpointsByGrp

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

func GetEndpointsByIp

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

func GetGrpRole added in v1.3.0

func GetGrpRole(grpId int) (err error, result []*m.OptionModel)

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 GetLogMonitorByEndpointNew added in v1.5.4

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

func GetLogMonitorTable

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

func GetMailByEndpointGroup added in v1.5.4

func GetMailByEndpointGroup(guid string) []string

func GetMailByStrategy added in v1.1.0

func GetMailByStrategy(strategyId int) []string

func GetMainCustomDashboard

func GetMainCustomDashboard(roleList []string) (err error, result []*m.CustomDashboardTable)

func GetOpenAlarm added in v1.0.1

func GetOpenAlarm(param m.CustomAlarmQueryParam) []*m.AlarmProblemQuery

func GetOrgCallback added in v1.3.0

func GetOrgCallback(guid string) (result m.PanelRecursiveTable, err error)

func GetOrgConnect added in v1.5.0

func GetOrgConnect(guid string) (result m.UpdateOrgConnectParam, err error)

func GetOrgEndpoint added in v1.3.0

func GetOrgEndpoint(guid string) (result []*m.OptionModel, err error)

func GetOrgRole added in v1.3.0

func GetOrgRole(guid string) (result []*m.OptionModel, err error)

func GetOrganizationList added in v1.3.0

func GetOrganizationList(nameText, endpointText string) (result []*m.OrganizationPanel, err error)

func GetPanels

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

func GetParentTpl added in v1.3.0

func GetParentTpl(tplId int) []int

func GetPingExporterSource added in v1.4.0

func GetPingExporterSource() []*m.PingExportSourceObj

func GetProcessDisplayMap added in v1.5.4

func GetProcessDisplayMap(endpoint string) map[string]string

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.PromMetricUpdateParam)

func GetRecursivePanel added in v1.2.0

func GetRecursivePanel(guid string) (err error, result m.RecursivePanelObj)

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.UserQuery)

func GetUserRole added in v1.6.0

func GetUserRole(user string) (err error, result []*m.RoleTable)

func InTransaction

func InTransaction(callback dbTransactionFunc) error

func InitDbConn

func InitDbConn()

func InitPrometheusConfigFile added in v1.11.1

func InitPrometheusConfigFile()

func ListAlarmEndpoints

func ListAlarmEndpoints(query *m.AlarmEndpointQuery) error

func ListCustomDashboard

func ListCustomDashboard(user string, coreToken m.CoreJwtToken) (err error, result []*m.CustomDashboardQuery)

func ListDbMonitor added in v1.5.4

func ListDbMonitor(endpointId int) (result []*m.DbMonitorListObj, err error)

func ListEndpoint added in v1.4.0

func ListEndpoint() []*m.EndpointTable

func ListGrp

func ListGrp(query *m.GrpQuery) error

func ListKubernetesCluster added in v1.7.0

func ListKubernetesCluster(clusterName string) (result []*m.KubernetesClusterTable, err error)

func ListLogMonitor

func ListLogMonitor(query *m.TplQuery) error

func ListLogMonitorNew added in v1.5.4

func ListLogMonitorNew(query *m.TplQuery) error

func ListMainPageRole added in v1.6.0

func ListMainPageRole(user string, roleList []string) (err error, result []*m.MainPageRoleQuery)

func ListRole added in v1.1.0

func ListRole(search string, page, size int) (err error, data m.TableData)

func ListTpl added in v1.4.0

func ListTpl() []*m.TplTable

func ListUser added in v1.1.0

func ListUser(search string, role, page, size int) (err error, data m.TableData)

func MetricCreate added in v1.11.1

func MetricCreate(param []*models.PromMetricTable) error

func MetricDelete added in v1.11.1

func MetricDelete(id int) error

func MetricList added in v1.11.1

func MetricList(id int, endpointType string) (result []*models.PromMetricTable, err error)

func MetricUpdate added in v1.11.1

func MetricUpdate(param []*models.PromMetricTable) error

func NotifyAlarm added in v1.9.0

func NotifyAlarm(alarmObj *m.AlarmHandleObj)

func NotifyCoreEvent added in v1.3.0

func NotifyCoreEvent(endpoint string, strategyId int, alarmId int, customAlarmId int) error

func NotifyTreevent added in v1.10.0

func NotifyTreevent(param m.EventTreeventNotifyDto)

func PanelCreate added in v1.11.1

func PanelCreate(endpointType string, param []*models.PanelTable) error

func PanelDelete added in v1.11.1

func PanelDelete(ids []string) error

func PanelList added in v1.11.1

func PanelList(id int, endpointType string) (result []*models.PanelTable, err error)

func PanelUpdate added in v1.11.1

func PanelUpdate(param []*models.PanelTable) error

func QueryAlarmBySql added in v1.6.0

func QueryAlarmBySql(sql string, params []interface{}, customQueryParam m.CustomAlarmQueryParam) (err error, result m.AlarmProblemQueryResult)

func QueryHistoryAlarm added in v1.6.0

func QueryHistoryAlarm(param m.QueryHistoryAlarmParam) (err error, result m.AlarmProblemQueryResult)

func RegisterEndpointMetric

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

func SaveCustomDashboard

func SaveCustomDashboard(query *m.CustomDashboardTable) error

func SaveCustomeDashboardRole added in v1.6.0

func SaveCustomeDashboardRole(param m.CustomDashboardRoleDto) 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 SearchPanelByName added in v1.5.4

func SearchPanelByName(name, endpoint string) []m.OptionModel

func SearchRecursivePanel added in v1.2.0

func SearchRecursivePanel(search string) []*m.OptionModel

func SearchUserRole added in v1.1.0

func SearchUserRole(search string, searchType string) (err error, options []*m.OptionModel)

func SendConfigToDbManager added in v1.5.4

func SendConfigToDbManager() error

func SendLogConfig added in v1.6.0

func SendLogConfig(endpointId, grpId, tplId int) error

func SetGrpStrategy added in v1.0.1

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

func SnmpEndpointAdd added in v1.11.1

func SnmpEndpointAdd(snmpExporter, endpointGuid, target string) error

func SnmpEndpointDelete added in v1.11.1

func SnmpEndpointDelete(snmpExporter, endpointGuid string) error

func SnmpExporterCreate added in v1.11.1

func SnmpExporterCreate(input models.SnmpExporterTable) error

func SnmpExporterDelete added in v1.11.1

func SnmpExporterDelete(id string) error

func SnmpExporterList added in v1.11.1

func SnmpExporterList() (result []*models.SnmpExporterTable, err error)

func SnmpExporterUpdate added in v1.11.1

func SnmpExporterUpdate(input models.SnmpExporterTable) error

func StartCheckCron added in v1.5.2

func StartCheckCron()

func StartCheckLogKeyword added in v1.5.4

func StartCheckLogKeyword()

func StartCleanAlarmTable added in v1.11.0

func StartCleanAlarmTable()

func StartCronJob added in v1.5.0

func StartCronJob()

func StartCronSyncKubernetesPod added in v1.7.0

func StartCronSyncKubernetesPod(interval int)

func StartNotifyPingExport added in v1.7.0

func StartNotifyPingExport()

func StartSyncCoreJob added in v1.9.0

func StartSyncCoreJob(interval int)

func SyncCoreRole added in v1.4.0

func SyncCoreRole()

func SyncCoreSystemVariable added in v1.9.0

func SyncCoreSystemVariable()

func SyncKubernetesConfig added in v1.7.0

func SyncKubernetesConfig() error

func SyncSnmpPrometheusConfig added in v1.11.1

func SyncSnmpPrometheusConfig() error

func Transaction

func Transaction(actions []*Action) error

func UpdateAgentManagerTable added in v1.5.0

func UpdateAgentManagerTable(endpoint m.EndpointTable, user, password, configFile, binPath string, isAdd bool) error

func UpdateAlarms

func UpdateAlarms(alarms []*m.AlarmHandleObj) []*m.AlarmHandleObj

func UpdateAlertWindowList added in v1.8.0

func UpdateAlertWindowList(endpoint, updateUser string, data []*m.AlertWindowObj) error

func UpdateAliveCheckQueue added in v1.5.2

func UpdateAliveCheckQueue(monitorIp string) error

func UpdateAppendBusiness added in v1.7.0

func UpdateAppendBusiness(param m.BusinessUpdateDto) error

func UpdateBusiness added in v1.0.1

func UpdateBusiness(param m.BusinessUpdateDto) error

func UpdateBusinessNew added in v1.8.0

func UpdateBusinessNew(param m.BusinessUpdateDto) error

func UpdateChartTitle added in v1.4.0

func UpdateChartTitle(param m.UpdateChartTitleParam) error

func UpdateDbMonitor added in v1.5.4

func UpdateDbMonitor(param m.DbMonitorUpdateDto) error

func UpdateDbMonitorSysName added in v1.5.4

func UpdateDbMonitorSysName(param m.DbMonitorSysNameDto) error

func UpdateEndpoint

func UpdateEndpoint(endpoint *m.EndpointTable) error

func UpdateEndpointAlarmFlag added in v1.0.1

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

func UpdateEndpointGrp added in v1.11.0

func UpdateEndpointGrp(param m.EndpointGrpParam) (err error, affectGroupIds []int)

func UpdateEndpointHttp added in v1.5.0

func UpdateEndpointHttp(param []*m.EndpointHttpTable) error

func UpdateEndpointTelnet added in v1.4.0

func UpdateEndpointTelnet(param m.UpdateEndpointTelnetParam) error

func UpdateGrp

func UpdateGrp(obj *m.UpdateGrp) error

func UpdateGrpEndpoint

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

func UpdateGrpRole added in v1.3.0

func UpdateGrpRole(param m.RoleGrpDto) error

func UpdateKubernetesCluster added in v1.7.0

func UpdateKubernetesCluster(param m.KubernetesClusterParam) error

func UpdateKubernetesPodGroup added in v1.11.0

func UpdateKubernetesPodGroup(endpointId int64, group, operation string) (err error, tplId int)

func UpdateLogMonitor

func UpdateLogMonitor(obj *m.UpdateLogMonitor) error

func UpdateMainPageRole added in v1.6.0

func UpdateMainPageRole(param []m.MainPageRoleQuery) error

func UpdateNodeExporterProcessConfig added in v1.5.4

func UpdateNodeExporterProcessConfig(endpointId int) error

func UpdateOrgCallback added in v1.3.0

func UpdateOrgCallback(param m.UpdateOrgPanelEventParam) error

func UpdateOrgConnect added in v1.5.0

func UpdateOrgConnect(param m.UpdateOrgConnectParam) error

func UpdateOrgEndpoint added in v1.3.0

func UpdateOrgEndpoint(param m.UpdateOrgPanelEndpointParam) error

func UpdateOrgRole added in v1.3.0

func UpdateOrgRole(param m.UpdateOrgPanelRoleParam) error

func UpdateOrganization added in v1.3.0

func UpdateOrganization(operation string, param m.UpdateOrgPanelParam) error

func UpdatePanelChartMetric added in v1.11.1

func UpdatePanelChartMetric(data []m.PromMetricUpdateParam) error

func UpdateProcess added in v1.0.1

func UpdateProcess(param m.ProcessUpdateDtoNew, operation string) error

func UpdatePromMetric

func UpdatePromMetric(data []*m.PromMetricTable) error

func UpdateRecursiveEndpoint added in v1.4.0

func UpdateRecursiveEndpoint(guid string, endpoint []string) error

func UpdateRecursivePanel added in v1.1.0

func UpdateRecursivePanel(param m.PanelRecursiveTable) error

func UpdateRole added in v1.1.0

func UpdateRole(param m.UpdateRoleDto) error

func UpdateRoleNew added in v1.10.0

func UpdateRoleNew(param m.UpdateRoleDto) error

func UpdateRoleUser added in v1.1.0

func UpdateRoleUser(param m.UpdateRoleUserDto) error

func UpdateStrategy

func UpdateStrategy(obj *m.UpdateStrategy) error

func UpdateTpl

func UpdateTpl(tplId int, operateUser string) error

func UpdateTplAction added in v1.1.0

func UpdateTplAction(tplId int, user, role []int, extraMail, extraPhone []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{}
}

func Classify

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

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