db

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCustomMetric added in v1.3.0

func AddCustomMetric(param m.TransGatewayMetricDto) error

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 CheckEndpointBusiness added in v1.4.0

func CheckEndpointBusiness(endpoint string) bool

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 Default

func Default() *xorm.Engine

func DeleteCustomDashboard

func DeleteCustomDashboard(query *m.CustomDashboardTable) error

func DeleteEndpoint

func DeleteEndpoint(guid string) 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 GetAlarmEvent added in v1.3.0

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

func GetAlarms

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

func GetBusinessList added in v1.0.1

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

func GetBusinessPanelChart added in v1.4.0

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

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 GetCoreEventList added in v1.3.0

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

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 GetEndpointTelnet added in v1.4.0

func GetEndpointTelnet(guid string) (result []*m.EndpointTelnetTable, 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 GetLogMonitorTable

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

func GetMailByStrategy added in v1.1.0

func GetMailByStrategy(strategyId int) []string

func GetMainCustomDashboard

func GetMainCustomDashboard() (error, m.CustomDashboardTable)

func GetOpenAlarm added in v1.0.1

func GetOpenAlarm() []*m.AlarmProblemQuery

func GetOrgCallback added in v1.3.0

func GetOrgCallback(guid string) (result m.PanelRecursiveTable, 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() (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 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 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 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 ListEndpoint added in v1.4.0

func ListEndpoint() []*m.EndpointTable

func ListGrp

func ListGrp(query *m.GrpQuery) error

func ListLogMonitor

func ListLogMonitor(query *m.TplQuery) error

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 NotifyCoreEvent added in v1.3.0

func NotifyCoreEvent(endpoint string, strategyId int) 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 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 SetGrpStrategy added in v1.0.1

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

func SetMainCustomDashboard

func SetMainCustomDashboard(id int) error

func SyncCoreRole added in v1.4.0

func SyncCoreRole()

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 UpdateChartTitle added in v1.4.0

func UpdateChartTitle(param m.UpdateChartTitleParam) 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 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 UpdateLogMonitor

func UpdateLogMonitor(obj *m.UpdateLogMonitor) error

func UpdateOrgCallback added in v1.3.0

func UpdateOrgCallback(param m.UpdateOrgPanelEventParam) 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 UpdateProcess added in v1.0.1

func UpdateProcess(param m.ProcessUpdateDto) 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 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) 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