Documentation
¶
Index ¶
- Constants
- Variables
- func AlarmChannelCreate(db *gorm.DB, data *AlarmChannel) (err error)
- func AlarmChannelDelete(db *gorm.DB, id int) (err error)
- func AlarmChannelUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func AlarmConditionCreate(db *gorm.DB, data *AlarmCondition) (err error)
- func AlarmConditionDeleteBatch(db *gorm.DB, alarmId int) (err error)
- func AlarmCreate(db *gorm.DB, data *Alarm) (err error)
- func AlarmDelete(db *gorm.DB, id int) (err error)
- func AlarmFilterCreate(db *gorm.DB, data *AlarmFilter) (err error)
- func AlarmFilterDeleteBatch(db *gorm.DB, alarmId int) (err error)
- func AlarmFilterUpdateStatus(db *gorm.DB, alarmId int, ups map[string]interface{}) (err error)
- func AlarmHistoryCreate(db *gorm.DB, data *AlarmHistory) (err error)
- func AlarmHistoryUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func AlarmUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func BuildPreloadArgs(conds Conds) (args []interface{})
- func BuildQuery(conds Conds) (sql string, binds []interface{})
- func ClusterCreate(db *gorm.DB, data *Cluster) (err error)
- func ClusterDelete(db *gorm.DB, id int) (err error)
- func ClusterUpdate(db *gorm.DB, paramId int, ups map[string]interface{}) (err error)
- func ConfigurationCreate(db *gorm.DB, data *Configuration) (err error)
- func ConfigurationDelete(db *gorm.DB, id int) (err error)
- func ConfigurationUpdate(db *gorm.DB, paramId int, ups map[string]interface{}) (err error)
- func CreatePmsRole(db *gorm.DB, data *PmsRole) (err error)
- func CreatePmsRoleDetail(db *gorm.DB, data *PmsRoleDetail) (err error)
- func CrontabCreate(db *gorm.DB, data *BigdataCrontab) (err error)
- func CrontabDelete(db *gorm.DB, nodeId int) (err error)
- func CrontabUpdate(db *gorm.DB, nodeId int, ups map[string]interface{}) (err error)
- func DatabaseCreate(db *gorm.DB, data *BaseDatabase) (err error)
- func DatabaseDelete(db *gorm.DB, id int) (err error)
- func DatabaseUpdate(db *gorm.DB, paramId int, ups map[string]interface{}) (err error)
- func DeletePmsRoleById(tx *gorm.DB, pmsRoleId int) (err error)
- func DeletePmsRoleRef(tx *gorm.DB, id int) (err error)
- func DependsBatchInsert(db *gorm.DB, rows []*BigdataDepend) (err error)
- func DependsDeleteAll(db *gorm.DB, iid int) (err error)
- func FolderCreate(db *gorm.DB, data *BigdataFolder) (err error)
- func FolderDelete(db *gorm.DB, id int) (err error)
- func FolderUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func GetAlarmTableInstanceInfo(id int) (alarmInfo Alarm, relatedList []*RespAlarmListRelatedInfo, err error)
- func GetAlarmTableInstanceInfoWithCache(id int, cache map[int]*RespAlarmListRelatedInfo) (alarmInfo Alarm, relatedList []*RespAlarmListRelatedInfo, err error)
- func HiddenFieldCreateBatch(db *gorm.DB, data []*BaseHiddenField) (err error)
- func HiddenFieldDeleteByFields(db *gorm.DB, fields []string) (err error)
- func IndexCreate(db *gorm.DB, data *BaseIndex) (err error)
- func IndexDeleteBatch(db *gorm.DB, tid int) (err error)
- func InstanceCreate(db *gorm.DB, data *BaseInstance) (err error)
- func InstanceDelete(db *gorm.DB, id int) (err error)
- func InstanceKey(id int) string
- func InstanceUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func K8SConfigMapCreate(db *gorm.DB, data *K8SConfigMap) (err error)
- func NodeContentCreate(db *gorm.DB, data *BigdataNodeContent) (err error)
- func NodeContentDelete(db *gorm.DB, id int) (err error)
- func NodeContentUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func NodeCreate(db *gorm.DB, data *BigdataNode) (err error)
- func NodeDelete(db *gorm.DB, id int) (err error)
- func NodeHistoryCreate(db *gorm.DB, data *BigdataNodeHistory) (err error)
- func NodeResultCreate(db *gorm.DB, data *BigdataNodeResult) (err error)
- func NodeResultDelete30Days()
- func NodeResultUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func NodeUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func PmsCustomRoleCreate(item *PmsCustomRole) (err error)
- func PmsCustomRoleDelete(paramId int) (err error)
- func PmsDefaultRoleCreate(item *PmsDefaultRole) (err error)
- func PmsDefaultRoleDelete(paramId int) (err error)
- func ShortURLCreate(db *gorm.DB, data *BaseShortURL) (err error)
- func ShortURLDelete30Days()
- func ShortURLUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func SourceCreate(db *gorm.DB, data *BigdataSource) (err error)
- func SourceDelete(db *gorm.DB, id int) (err error)
- func SourceUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- func TableCreate(db *gorm.DB, data *BaseTable) (err error)
- func TableDelete(db *gorm.DB, id int) (err error)
- func TableUpdate(db *gorm.DB, paramId int, ups map[string]interface{}) (err error)
- func UserCreate(db *gorm.DB, data *User) (err error)
- func UserDelete(db *gorm.DB, id int) (err error)
- func UserUpdate(db *gorm.DB, paramId int, ups map[string]interface{}) (err error)
- func ViewCreate(db *gorm.DB, data *BaseView) (err error)
- func ViewDelete(db *gorm.DB, id int) (err error)
- func ViewDeleteByTableID(db *gorm.DB, tid int) (err error)
- func ViewUpdate(db *gorm.DB, paramId int, ups map[string]interface{}) (err error)
- func WorkflowCreate(db *gorm.DB, data *BigdataWorkflow) (err error)
- func WorkflowDelete(db *gorm.DB, id int) (err error)
- func WorkflowUpdate(db *gorm.DB, id int, ups map[string]interface{}) (err error)
- type Alarm
- func AlarmInfo(db *gorm.DB, id int) (resp Alarm, err error)
- func AlarmInfoX(db *gorm.DB, conds map[string]interface{}) (resp Alarm, err error)
- func AlarmList(conds egorm.Conds) (resp []*Alarm, err error)
- func AlarmListByDidPage(conds egorm.Conds, reqList *ReqPage) (total int64, respList []*Alarm)
- func AlarmListByTidArr(conds egorm.Conds, tidArr []int) (resp []*Alarm, err error)
- func AlarmListPageByTidArr(conds egorm.Conds, reqList *ReqPage, tidArr []int) (total int64, respList []*Alarm)
- func (m *Alarm) AlertInterval() string
- func (m *Alarm) GetStatus(db *gorm.DB) int
- func (m *Alarm) RuleName(filterId int) string
- func (m *Alarm) RuleNameMap() map[int][]string
- func (m *Alarm) TableName() string
- func (m *Alarm) UniqueName(filterId int) string
- func (m *Alarm) UpdateStatus(db *gorm.DB, status int) (err error)
- func (m *Alarm) ViewName(database, table string, seq int) string
- type AlarmChannel
- type AlarmCondition
- type AlarmFilter
- type AlarmHistory
- type Alert
- type BaseDatabase
- func DatabaseGetOrCreate(db *gorm.DB, uid, iid int, name, cluster string) (resp BaseDatabase, err error)
- func DatabaseInfo(db *gorm.DB, paramId int) (resp BaseDatabase, err error)
- func DatabaseInfoX(db *gorm.DB, conds map[string]interface{}) (resp BaseDatabase, err error)
- func DatabaseList(db *gorm.DB, conds egorm.Conds) (resp []*BaseDatabase, err error)
- type BaseHiddenField
- type BaseIndex
- type BaseInstance
- type BaseModel
- type BaseShortURL
- type BaseTable
- func TableInfo(db *gorm.DB, paramId int) (resp BaseTable, err error)
- func TableInfoX(db *gorm.DB, conds map[string]interface{}) (resp BaseTable, err error)
- func TableList(db *gorm.DB, conds egorm.Conds) (resp []*BaseTable, err error)
- func TableListByInstanceId(db *gorm.DB, iid int) (resp []*BaseTable, err error)
- type BaseView
- type BigdataCrontab
- type BigdataDepend
- type BigdataFolder
- type BigdataNode
- type BigdataNodeContent
- type BigdataNodeHistory
- type BigdataNodeResult
- type BigdataSource
- type BigdataWorkflow
- type CasbinRules
- type Cluster
- func ClusterInfo(paramId int) (resp Cluster, err error)
- func ClusterListHideSensitiveInfo(conds egorm.Conds) (resp []*Cluster, err error)
- func ClusterListPage(conds egorm.Conds, reqList *ReqPage) (total int64, respList []*Cluster)
- func ClusterNormalInfo(paramId int) (resp Cluster, err error)
- func ClusterNormalList(conds egorm.Conds) (resp []*Cluster, err error)
- type Collect
- func (model *Collect) Create(db *gorm.DB) (err error)
- func (model *Collect) Delete(db *gorm.DB) (err error)
- func (model *Collect) Info(db *gorm.DB) (err error)
- func (model *Collect) InfoX(db *gorm.DB, conds map[string]interface{}) (err error)
- func (model *Collect) List(db *gorm.DB, conds egorm.Conds) (resp []*Collect, err error)
- func (model *Collect) ListPage(db *gorm.DB, conds egorm.Conds, reqList *ReqPage) (total int64, respList []*Collect)
- func (model *Collect) TableName() string
- func (model *Collect) Update(db *gorm.DB, ups map[string]interface{}) (err error)
- type Cond
- type Conds
- type Configuration
- type ConfigurationHistory
- type ConfigurationPublish
- type Event
- type ICollect
- type Ints
- type K8SConfigMap
- func K8SConfigMapInfo(paramId int) (resp K8SConfigMap, err error)
- func K8SConfigMapInfoX(conds map[string]interface{}) (resp K8SConfigMap, err error)
- func K8SConfigMapListX(conds map[string]interface{}) (resp []K8SConfigMap, err error)
- func K8SConfigMapLoadOrSave(db *gorm.DB, data *K8SConfigMap) (resp *K8SConfigMap, err error)
- type Notification
- type OAuthToken
- type Pagination
- type PmsCasbinRule
- type PmsCustomRole
- type PmsDefaultRole
- type PmsRole
- type PmsRoleDetail
- type PmsRoleRef
- type PmsRoleRefGrant
- type PushMsg
- type ReqAlarmWebhook
- type ReqAlertSettingUpdate
- type ReqCreateCollect
- type ReqCreateMetricsSamples
- type ReqListCollect
- type ReqPage
- type ReqShortURLCreate
- type ReqUpdateCollect
- type RespAlarmListRelatedInfo
- type RespAlertSettingInfo
- type RespAlertSettingListItem
- type RespAllEnums
- type RespEnumsOfSource
- type RespListCollect
- type RespListCollectItem
- type String2String
- type Strings
- type UnitItem
- type Ups
- type User
- type UserIdName
Constants ¶
const ( AlarmModeAggregation int AlarmModeAggregationCheck )
const ( AlarmStatusUnknown = iota AlarmStatusClose AlarmStatusOpen AlarmStatusFiring AlarmStatusRuleCheck )
const ( RuleStoreTypeFile = 1 RuleStoreTypeK8sConfigMap = 2 RuleStoreTypeK8sOperator = 3 )
const ( ChannelDingDing = iota + 1 ChannelWeChat ChannelFeiShu ChannelSlack ChannelEmail ChannelTelegram )
const ( FEISHUURL = "https://open.feishu.cn" LARKSUITE = "https://open.larksuite.com" SLACKURL = "https://hooks.slack.com/services/" )
const ( PushedStatusRepeat = iota PushedStatusSuccess PushedStatusFail )
const ( HashTypeSip int = 1 HashTypeURL int = 2 )
const ( DatasourceMySQL = "mysql" DatasourceClickHouse = "ch" )
const ( TimeFieldTypeDT = 0 // DateTime TimeFieldTypeSecond = 1 TimeFieldTypeTsMs = 2 // unix ms TimeFieldTypeDT3 = 3 // DataTime64(3) )
const ( BigdataNodeResultUnknown int = iota BigdataNodeResultSucc BigdataNodeResultFailed )
const ( CollectTypeQuery = 1 << 0 CollectTypeTableFilter = 1 << 1 CollectTypeGlobalFilter = 1 << 2 )
const ( OpnMigration = "system_setting_migration" OpnTablesDelete = "opn_tables_delete" OpnTablesCreate = "opn_tables_create" OpnTableCreateSelfBuilt = "opn_tables_create_self_built" OpnTablesUpdate = "opn_tables_update" OpnTablesIndexUpdate = "opn_tables_index_update" OpnTablesLogsQuery = "opn_tables_logs_query" OpnDatabasesDelete = "opn_databases_delete" OpnDatabasesCreate = "opn_databases_create" OpnDatabasesUpdate = "opn_databases_update" OpnInstancesDelete = "opn_instances_delete" OpnInstancesCreate = "opn_instances_create" OpnInstancesUpdate = "opn_instances_update" OpnViewsDelete = "opn_views_delete" OpnViewsCreate = "opn_views_create" OpnViewsUpdate = "opn_views_update" OpnConfigsDelete = "opn_configs_delete" OpnConfigsCreate = "opn_configs_create" OpnConfigsUpdate = "opn_configs_update" OpnConfigsPublish = "opn_configs_publish" OpnConfigsSync = "opn_configs_sync" OpnClustersDelete = "opn_clusters_delete" OpnClustersCreate = "opn_clusters_create" OpnClustersUpdate = "opn_clusters_update" OpnClustersConfigMapDelete = "opn_clusters_config_map_delete" OpnClustersConfigMapCreate = "opn_clusters_config_map_create" OpnClustersConfigMapUpdate = "opn_clusters_config_map_update" OpnAlarmsDelete = "opn_alarms_delete" OpnAlarmsCreate = "opn_alarms_create" OpnAlarmsUpdate = "opn_alarms_update" OpnAlarmsChannelsDelete = "opn_alarms_channels_delete" OpnAlarmsChannelsCreate = "opn_alarms_channels_create" OpnAlarmsChannelsUpdate = "opn_alarms_channels_update" OpnBigDataNodeCreate = "opn_big_data_node_create" OpnBigDataNodeUpdate = "opn_big_data_node_update" OpnBigDataNodeDelete = "opn_big_data_node_delete" OpnBigDataFolderCreate = "opn_big_data_folder_create" OpnBigDataFolderUpdate = "opn_big_data_folder_update" OpnBigDataFolderDelete = "opn_big_data_folder_delete" OpnBigDataNodeCrontabCreate = "opn_big_data_node_crontab_create" OpnBigDataNodeCrontabUpdate = "opn_big_data_node_crontab_update" OpnBigDataNodeCrontabDelete = "opn_big_data_node_crontab_delete" OpnBigDataNodeCrontabStop = "opn_big_data_node_crontab_stop" OpnBigDataNodeResultUpdate = "opn_big_data_node_result_update" OpnBigDataWorkflowCreate = "opn_big_data_workflow_create" OpnBigDataWorkflowUpdate = "opn_big_data_workflow_update" OpnBigDataWorkflowDelete = "opn_big_data_workflow_delete" OpnBigDataSourceCreate = "opn_big_data_source_create" OpnBigDataSourceUpdate = "opn_big_data_source_update" OpnBigDataSourceDelete = "opn_big_data_source_delete" OpnBigDataNodeLock = "opn_big_data_node_lock" OpnBigDataNodeUnlock = "opn_big_data_node_unlock" OpnBigDataNodeRun = "opn_big_data_node_run" OpnBigDataNodeStop = "opn_big_data_node_strop" OpnUserCreate = "opn_base_user_create" OpnUserDelete = "opn_base_user_delete" OpnUserPasswordReset = "opn_base_user_password_reset" OpnUserPwdChange = "user_pwd_change" )
abbr. -> fullName "Opn" -> "Operation" "mgt" -> "management"
const ( SourceInquiryMgtCenter = "log_mgt" SourceUserMgtCenter = "user_mgt" SourceSystemSetting = "system_setting" SourceClusterMgtCenter = "cluster_mgt" SourceAlarmMgtCenter = "alarm_mgt" SourceConfigMgtCenter = "config_mgt" SourceBigDataMgtCenter = "bigdata_mgt" )
const ( // ReplicaStatusYes This definition is really outrageous ReplicaStatusYes = 0 ReplicaStatusNo = 1 )
const ( TableNameUser = "cv_user" TableNameEvent = "cv_event" TableNameK8SConfigMap = "cv_k8s_cm" TableNameCluster = "cv_cluster" TableNameCollect = "cv_collect" TableNameBaseView = "cv_base_view" TableNameBaseTable = "cv_base_table" TableNameBaseIndex = "cv_base_index" TableNameBaseDatabase = "cv_base_database" TableNameBaseInstance = "cv_base_instance" TableNameBaseShortURL = "cv_base_short_url" TableNameBaseHiddenField = "cv_base_hidden_field" TableNameAlarm = "cv_alarm" TableNameAlarmFilter = "cv_alarm_filter" TableNameAlarmHistory = "cv_alarm_history" TableNameAlarmChannel = "cv_alarm_channel" TableNameAlarmCondition = "cv_alarm_condition" TableNameConfiguration = "cv_configuration" TableNameConfigurationHistory = "cv_configuration_history" TableNameConfigurationPublish = "cv_configuration_publish" TableNamePmsRole = "cv_pms_role" TableNamePmsRoleRef = "cv_pms_role_ref" TableNamePmsRoleDetail = "cv_pms_role_detail" TableNamePmsRoleRefGrant = "cv_pms_role_ref_grant" TableNamePmsCasbinRule = "cv_pms_casbin_rule" TableNamePmsCustomRole = "cv_pms_custom_role" TableNamePmsDefaultRole = "cv_pms_default_role" TableNameBigDataNode = "cv_bd_node" TableNameBigDataNodeResult = "cv_bd_node_result" TableNameBigDataNodeContent = "cv_bd_node_content" TableNameBigDataNodeHistory = "cv_bd_node_history" TableNameBigDataFolder = "cv_bd_folder" TableNameBigDataSource = "cv_bd_source" TableNameBigDataWorkflow = "cv_bd_workflow" TableNameBigDataDepend = "cv_bd_depend" TableNameBigDataCrontab = "cv_bd_crontab" )
const ( CrontabStatusWait int = iota CrontabStatusPreempt CrontabStatusDoing )
const ( SourceTypMySQL = 1 SourceTypClickHouse = 2 )
const ( PrimaryMining = 1 PrimaryShort = 3 )
const ( SecondaryAny = 0 SecondaryDatabase = 1 SecondaryDataIntegration = 2 SecondaryDataMining = 3 SecondaryDashboard = 4 )
const ( TertiaryClickHouse = 10 TertiaryMySQL = 11 TertiaryOfflineSync = 20 TertiaryRealTimeSync = 21 )
const ( NodeStatusDefault = 0 NodeStatusHandler = 2 NodeStatusError = 3 NodeStatusFinish = 4 )
0 No status 2 Executing 3 Abnormal execution 4 Completed
const ( PmsRoleTypeDefault PmsRoleTypeCustom )
const ( RefId = "{{ID}}" // is used to replace with real resourceObjId in ruleTpl when adding to casbin // used to generate "p" type ruleTpl like: role__{{PmsRole:Id}}__{{PmsRole:BelongResource}}__{{ID}},{{PmsRole:BelongResource}}__{{ID}}__subResource__(SubResourceRegex),ActsRegex,{{DOM}} TplOfRuleTpl = "role__%d__%s__{{ID}},%s__{{ID}}__subResource__%s,%s,*" // contains the const RefId. do not contain any blank chars )
const (
ClusterStatusMaintaining
)
status of kubernetes cluster
const (
CrontabTypSuspended int
)
const (
SuffixJaegerJSON = "_jaeger_dependencies"
)
const TimeFieldNanoseconds = "_time_nanosecond_"
const TimeFieldSecond = "_time_second_"
const (
V3TableTypeJaegerJSON
)
Variables ¶
var ( ErrCollectCreator = errors.New("only the creator can modify") ErrCollectUpdateParams = errors.New("collect update params error") )
var ( SourceMap = map[string]string{ SourceInquiryMgtCenter: "Log", SourceUserMgtCenter: "User", SourceSystemSetting: "System", SourceClusterMgtCenter: "K8s", SourceAlarmMgtCenter: "Alarm", SourceConfigMgtCenter: "Configuration", SourceBigDataMgtCenter: "Analysis", } SourceOpnMap = map[string][]string{ SourceInquiryMgtCenter: { OpnTablesDelete, OpnTablesCreate, OpnTablesUpdate, OpnTablesIndexUpdate, OpnTablesLogsQuery, OpnDatabasesDelete, OpnDatabasesCreate, OpnDatabasesUpdate, OpnInstancesDelete, OpnInstancesCreate, OpnInstancesUpdate, OpnViewsDelete, OpnViewsCreate, OpnViewsUpdate, }, SourceClusterMgtCenter: { OpnClustersDelete, OpnClustersCreate, OpnClustersUpdate, }, SourceAlarmMgtCenter: { OpnAlarmsDelete, OpnAlarmsCreate, OpnAlarmsUpdate, OpnAlarmsChannelsDelete, OpnAlarmsChannelsCreate, OpnAlarmsChannelsUpdate, }, SourceConfigMgtCenter: { OpnConfigsDelete, OpnConfigsCreate, OpnConfigsUpdate, OpnConfigsPublish, }, SourceUserMgtCenter: {OpnUserPwdChange, OpnUserCreate, OpnUserDelete, OpnUserPasswordReset}, SourceSystemSetting: {OpnMigration}, SourceBigDataMgtCenter: { OpnBigDataNodeCreate, OpnBigDataNodeUpdate, OpnBigDataNodeDelete, OpnBigDataFolderCreate, OpnBigDataFolderUpdate, OpnBigDataFolderDelete, OpnBigDataNodeCrontabCreate, OpnBigDataNodeCrontabUpdate, OpnBigDataNodeCrontabDelete, OpnBigDataNodeCrontabStop, OpnBigDataNodeResultUpdate, OpnBigDataWorkflowCreate, OpnBigDataWorkflowUpdate, OpnBigDataWorkflowDelete, OpnBigDataSourceCreate, OpnBigDataSourceUpdate, OpnBigDataSourceDelete, OpnBigDataNodeLock, OpnBigDataNodeUnlock, OpnBigDataNodeRun, OpnBigDataNodeStop}, } )
var OperationMap = map[string]string{ OpnTablesDelete: "table delete", OpnTablesCreate: "table create", OpnTablesUpdate: "table update", OpnTableCreateSelfBuilt: "an existing data table is connected", OpnTablesIndexUpdate: "table analysis field updates", OpnTablesLogsQuery: "log query", OpnDatabasesDelete: "database delete", OpnDatabasesCreate: "database create", OpnDatabasesUpdate: "database update", OpnInstancesDelete: "instance delete", OpnInstancesCreate: "instance create", OpnInstancesUpdate: "instance update", OpnViewsDelete: "custom time field delete", OpnViewsCreate: "custom time field create", OpnViewsUpdate: "custom time field update", OpnConfigsDelete: "config delete", OpnConfigsCreate: "config create", OpnConfigsUpdate: "config update", OpnConfigsPublish: "config publish", OpnConfigsSync: "synchronize the configuration from the target cluster", OpnClustersDelete: "cluster delete", OpnClustersCreate: "cluster create", OpnClustersUpdate: "cluster update", OpnClustersConfigMapDelete: "cluster configmap delete", OpnClustersConfigMapCreate: "cluster configmap create", OpnClustersConfigMapUpdate: "cluster configmap update", OpnAlarmsDelete: "alarm delete", OpnAlarmsCreate: "alarm create", OpnAlarmsUpdate: "alarm update", OpnAlarmsChannelsDelete: "alarm channel delete", OpnAlarmsChannelsCreate: "alarm channel create", OpnAlarmsChannelsUpdate: "alarm channel update", OpnMigration: "upgrading the database structure", OpnBigDataNodeCreate: "node create", OpnBigDataNodeUpdate: "node update", OpnBigDataNodeDelete: "node delete", OpnBigDataFolderCreate: "folder create", OpnBigDataFolderUpdate: "folder update", OpnBigDataFolderDelete: "folder delete", OpnBigDataNodeCrontabCreate: "node crontab create", OpnBigDataNodeCrontabUpdate: "node crontab update", OpnBigDataNodeCrontabDelete: "node crontab delete", OpnBigDataNodeCrontabStop: "node crontab stop", OpnBigDataNodeResultUpdate: "node run result update", OpnBigDataWorkflowCreate: "workflow create", OpnBigDataWorkflowUpdate: "workflow update", OpnBigDataWorkflowDelete: "workflow delete", OpnBigDataSourceCreate: "source create", OpnBigDataSourceUpdate: "source update", OpnBigDataSourceDelete: "source delete", OpnBigDataNodeLock: "node lock", OpnBigDataNodeUnlock: "node unlock", OpnBigDataNodeRun: "node run", OpnBigDataNodeStop: "node stop", OpnUserCreate: "user create", OpnUserDelete: "user delete", OpnUserPasswordReset: "user password reset", OpnUserPwdChange: "change the password", }
Functions ¶
func AlarmChannelCreate ¶
func AlarmChannelCreate(db *gorm.DB, data *AlarmChannel) (err error)
func AlarmChannelUpdate ¶
func AlarmConditionCreate ¶
func AlarmConditionCreate(db *gorm.DB, data *AlarmCondition) (err error)
func AlarmFilterCreate ¶
func AlarmFilterCreate(db *gorm.DB, data *AlarmFilter) (err error)
func AlarmFilterUpdateStatus ¶ added in v0.4.4
func AlarmHistoryCreate ¶
func AlarmHistoryCreate(db *gorm.DB, data *AlarmHistory) (err error)
func AlarmHistoryUpdate ¶
func BuildPreloadArgs ¶
func BuildPreloadArgs(conds Conds) (args []interface{})
func BuildQuery ¶
BuildQuery 根据conds构建sql和绑定的参数
func ClusterDelete ¶
ClusterDelete soft delete item by id
func ClusterUpdate ¶
ClusterUpdate ...
func ConfigurationCreate ¶
func ConfigurationCreate(db *gorm.DB, data *Configuration) (err error)
ConfigurationCreate CRUD
func ConfigurationDelete ¶
ConfigurationDelete 硬删除
func ConfigurationUpdate ¶
ConfigurationUpdate ...
func CreatePmsRoleDetail ¶
func CreatePmsRoleDetail(db *gorm.DB, data *PmsRoleDetail) (err error)
func CrontabCreate ¶ added in v0.3.2
func CrontabCreate(db *gorm.DB, data *BigdataCrontab) (err error)
func CrontabUpdate ¶ added in v0.3.2
func DatabaseCreate ¶
func DatabaseCreate(db *gorm.DB, data *BaseDatabase) (err error)
DatabaseCreate ...
func DatabaseDelete ¶
DatabaseDelete Soft delete
func DatabaseUpdate ¶
DatabaseUpdate ...
func DeletePmsRoleById ¶
please make sure the associated casbinRules have removed after deleted pmsRole. do not only invoke this func to delete pmsRole.
func DependsBatchInsert ¶ added in v0.3.2
func DependsBatchInsert(db *gorm.DB, rows []*BigdataDepend) (err error)
func FolderCreate ¶ added in v0.3.1
func FolderCreate(db *gorm.DB, data *BigdataFolder) (err error)
func FolderUpdate ¶ added in v0.3.1
func GetAlarmTableInstanceInfo ¶
func GetAlarmTableInstanceInfo(id int) (alarmInfo Alarm, relatedList []*RespAlarmListRelatedInfo, err error)
func GetAlarmTableInstanceInfoWithCache ¶ added in v0.4.4
func GetAlarmTableInstanceInfoWithCache(id int, cache map[int]*RespAlarmListRelatedInfo) (alarmInfo Alarm, relatedList []*RespAlarmListRelatedInfo, err error)
func HiddenFieldCreateBatch ¶ added in v0.3.1
func HiddenFieldCreateBatch(db *gorm.DB, data []*BaseHiddenField) (err error)
func HiddenFieldDeleteByFields ¶ added in v0.3.1
func InstanceCreate ¶
func InstanceCreate(db *gorm.DB, data *BaseInstance) (err error)
func InstanceKey ¶
func InstanceUpdate ¶
func K8SConfigMapCreate ¶
func K8SConfigMapCreate(db *gorm.DB, data *K8SConfigMap) (err error)
K8SConfigMapCreate CRUD
func NodeContentCreate ¶ added in v0.3.1
func NodeContentCreate(db *gorm.DB, data *BigdataNodeContent) (err error)
func NodeContentUpdate ¶ added in v0.3.1
func NodeCreate ¶ added in v0.3.1
func NodeCreate(db *gorm.DB, data *BigdataNode) (err error)
func NodeHistoryCreate ¶ added in v0.3.1
func NodeHistoryCreate(db *gorm.DB, data *BigdataNodeHistory) (err error)
func NodeResultCreate ¶ added in v0.3.2
func NodeResultCreate(db *gorm.DB, data *BigdataNodeResult) (err error)
func NodeResultDelete30Days ¶ added in v0.3.2
func NodeResultDelete30Days()
func NodeResultUpdate ¶ added in v0.3.2
func NodeUpdate ¶ added in v0.3.1
func PmsCustomRoleCreate ¶
func PmsCustomRoleCreate(item *PmsCustomRole) (err error)
func PmsCustomRoleDelete ¶
func PmsDefaultRoleCreate ¶
func PmsDefaultRoleCreate(item *PmsDefaultRole) (err error)
func PmsDefaultRoleDelete ¶
func ShortURLCreate ¶ added in v0.4.3
func ShortURLCreate(db *gorm.DB, data *BaseShortURL) (err error)
func ShortURLDelete30Days ¶ added in v0.4.3
func ShortURLDelete30Days()
func ShortURLUpdate ¶ added in v0.4.3
func SourceCreate ¶ added in v0.3.1
func SourceCreate(db *gorm.DB, data *BigdataSource) (err error)
func SourceUpdate ¶ added in v0.3.1
func TableUpdate ¶
TableUpdate ...
func UserDelete ¶
UserDelete soft delete item by id
func UserUpdate ¶
UserUpdate ...
func ViewDeleteByTableID ¶
ViewDeleteByTableID Soft delete
func ViewUpdate ¶
ViewUpdate ...
func WorkflowCreate ¶ added in v0.3.1
func WorkflowCreate(db *gorm.DB, data *BigdataWorkflow) (err error)
Types ¶
type Alarm ¶
type Alarm struct { BaseModel Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // uid of alarm operator Uuid string `gorm:"column:uuid;type:varchar(128);NOT NULL" json:"uuid"` // foreign key Name string `gorm:"column:name;type:varchar(128);NOT NULL" json:"alarmName"` // name of an alarm Desc string `gorm:"column:desc;type:varchar(255);NOT NULL" json:"desc"` // description Interval int `gorm:"column:interval;type:int(11)" json:"interval"` // interval second between alarm Unit int `gorm:"column:unit;type:int(11)" json:"unit"` // 0 m 1 s 2 h 3 d 4 w 5 y Tags String2String `gorm:"column:tag;type:text" json:"tag"` // tags ChannelIds Ints `gorm:"column:channel_ids;type:varchar(255);NOT NULL" json:"channelIds"` // channel of an alarm NoDataOp int `gorm:"column:no_data_op;type:int(11)" db:"no_data_op" json:"noDataOp"` // noDataOp 0 nodata 1 ok 2 alert Level int `gorm:"column:level;type:int(11)" json:"level"` // 0 m 1 s 2 h 3 d 4 w 5 y Status int `gorm:"column:status;type:int(11)" json:"status"` // status User *User `json:"user,omitempty" gorm:"foreignKey:uid;references:id"` // v2 field to support multiple alarm conditions ViewDDLs String2String `gorm:"column:view_ddl_s;type:text" json:"viewDDLs"` // Users to store data generates the alarm condition TableIds Ints `gorm:"column:table_ids;type:varchar(255);NOT NULL" json:"tableIds"` AlertRules String2String `gorm:"column:alert_rules;type:text" json:"alertRules"` // prometheus alert rule // Deprecated: Tid Tid int `gorm:"column:tid;type:int(11)" json:"tid"` // table id // Deprecated: AlertRule will be replaced by AlertRules field, is expected to delete 0.5.0 version AlertRule string `gorm:"column:alert_rule;type:text" json:"alertRule"` // prometheus alert rule // Deprecated: View View string `gorm:"column:view;type:text" json:"view"` // view table ddl // Deprecated: ViewTableName ViewTableName string `gorm:"column:view_table_name;type:varchar(255)" json:"viewTableName"` // name of view table }
func AlarmInfoX ¶
func AlarmListByDidPage ¶
func AlarmListByTidArr ¶ added in v0.4.4
func AlarmListPageByTidArr ¶ added in v0.4.4
func AlarmListPageByTidArr(conds egorm.Conds, reqList *ReqPage, tidArr []int) (total int64, respList []*Alarm)
AlarmListPageByTidArr return item list by pagination SELECT * FROM `cv_alarm` WHERE JSON_CONTAINS(`table_ids`, '[1]') OR JSON_CONTAINS(`table_ids`, '[7]')
func (*Alarm) AlertInterval ¶
func (*Alarm) RuleNameMap ¶ added in v0.4.3
RuleNameMap 提供 rule 兼容
func (*Alarm) UniqueName ¶ added in v0.4.3
func (*Alarm) UpdateStatus ¶ added in v0.4.4
type AlarmChannel ¶
type AlarmChannel struct { BaseModel Name string `gorm:"column:name;type:varchar(128);NOT NULL" json:"name"` // 告警渠道名称 Key string `gorm:"column:key;type:text" json:"key"` // 关键信息 Typ int `gorm:"column:typ;type:int(11)" json:"typ"` // 告警类型:0 dd Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // 操作人 }
AlarmChannel 告警渠道
func AlarmChannelInfo ¶
func AlarmChannelInfo(db *gorm.DB, id int) (resp AlarmChannel, err error)
func AlarmChannelList ¶
func AlarmChannelList(conds egorm.Conds) (resp []*AlarmChannel, err error)
func (*AlarmChannel) JudgmentType ¶ added in v0.4.4
func (m *AlarmChannel) JudgmentType() (err error)
JudgmentType judgment channel key legality temporary support slack feishu
func (*AlarmChannel) TableName ¶
func (m *AlarmChannel) TableName() string
type AlarmCondition ¶
type AlarmCondition struct { BaseModel AlarmId int `gorm:"column:alarm_id;type:int(11)" json:"alarmId"` // alarm id FilterId int `gorm:"column:filter_id;type:int(11)" json:"filterId"` // filter id SetOperatorTyp int `gorm:"column:set_operator_typ;type:int(11);NOT NULL" json:"typ"` // 0 WHEN 1 AND 2 OR SetOperatorExp int `gorm:"column:set_operator_exp;type:int(11);NOT NULL" json:"exp"` // 0 avg 1 min 2 max 3 sum 4 count Cond int `gorm:"column:cond;type:int(11)" json:"cond"` // 0 above 1 below 2 outside range 3 within range Val1 int `gorm:"column:val_1;type:int(11)" json:"val1"` // 基准值/最小值 Val2 int `gorm:"column:val_2;type:int(11)" json:"val2"` // 最大值 }
AlarmCondition alarm statement,the trigger condition
func AlarmConditionList ¶
func AlarmConditionList(conds egorm.Conds) (resp []*AlarmCondition, err error)
func (*AlarmCondition) TableName ¶
func (m *AlarmCondition) TableName() string
type AlarmFilter ¶
type AlarmFilter struct { BaseModel Tid int `gorm:"column:tid;type:int(11)" json:"tid"` // table id AlarmId int `gorm:"column:alarm_id;type:int(11)" json:"alarmId"` // alarm id When string `gorm:"column:when;type:text" json:"when"` // 执行条件 SetOperatorTyp int `gorm:"column:set_operator_typ;type:int(11);NOT NULL" json:"typ"` // 0 default 1 INNER 2 LEFT OUTER 3 RIGHT OUTER 4 FULL OUTER 5 CROSS SetOperatorExp string `gorm:"column:set_operator_exp;type:varchar(255);NOT NULL" json:"exp"` // 操作 Mode int `gorm:"column:mode;type:int(11)" json:"mode"` // 0 m 1 s 2 h 3 d 4 w 5 y Status int `gorm:"column:status;type:int(11)" json:"status"` }
func AlarmFilterInfo ¶
func AlarmFilterInfo(db *gorm.DB, id int) (resp AlarmFilter, err error)
func AlarmFilterList ¶
func (*AlarmFilter) TableName ¶
func (m *AlarmFilter) TableName() string
func (*AlarmFilter) UpdateStatus ¶ added in v0.4.4
func (m *AlarmFilter) UpdateStatus(db *gorm.DB) error
type AlarmHistory ¶
type AlarmHistory struct { BaseModel AlarmId int `gorm:"column:alarm_id;type:int(11)" json:"alarmId"` // alarm id FilterId int `gorm:"column:filter_id;type:int(11)" json:"filterId"` // filter id FilterStatus int `gorm:"column:filter_status;type:int(11)" json:"filterStatus"` IsPushed int `gorm:"column:is_pushed;type:int(11)" json:"isPushed"` // alarm id }
AlarmHistory 告警渠道
func AlarmHistoryInfo ¶
func AlarmHistoryInfo(db *gorm.DB, id int) (resp AlarmHistory, err error)
func AlarmHistoryPage ¶
func AlarmHistoryPage(conds egorm.Conds, reqList *ReqPage) (total int64, respList []*AlarmHistory)
func (*AlarmHistory) TableName ¶
func (m *AlarmHistory) TableName() string
type BaseDatabase ¶ added in v0.3.1
type BaseDatabase struct { BaseModel Iid int `gorm:"column:iid;type:int(11);index:uix_iid_name,unique" json:"iid"` // datasource instance id Name string `gorm:"column:name;type:varchar(64);index:uix_iid_name,unique;NOT NULL" json:"name"` // datasource database name Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // datasource operator uid Cluster string `gorm:"column:cluster;type:varchar(128);NOT NULL" json:"cluster"` // cluster IsCreateByCV int `gorm:"column:is_create_by_cv;type:tinyint(1)" json:"isCreateByCV"` Desc string `gorm:"column:desc;type:varchar(255)" json:"desc"` Instance *BaseInstance `json:"instance,omitempty" gorm:"foreignKey:Iid;references:ID"` }
BaseDatabase 数据库管理
func DatabaseGetOrCreate ¶
func DatabaseInfo ¶
func DatabaseInfo(db *gorm.DB, paramId int) (resp BaseDatabase, err error)
func DatabaseInfoX ¶
func DatabaseInfoX(db *gorm.DB, conds map[string]interface{}) (resp BaseDatabase, err error)
DatabaseInfoX Info extension method to query a single record according to Cond
func DatabaseList ¶
DatabaseList Get all currently undeleted clusters. Mainly used for front end
func (*BaseDatabase) TableName ¶ added in v0.3.1
func (b *BaseDatabase) TableName() string
type BaseHiddenField ¶ added in v0.3.1
type BaseHiddenField struct { BaseModel Tid int `gorm:"column:tid;type:int(11);index:uix_tid_field,unique" json:"tid"` // table id idx Field string `gorm:"column:field;type:varchar(128);NOT NULL;index:uix_tid_field,unique" json:"field"` // index field name }
func HiddenFieldList ¶ added in v0.3.1
func HiddenFieldList(conds egorm.Conds) (resp []*BaseHiddenField, err error)
func (*BaseHiddenField) TableName ¶ added in v0.3.1
func (b *BaseHiddenField) TableName() string
type BaseIndex ¶ added in v0.3.1
type BaseIndex struct { BaseModel Tid int `gorm:"column:tid;type:int(11);index:uix_tid_field_root,unique" json:"tid"` // table id Field string `gorm:"column:field;type:varchar(64);NOT NULL;index:uix_tid_field_root,unique" json:"field"` // index field name RootName string `gorm:"column:root_name;type:varchar(64);NOT NULL;index:uix_tid_field_root,unique" json:"rootName"` // root_name Typ int `gorm:"column:typ;type:int(11);NOT NULL" json:"typ"` // 0 string 1 int 2 float HashTyp int `gorm:"column:hash_typ;type:tinyint(1)" json:"hashTyp"` // hash type, 0 no hash 1 sipHash64 2 URLHash Alias string `gorm:"column:alias;type:varchar(128);NOT NULL" json:"alias"` // index filed alias name }
BaseIndex 索引数据存储
func (*BaseIndex) GetFieldName ¶ added in v0.3.1
func (*BaseIndex) GetHashFieldName ¶ added in v0.3.1
type BaseInstance ¶ added in v0.3.1
type BaseInstance struct { BaseModel Datasource string `gorm:"column:datasource;type:varchar(32);NOT NULL;index:idx_datasource_name,unique" json:"datasource"` // datasource type Name string `gorm:"column:name;type:varchar(128);NOT NULL;index:idx_datasource_name,unique" json:"name"` // datasource instance name Dsn string `gorm:"column:dsn;type:text" json:"dsn"` // dsn RuleStoreType int `gorm:"column:rule_store_type;type:int(11)" json:"ruleStoreType"` // rule_store_type 1 文件 2 集群 FilePath string `gorm:"column:file_path;type:varchar(255)" json:"filePath"` // file_path Desc string `gorm:"column:desc;type:varchar(255)" json:"desc"` // file_path ClusterId int `gorm:"column:cluster_id;type:int(11)" json:"clusterId"` // cluster_id Namespace string `gorm:"column:namespace;type:varchar(128)" json:"namespace"` // namespace Configmap string `gorm:"column:configmap;type:varchar(128)" json:"configmap"` // configmap PrometheusTarget string `gorm:"column:prometheus_target;type:varchar(128)" json:"prometheusTarget"` // prometheus ip or domain, eg: https://prometheus:9090 Mode int `gorm:"column:mode;type:tinyint(1)" json:"mode"` // 0 standalone 1 cluster ReplicaStatus int `gorm:"column:replica_status;type:tinyint(1)" json:"replicaStatus"` // status 0 has replica 1 no replica Clusters Strings `gorm:"column:clusters;type:text" json:"clusters"` }
BaseInstance 服务配置存储
func InstanceInfo ¶
func InstanceInfo(db *gorm.DB, id int) (resp BaseInstance, err error)
func InstanceInfoX ¶
func InstanceInfoX(db *gorm.DB, conds map[string]interface{}) (resp BaseInstance, err error)
InstanceInfoX Info extension method to query a single record according to Cond
func InstanceList ¶
func InstanceList(conds egorm.Conds, extra ...string) (resp []*BaseInstance, err error)
InstanceList ..
func (*BaseInstance) DsKey ¶ added in v0.3.1
func (b *BaseInstance) DsKey() string
func (*BaseInstance) TableName ¶ added in v0.3.1
func (b *BaseInstance) TableName() string
type BaseModel ¶
type BaseModel struct { ID int `gorm:"not null;primary_key;AUTO_INCREMENT;comment:自增id" json:"id"` Ctime int64 `gorm:"bigint;autoCreateTime;comment:创建时间" json:"ctime"` Utime int64 `gorm:"bigint;autoUpdateTime;comment:更新时间" json:"utime"` Dtime sdelete.DeletedAt `gorm:"bigint;comment:删除时间" json:"dtime"` }
type BaseShortURL ¶ added in v0.4.3
type BaseShortURL struct { BaseModel OriginUrl string `gorm:"column:origin_url;type:text" json:"origin_url"` SCode string `gorm:"column:s_code;type:varchar(64);NOT NULL" json:"s_code"` CallCnt int `gorm:"column:call_cnt;type:int(11)" json:"call_cnt"` }
func ShortURLInfoBySCode ¶ added in v0.4.3
func ShortURLInfoBySCode(db *gorm.DB, sCode string) (resp BaseShortURL, err error)
func (*BaseShortURL) TableName ¶ added in v0.4.3
func (b *BaseShortURL) TableName() string
type BaseTable ¶ added in v0.3.1
type BaseTable struct { BaseModel Did int `gorm:"column:did;type:int(11);index:uix_did_name,unique" json:"did"` // database id Name string `gorm:"column:name;type:varchar(128);NOT NULL;index:uix_did_name,unique" json:"name"` // table Typ int `gorm:"column:typ;type:int(11)" json:"typ"` // table type, 1 string 2 float Days int `gorm:"column:days;type:int(11)" json:"days"` // data expire days Brokers string `gorm:"column:brokers;type:varchar(255);NOT NULL" json:"brokers"` // kafka broker Topic string `gorm:"column:topic;type:varchar(128);NOT NULL" json:"topic"` // kafka topic ConsumerNum int `gorm:"column:consumer_num;type:int(11)" json:"consumerNum"` // kafka consumer number SqlData string `gorm:"column:sql_data;type:text" json:"sqlData"` // sql_data SqlStream string `gorm:"column:sql_stream;type:text" json:"sqlStream"` // sql_stream SqlView string `gorm:"column:sql_view;type:text" json:"sqlView"` // sql_view SqlDistributed string `gorm:"column:sql_distributed;type:text" json:"sqlDistributed"` // sql_distributed Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // operator uid CreateType int `gorm:"column:create_type;type:tinyint(1)" json:"createType"` // operation type, 0 means create clickvisual fresh table, 1 means use exists table TimeField string `gorm:"column:time_field;type:varchar(128);NOT NULL" json:"timeField"` // custom time filed name of _time_ TimeFieldType int `gorm:"column:time_field_type;type:int(11);default:0;NOT NULL" json:"timeFieldType"` // custom time filed type name of _time_ Desc string `gorm:"column:desc;type:varchar(255)" json:"desc"` RawLogField string `gorm:"column:raw_log_field;type:varchar(255)" json:"rawLogField"` SelectFields string `gorm:"column:select_fields;type:text" json:"selectFields"` // sql_distributed AnyJSON string `gorm:"column:any_json;type:text" json:"anyJSON"` KafkaSkipBrokenMessages int `gorm:"column:kafka_skip_broken_messages;type:int(11)" json:"kafkaSkipBrokenMessages"` IsKafkaTimestamp int `gorm:"column:is_kafka_timestamp;type:tinyint(1)" json:"isKafkaTimestamp"` TraceTableId int `gorm:"column:trace_table_id;type:int(11)" json:"traceTableId"` V3TableType int `gorm:"column:v3_table_type;type:int(11)" json:"v3TableType"` // 0 default 1 jaegerJson Database *BaseDatabase `json:"database,omitempty" gorm:"foreignKey:Did;references:ID"` }
func TableInfoX ¶
TableInfoX Info extension method to query a single record according to Cond
func TableListByInstanceId ¶ added in v0.4.4
func (*BaseTable) GetTimeField ¶ added in v0.3.1
type BaseView ¶ added in v0.3.1
type BaseView struct { BaseModel Tid int `gorm:"column:tid;type:int(11);index:uix_tid_name,unique" json:"tid"` // table id Name string `gorm:"column:name;type:varchar(64);NOT NULL;index:uix_tid_name,unique" json:"name"` // view name IsUseDefaultTime int `gorm:"column:is_use_default_time;type:int(11)" json:"isUseDefaultTime"` // use system time or not Key string `gorm:"column:key;type:varchar(64);NOT NULL" json:"key"` // field name of time in raw log Format string `gorm:"column:format;type:varchar(64);NOT NULL" json:"format"` // timestamp parse to extract time from raw log and parse it to datetime SqlView string `gorm:"column:sql_view;type:text" json:"sqlView"` // sql_view Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // operator uid }
BaseView Materialized view management
type BigdataCrontab ¶ added in v0.3.2
type BigdataCrontab struct { NodeId int `gorm:"column:node_id;type:int(11);uix_node_id,unique" json:"nodeId"` Desc string `gorm:"column:desc;type:varchar(255);NOT NULL" json:"desc"` // description DutyUid int `gorm:"column:duty_uid;type:int(11)" json:"dutyUid"` // person in charge Cron string `gorm:"column:cron;type:varchar(255);NOT NULL" json:"cron"` // cron expression Typ int `gorm:"column:typ;type:int(11)" json:"typ"` // typ 0 Normal scheduling 1 Suspended scheduling Status int `gorm:"column:status;type:int(11)" json:"status"` // status 0 default 1 preempt 2 doing Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // user id Args string `gorm:"args:sql_view;type:text" json:"args"` // sql_view IsRetry int `gorm:"column:is_retry;type:tinyint(1)" json:"isRetry"` RetryTimes int `gorm:"column:retry_times;type:int(11)" json:"retryTimes"` RetryInterval int `gorm:"column:retry_interval;type:int(11)" json:"retryInterval"` Ctime int64 `gorm:"bigint;autoCreateTime;comment:创建时间" json:"ctime"` Utime int64 `gorm:"bigint;autoUpdateTime;comment:更新时间" json:"utime"` ChannelIds Ints `gorm:"column:channel_ids;type:varchar(255);NOT NULL" json:"channelIds"` // channel of an alarm }
func CrontabInfo ¶ added in v0.3.2
func CrontabInfo(db *gorm.DB, nodeId int) (resp BigdataCrontab, err error)
func CrontabList ¶ added in v0.3.2
func CrontabList(conds egorm.Conds) (resp []*BigdataCrontab, err error)
func (*BigdataCrontab) TableName ¶ added in v0.3.2
func (m *BigdataCrontab) TableName() string
type BigdataDepend ¶ added in v0.3.2
type BigdataDepend struct { Iid int `gorm:"column:iid;type:int(11);index:uix_iid_database_table,unique" json:"iid"` Database string `gorm:"column:database;type:varchar(64);index:uix_iid_database_table,unique;NOT NULL" json:"database"` Table string `gorm:"column:table;type:varchar(128);index:uix_iid_database_table,unique;NOT NULL" json:"table"` Engine string `gorm:"column:engine;type:varchar(128);NOT NULL" json:"engine"` DownDepDatabaseTable Strings `gorm:"column:down_dep_database_table;type:text;NOT NULL" json:"downDepDatabaseTable"` UpDepDatabaseTable Strings `gorm:"column:up_dep_database_table;type:text;NOT NULL" json:"upDepDatabaseTable"` Rows uint64 `gorm:"column:rows;type:bigint(20);default:0;NOT NULL" json:"rows"` Bytes uint64 `gorm:"column:bytes;type:bigint(20);default:0;NOT NULL" json:"bytes"` Utime int64 `gorm:"bigint;autoUpdateTime;comment:更新时间" json:"utime"` }
func DependsList ¶ added in v0.3.2
func DependsList(conds egorm.Conds) (resp []*BigdataDepend, err error)
func EarliestDependRow ¶ added in v0.4.3
func EarliestDependRow(iid int) (resp BigdataDepend, err error)
func (*BigdataDepend) Key ¶ added in v0.3.2
func (m *BigdataDepend) Key() string
func (*BigdataDepend) Name ¶ added in v0.3.2
func (m *BigdataDepend) Name() string
func (*BigdataDepend) TableName ¶ added in v0.3.2
func (m *BigdataDepend) TableName() string
type BigdataFolder ¶ added in v0.3.1
type BigdataFolder struct { BaseModel Uid int `gorm:"column:uid;type:int(11)" json:"uid"` // uid of alarm operator Iid int `gorm:"column:iid;type:int(11)" json:"iid"` Name string `gorm:"column:name;type:varchar(128);NOT NULL" json:"name"` // name of an alarm Desc string `gorm:"column:desc;type:varchar(255);NOT NULL" json:"desc"` // description Primary int `gorm:"column:primary;type:int(11)" json:"primary"` Secondary int `gorm:"column:secondary;type:int(11)" json:"secondary"` WorkflowId int `gorm:"column:workflow_id;type:int(11)" json:"workflowId"` ParentId int `gorm:"column:parent_id;type:int(11)" json:"parentId"` }
func FolderInfo ¶ added in v0.3.1
func FolderInfo(db *gorm.DB, id int) (resp BigdataFolder, err error)
func FolderList ¶ added in v0.3.1
func FolderList(conds egorm.Conds) (resp []*BigdataFolder, err error)
func (*BigdataFolder) TableName ¶ added in v0.3.1
func (m *BigdataFolder) TableName() string
type BigdataNode ¶ added in v0.3.1
type BigdataNode struct { BaseModel Uid int `gorm:"column:uid;type:int(11)" json:"uid"` Iid int `gorm:"column:iid;type:int(11)" json:"iid"` FolderID int `gorm:"column:folder_id;type:int(11)" json:"folderId"` Primary int `gorm:"column:primary;type:int(11)" json:"primary"` Secondary int `gorm:"column:secondary;type:int(11)" json:"secondary"` Tertiary int `gorm:"column:tertiary;type:int(11)" json:"tertiary"` WorkflowId int `gorm:"column:workflow_id;type:int(11)" json:"workflowId"` SourceId int `gorm:"column:sourceId;type:int(11)" json:"sourceId"` Name string `gorm:"column:name;type:varchar(128);NOT NULL" json:"name"` Desc string `gorm:"column:desc;type:varchar(255);NOT NULL" json:"desc"` LockUid int `gorm:"column:lock_uid;type:int(11) unsigned" json:"lockUid"` LockAt int64 `gorm:"column:lock_at;type:int(11)" json:"lockAt"` Status int `gorm:"column:status;type:int(11)" json:"status"` // 0 无状态 1 待执行 2 执行中 3 执行异常 4 执行完成 UUID string `gorm:"column:uuid;type:varchar(128)" json:"uuid"` }
func NodeListWithWorker ¶ added in v0.4.3
func NodeListWithWorker() (resp []*BigdataNode, err error)
NodeListWithWorker ... TertiaryClickHouse = 10 TertiaryMySQL = 11 TertiaryOfflineSync = 20
func (*BigdataNode) TableName ¶ added in v0.3.1
func (m *BigdataNode) TableName() string
type BigdataNodeContent ¶ added in v0.3.1
type BigdataNodeContent struct { NodeId int `gorm:"column:node_id;type:int(11);uix_node_id,unique" json:"nodeId"` Content string `gorm:"column:content;type:longtext" json:"content"` Result string `gorm:"column:result;type:longtext" json:"result"` PreviousContent string `gorm:"column:previous_content;type:longtext" json:"previousContent"` Utime int64 `gorm:"bigint;autoUpdateTime;comment:update time" json:"utime"` }
func NodeContentInfo ¶ added in v0.3.1
func NodeContentInfo(db *gorm.DB, id int) (resp BigdataNodeContent, err error)
func (*BigdataNodeContent) TableName ¶ added in v0.3.1
func (m *BigdataNodeContent) TableName() string
type BigdataNodeHistory ¶ added in v0.3.1
type BigdataNodeHistory struct { UUID string `gorm:"column:uuid;type:varchar(128);uix_uuid,unique" json:"uuid"` NodeId int `gorm:"column:node_id;type:int(11)" json:"nodeId"` Content string `gorm:"column:content;type:longtext" json:"content"` Uid int `gorm:"column:uid;type:int(11)" json:"uid"` Utime int64 `gorm:"bigint;autoUpdateTime;comment:update time" json:"utime"` }
func NodeHistoryInfo ¶ added in v0.3.1
func NodeHistoryInfo(db *gorm.DB, uuid string) (resp BigdataNodeHistory, err error)
func NodeHistoryListPage ¶ added in v0.3.1
func NodeHistoryListPage(conds egorm.Conds, reqList *ReqPage) (total int64, respList []*BigdataNodeHistory)
func (*BigdataNodeHistory) TableName ¶ added in v0.3.1
func (m *BigdataNodeHistory) TableName() string
type BigdataNodeResult ¶ added in v0.3.2
type BigdataNodeResult struct { BaseModel NodeId int `gorm:"column:node_id;type:int(11)" json:"nodeId"` Content string `gorm:"column:content;type:longtext" json:"content"` Result string `gorm:"column:result;type:longtext" json:"result"` ExcelProcess string `gorm:"column:excel_process;type:longtext" json:"excelProcess"` Uid int `gorm:"column:uid;type:int(11)" json:"uid"` Cost int64 `gorm:"column:cost;type:bigint(20)" json:"cost"` // ms Status int `gorm:"column:status;type:int(11)" json:"status"` }
func NodeResultInfo ¶ added in v0.3.2
func NodeResultInfo(db *gorm.DB, id int) (resp BigdataNodeResult, err error)
func NodeResultList ¶ added in v0.3.2
func NodeResultList(conds egorm.Conds) (resp []*BigdataNodeResult, err error)
func NodeResultListPage ¶ added in v0.3.2
func NodeResultListPage(conds egorm.Conds, reqList *ReqPage) (total int64, respList []*BigdataNodeResult)
func (*BigdataNodeResult) TableName ¶ added in v0.3.2
func (m *BigdataNodeResult) TableName() string
type BigdataSource ¶ added in v0.3.1
type BigdataSource struct { BaseModel Iid int `gorm:"column:iid;type:int(11)" json:"iid"` Name string `gorm:"column:name;type:varchar(128);NOT NULL" json:"name"` // name of an alarm Desc string `gorm:"column:desc;type:varchar(255);NOT NULL" json:"desc"` // description URL string `gorm:"column:url;type:varchar(255);NOT NULL" json:"url"` UserName string `gorm:"column:username;type:varchar(255);NOT NULL" json:"username"` Password string `gorm:"column:password;type:varchar(255);NOT NULL" json:"password"` Typ int `gorm:"column:typ;type:int(11)" json:"typ"` Uid int `gorm:"column:uid;type:int(11)" json:"uid"` }
func SourceInfo ¶ added in v0.3.1
func SourceInfo(db *gorm.DB, id int) (resp BigdataSource, err error)
func SourceList ¶ added in v0.3.1
func SourceList(conds egorm.Conds) (resp []*BigdataSource, err error)
func (*BigdataSource) TableName ¶ added in v0.3.1
func (m *BigdataSource) TableName() string
type BigdataWorkflow ¶ added in v0.3.1
type BigdataWorkflow struct { BaseModel Iid int `gorm:"column:iid;type:int(11)" json:"iid"` Name string `gorm:"column:name;type:varchar(128);NOT NULL" json:"name"` // name of an alarm Desc string `gorm:"column:desc;type:varchar(255);NOT NULL" json:"desc"` // description Uid int `gorm:"column:uid;type:int(11)" json:"uid"` }
func WorkflowInfo ¶ added in v0.3.1
func WorkflowInfo(db *gorm.DB, id int) (resp BigdataWorkflow, err error)
func WorkflowList ¶ added in v0.3.1
func WorkflowList(conds egorm.Conds) (resp []*BigdataWorkflow, err error)
func (*BigdataWorkflow) TableName ¶ added in v0.3.1
func (m *BigdataWorkflow) TableName() string
type CasbinRules ¶
type CasbinRules []*PmsCasbinRule
type Cluster ¶
type Cluster struct { BaseModel Name string `gorm:"column:name;type:varchar(128);NOT NULL;index:uix_cluster_name,unique" json:"clusterName"` // unique name of cluster Description string `gorm:"column:description;type:varchar(128)" json:"description"` // brief description of cluster Status int `gorm:"column:status;type:tinyint(1)" json:"status"` // 0 means Well-Running, others mean not running ApiServer string `gorm:"column:api_server;type:varchar(255);NOT NULL" json:"apiServer"` // address of cluster API server KubeConfig string `gorm:"column:kube_config;type:mediumtext;NOT NULL" json:"kubeConfig"` // raw content of kube config }
func ClusterInfo ¶
func ClusterListPage ¶
ClusterListPage return item list by pagination
func ClusterNormalInfo ¶
type Collect ¶ added in v0.4.4
type Collect struct { BaseModel Uid int `gorm:"column:uid;type:int(11)" json:"uid"` TableId int `gorm:"column:table_id;type:int(11)" json:"tableId"` Alias string `gorm:"column:alias;type:varchar(255);NOT NULL" json:"alias"` Statement string `gorm:"column:statement;type:text" json:"statement"` CollectType int `gorm:"column:collect_type;type:int" json:"collectType"` }
type Cond ¶
type Cond struct { // Op MySQL中查询条件,如like,=,in Op string // Val 查询条件对应的值 Val interface{} }
Cond 为字段查询结构体
type Conds ¶
type Conds map[string]interface{}
Conds 为Cond类型map,用于定义Where方法参数 map[field.name]interface{}
type Configuration ¶
type Configuration struct { BaseModel K8SCmId int `gorm:"column:k8s_cm_id;type:int(11);" json:"k8sConfigmapId"` // config map id Name string `gorm:"column:name;type:varchar(64);" json:"name"` Content string `gorm:"column:content;type:longtext" json:"content"` Format string `gorm:"column:format;type:varchar(32)" json:"format"` Version string `gorm:"column:version;type:varchar(64)" json:"version"` Uid int `gorm:"column:uid;type:int(11) unsigned" json:"uid"` PublishTime int64 `gorm:"column:publish_time;type:int(11)" json:"publishTime"` LockUid int `gorm:"column:lock_uid;type:int(11) unsigned" json:"lockUid"` LockAt int64 `gorm:"column:lock_at;type:bigint(11) unsigned" json:"lockAt"` K8SConfigMap K8SConfigMap `gorm:"foreignKey:K8SCmId;references:ID" json:"-"` }
func ConfigurationInfo ¶
func ConfigurationInfo(paramId int) (resp Configuration, err error)
func ConfigurationInfoX ¶
func ConfigurationInfoX(conds map[string]interface{}) (resp Configuration, err error)
ConfigurationInfoX Info extension method to query a single record according to Cond
func ConfigurationList ¶
func ConfigurationList(conds egorm.Conds) (resp []*Configuration, err error)
ConfigurationList return item list by condition
func (*Configuration) TableName ¶
func (c *Configuration) TableName() string
type ConfigurationHistory ¶
type ConfigurationHistory struct { BaseModel Uid int `gorm:"column:uid;type:int(11) unsigned" json:"uid"` ConfigurationId int `gorm:"column:configuration_id;type:int(11) unsigned" json:"configurationId"` ChangeLog string `gorm:"column:change_log;type:longtext" json:"changeLog"` Content string `gorm:"column:content;type:longtext" json:"content"` Version string `gorm:"column:version;type:varchar(64)" json:"version"` Configuration Configuration `json:"configuration,omitempty" gorm:"foreignKey:ConfigurationId;references:ID"` }
func ConfigurationHistoryInfoX ¶
func ConfigurationHistoryInfoX(conds map[string]interface{}) (resp ConfigurationHistory, err error)
ConfigurationHistoryInfoX get single item by condition
func ConfigurationHistoryListPage ¶
func ConfigurationHistoryListPage(conds egorm.Conds, reqList *ReqPage) (total int64, respList []*ConfigurationHistory)
ConfigurationHistoryListPage return item list by pagination
func (*ConfigurationHistory) TableName ¶
func (m *ConfigurationHistory) TableName() string
type ConfigurationPublish ¶
type ConfigurationPublish struct { BaseModel Uid uint `gorm:"column:uid;type:int(11) unsigned" json:"uid"` ConfigurationId uint `gorm:"column:configuration_id;type:int(11) unsigned" json:"configurationId"` ConfigurationHistoryId uint `gorm:"column:configuration_history_id;type:int(11) unsigned" json:"configurationHistoryId"` }
func (*ConfigurationPublish) TableName ¶
func (m *ConfigurationPublish) TableName() string
type Event ¶
type Event struct { ID int `gorm:"primary_key,not null;AUTO_INCREMENT" json:"id"` Source string `gorm:"not null;default:'';size:64;index:idx_source;comment:事件来源" json:"source"` UserName string `gorm:"not null;default:'';size:32;comment:操作用户的名字" json:"userName"` UID int64 `gorm:"not null;default:0;comment:操作用户的uid" json:"uid"` Operation string `gorm:"not null;default:'';size:64;index:idx_operation;comment:操作名" json:"operation"` ObjectType string `gorm:"not null;default:'';size:64;comment:被操作对象的类型(一般为db.Table名)" json:"objectType"` ObjectId int `gorm:"not null;default:0;comment:被操作对象类型(db.BaseTable)下的具体对象的主键(id)" json:"objectId"` Metadata string `gorm:"not null;type:text;comment:事件内容" json:"metadata"` Ctime int64 `gorm:"bigint;autoCreateTime;comment:创建时间" json:"ctime"` OperationName string `gorm:"-" json:"operationName"` SourceName string `gorm:"-" json:"sourceName"` }
func (*Event) HandleOperationName ¶
func (a *Event) HandleOperationName()
func (*Event) HandleSourceName ¶
func (a *Event) HandleSourceName()
type ICollect ¶ added in v0.4.4
type ICollect interface { TableName() string Create(db *gorm.DB) (err error) Update(db *gorm.DB, ups map[string]interface{}) (err error) Info(db *gorm.DB) (err error) InfoX(db *gorm.DB, conds map[string]interface{}) (err error) List(db *gorm.DB, conds egorm.Conds) (resp []*Collect, err error) ListPage(db *gorm.DB, conds egorm.Conds, reqList *ReqPage) (total int64, respList []*Collect) Delete(db *gorm.DB) (err error) }
type K8SConfigMap ¶
type K8SConfigMap struct { BaseModel ClusterId int `gorm:"column:cluster_id;type:int(11);index:uix_cluster_id_name_namespace,unique" json:"clusterId"` // 集群ID Name string `gorm:"column:name;type:varchar(128);index:uix_cluster_id_name_namespace,unique" json:"name"` Namespace string `gorm:"column:namespace;type:varchar(64);index:uix_cluster_id_name_namespace,unique" json:"namespace"` }
func K8SConfigMapInfo ¶
func K8SConfigMapInfo(paramId int) (resp K8SConfigMap, err error)
func K8SConfigMapInfoX ¶
func K8SConfigMapInfoX(conds map[string]interface{}) (resp K8SConfigMap, err error)
K8SConfigMapInfoX get single item by condition
func K8SConfigMapListX ¶
func K8SConfigMapListX(conds map[string]interface{}) (resp []K8SConfigMap, err error)
K8SConfigMapListX get single item by condition
func K8SConfigMapLoadOrSave ¶
func K8SConfigMapLoadOrSave(db *gorm.DB, data *K8SConfigMap) (resp *K8SConfigMap, err error)
func (*K8SConfigMap) TableName ¶
func (m *K8SConfigMap) TableName() string
type Notification ¶ added in v0.4.4
type Notification struct { Version string `json:"version"` GroupKey string `json:"groupKey"` Status string `json:"status"` Receiver string `json:"receiver"` GroupLabels map[string]string `json:"groupLabels"` CommonLabels map[string]string `json:"commonLabels"` CommonAnnotations map[string]string `json:"commonAnnotations"` ExternalURL string `json:"externalURL"` Alerts []Alert `json:"alerts"` }
func (*Notification) GetStatus ¶ added in v0.4.4
func (n *Notification) GetStatus() int
type OAuthToken ¶
func (*OAuthToken) Scan ¶
func (t *OAuthToken) Scan(input interface{}) error
type Pagination ¶ added in v0.4.3
type PmsCasbinRule ¶
type PmsCasbinRule struct { Id uint `gorm:"column:id;not null;primaryKey;autoIncrement;comment:'id'" json:"id" form:"id"` Ptype string `gorm:"column:ptype;not null;type:varchar(100);comment:'ptype: value in [p, g, g2, g3]'" json:"ptype" form:"ptype"` V0 string `gorm:"column:v0;not null;type:varchar(100);comment:'sub'" json:"v0" form:"v0"` V1 string `gorm:"column:v1;not null;type:varchar(100);comment:'obj'" json:"v1" form:"v1"` V2 string `gorm:"column:v2;not null;type:varchar(100);comment:'act'" json:"v2" form:"v2"` V3 string `gorm:"column:v3;not null;type:varchar(100);comment:'dom'" json:"v3" form:"v3"` V4 string `gorm:"column:v4;not null;type:varchar(25);comment:'reserved'" json:"v4" form:"v4"` V5 string `gorm:"column:v5;not null;type:varchar(25);comment:'reserved'" json:"v5" form:"v5"` }
func (*PmsCasbinRule) TableName ¶
func (t *PmsCasbinRule) TableName() string
type PmsCustomRole ¶
type PmsCustomRole struct { BaseModel BelongType string `gorm:"not null;size:50;comment:所属资源类型,如'app'" json:"belong_type"` ReferId int `gorm:"not null;comment:所属资源类型的对应资源id" json:"refer_id"` RoleName string `gorm:"not null;size:50;comment:所属对应资源的角色名称" json:"role_name"` Description string `gorm:"not null;size:255;default:'';comment:对角色的中文描述" json:"description"` SubResources Strings `gorm:"not null;type:json;comment:角色所属refer_id资源的子资源列表" json:"sub_resources"` Acts Strings `gorm:"not null;type:json;comment:对资源列表中各资源的actions" json:"acts"` UpdatedBy int `gorm:"not null;default:0;comment:最近一次对记录做更新的用户id" json:"updated_by"` }
PmsCustomRole: 对资源的自定义角色表; 该表记录的增删会实时反映到 casbin_rule表中 (那么为什么不直接用casbin_rule表去维护?
因为, casbin_rule表中没有description描述, 该表的作用是供app负责人自定义一些在default_role_pms之外的一些角色.)
note: 1. 需要保证 belong_type, refer_id, role_name, resources, act 这5个字段建立联合唯一索引. 但由于resources字段是json类型, 不能用于uniqueIndex, 所以需要代码去保证这5个字段的uniqueIndex 2. 是否支持custom_role_pms的自定义, 需要看当前代码实现, 目前支持的belong_type 为 ["app"]
func GetCustomRolePmsList ¶
func GetCustomRolePmsList(conds Conds) (resp []*PmsCustomRole, err error)
func (*PmsCustomRole) TableName ¶
func (t *PmsCustomRole) TableName() string
type PmsDefaultRole ¶
type PmsDefaultRole struct { BaseModel BelongType string `gorm:"column:belong_type;not null;size:50;comment:所属资源类型,如'app'" json:"belongType"` RoleName string `gorm:"column:role_name;not null;size:50;comment:所属资源的角色名称" json:"roleName"` Description string `gorm:"column:description;not null;size:255;default:'';comment:对角色的中文描述" json:"description"` SubResources Strings `gorm:"column:sub_resources;not null;type:json;comment:角色所属belongType资源下的子资源列表" json:"subResources"` Acts Strings `gorm:"column:acts;not null;type:json;comment:对资源列表中各资源的actions" json:"acts"` UpdatedBy int `gorm:"column:updated_by;type:int(11);not null;default:0;comment:最近一次对记录做更新的用户id" json:"updatedBy"` }
TableDefaultRolePms: 记录belongType资源的默认角色; i.e. 当belongType资源创建时, 会根据该表中的记录去创建对应的casbinRules note: 需要保证 belong_type, role_name, resources, act 这4个字段建立联合唯一索引. 但由于resources字段是json类型, 不能用于uniqueIndex, TODO: 代码中保证4个字段的uniqueIndex 不能只对belong_type和role_name两个字段设置uniqueIndex, 应为存在belong_type和role_name相同的情况(它们sub_resources不同)
func GetDefaultRolePmsList ¶
func GetDefaultRolePmsList(conds Conds) (resp []*PmsDefaultRole, err error)
func (*PmsDefaultRole) TableName ¶
func (t *PmsDefaultRole) TableName() string
type PmsRole ¶
type PmsRole struct { BaseModel Name string `gorm:"not null;type:varchar(64);column:name;comment:角色英文名,可修改,不唯一" json:"name"` Desc string `gorm:"not null;type:varchar(128);default:'';column:desc;comment:角色描述" json:"desc"` BelongResource string `` /* 133-byte string literal not displayed */ RoleType int `` /* 152-byte string literal not displayed */ ResourceId int `` /* 161-byte string literal not displayed */ Details []*PmsRoleDetail `gorm:"->" json:"details"` Refs []*PmsRoleRef `gorm:"->" json:"refs"` }
func PmsRoleInfo ¶
func PmsRoleInfoWithTgtRef ¶
func PmsRoleInfoWithTgtRef(roleId int, belongResource string, resourceId int) (resp *PmsRole, err error)
not contain grant info
func (*PmsRole) GenerateOnePRuleTplByDetail ¶
func (pr *PmsRole) GenerateOnePRuleTplByDetail(roleDetail *PmsRoleDetail) (resp string, err error)
GenerateOnePRuleTplByDetail : Generate a pType casbin policy string based on inputParam(PmsRoleDetail) returned resp(if not empty) like,
role__{{PmsRole:Id}}__{{PmsRole:BelongResource}}__{{ID}},{{PmsRole:BelongResource}}__{{ID}}__subResource__(SubResourceRegex),ActsRegex,*
func (*PmsRole) IsDetailsValid ¶
type PmsRoleDetail ¶
type PmsRoleDetail struct { BaseModel PmsRoleId int `gorm:"type:int(11);not null;column:pms_role_id;comment:所属pmsRole的id" json:"pmsRoleId"` SubResources Strings `gorm:"not null;type:json;column:sub_resources;comment:授权目标资源的子资源列表" json:"subResources"` Acts Strings `gorm:"not null;type:json;column:acts;comment:准许动作列表" json:"acts"` RuleTpl string `gorm:"not null;type:text;column:rule_tpl;comment:规则模板,用于生成casbin中的p类型规则" json:"-"` }
PmsRoleDetail uniqueIndex is not support for json column, please make sure (pms_role_id, sub_resources) is unique, and (pms_role_id, acts) is unique.
func (*PmsRoleDetail) TableName ¶
func (prd *PmsRoleDetail) TableName() string
type PmsRoleRef ¶
type PmsRoleRef struct { ID int `json:"id" gorm:"column:id;type:int;not null;primary_key;auto_increment"` PmsRoleId int `gorm:"not null;column:pms_role_id;uniqueIndex:uix_role_ref;comment:已存在的角色(pms_role)的Id" json:"pmsRoleId"` RefId int `gorm:"not null;column:ref_id;uniqueIndex:uix_role_ref;comment:角色belongResource类型对象的id" json:"refId"` Grants []*PmsRoleRefGrant `gorm:"->" json:"-"` }
PmsRoleRef the table to store the assignment states of every PmsRole. Note, add or delete one record, must create or remove corresponding p rules(which generated from details)
func GetPmsRoleRefInfo ¶
func GetPmsRoleRefInfo(conds egorm.Conds) (resp PmsRoleRef, err error)
func GetPmsRoleRefList ¶
func GetPmsRoleRefList(conds egorm.Conds, withGrants ...bool) (resp []*PmsRoleRef, err error)
GetPmsRoleRefList for resp, default do not contain grants info
func (*PmsRoleRef) TableName ¶
func (prf *PmsRoleRef) TableName() string
type PmsRoleRefGrant ¶
type PmsRoleRefGrant struct { ID int `gorm:"column:id;type:int;not null;primary_key;auto_increment" json:"id" ` PmsRoleRefId int `gorm:"not null;column:pms_role_ref_id;uniqueIndex:uix_ref_obj_domain;comment:所关联pms_role_ref的Id" json:"pmsRoleRefId"` Ptype string `` /* 135-byte string literal not displayed */ ObjectType string `` /* 155-byte string literal not displayed */ ObjectId int `gorm:"not null;column:object_id;uniqueIndex:uix_ref_obj_domain;comment:被授权对象的id" json:"objectId,omitempty"` DomainType string `` /* 164-byte string literal not displayed */ DomainId int `` /* 151-byte string literal not displayed */ }
PmsRoleRefGrant Note, all columns can NOT be modified after crated. if want to modify, please, remove and add again. add or delete record, must create or remove corresponding gType rules
func (*PmsRoleRefGrant) TableName ¶
func (prfg *PmsRoleRefGrant) TableName() string
type ReqAlarmWebhook ¶ added in v0.4.4
type ReqAlertSettingUpdate ¶ added in v0.4.3
type ReqAlertSettingUpdate struct { RuleStoreType int `json:"ruleStoreType" form:"ruleStoreType"` // rule_store_type 1 文件 2 集群 PrometheusTarget string `json:"prometheusTarget" form:"prometheusTarget"` // file FilePath string `json:"filePath" form:"filePath"` // k8s Namespace string `json:"namespace" form:"namespace"` Configmap string `json:"configmap" form:"configmap"` ClusterId int `json:"clusterId" form:"clusterId"` }
type ReqCreateCollect ¶ added in v0.4.4
type ReqCreateCollect struct { TableId int `json:"tableId" json:"tableId"` ReqUpdateCollect }
type ReqCreateMetricsSamples ¶ added in v0.4.4
type ReqListCollect ¶ added in v0.4.4
type ReqPage ¶
type ReqShortURLCreate ¶ added in v0.4.4
type ReqShortURLCreate struct {
OriginUrl string `json:"originUrl" form:"originUrl"`
}
type ReqUpdateCollect ¶ added in v0.4.4
type RespAlarmListRelatedInfo ¶ added in v0.4.3
type RespAlarmListRelatedInfo struct { Table BaseTable `json:"table"` Instance BaseInstance `json:"instance"` }
type RespAlertSettingInfo ¶ added in v0.4.3
type RespAlertSettingInfo struct { InstanceId int `json:"instanceId"` ReqAlertSettingUpdate }
type RespAlertSettingListItem ¶ added in v0.4.3
type RespAlertSettingListItem struct { InstanceId int `json:"instanceId"` InstanceName string `json:"instanceName"` RuleStoreType int `json:"ruleStoreType"` // rule_store_type 1 文件 2 集群 PrometheusTarget string `json:"prometheusTarget"` // check IsPrometheusOK int `json:"isPrometheusOK"` // 0 no 1 yes CheckPrometheusResult string `json:"checkPrometheusResult"` IsAlertManagerOK int `json:"isAlertManagerOK"` // 0 no 1 yes CheckAlertManagerResult string `json:"checkAlertManagerResult"` IsMetricsSamplesOk int `json:"isMetricsSamplesOk"` // 0 no 1 yes CheckMetricsSamplesResult string `json:"checkMetricsSamplesResult"` }
type RespAllEnums ¶
type RespEnumsOfSource ¶
type RespListCollect ¶ added in v0.4.4
type RespListCollect struct { Total int64 `json:"total"` List []*RespListCollectItem `json:"list"` }
type RespListCollectItem ¶ added in v0.4.4
type String2String ¶
func (*String2String) Scan ¶
func (t *String2String) Scan(input interface{}) error
type User ¶
type User struct { BaseModel Uid int `gorm:"-" json:"uid"` OaId int64 `gorm:"column:oa_id;type:bigint(20);NOT NULL" json:"oaId"` // oa_id Username string `gorm:"column:username;type:varchar(256);NOT NULL" json:"username"` // 用户名 Nickname string `gorm:"column:nickname;type:varchar(256);NOT NULL" json:"nickname"` // 昵称 Secret string `gorm:"column:secret;type:varchar(256);NOT NULL" json:"secret"` // 实例名称 Email string `gorm:"column:email;type:varchar(64);NOT NULL" json:"email"` // email Avatar string `gorm:"column:avatar;type:varchar(256);NOT NULL" json:"avatar"` // avatar Hash string `gorm:"column:hash;type:varchar(256);NOT NULL" json:"hash"` // hash WebUrl string `gorm:"column:web_url;type:varchar(256);NOT NULL" json:"webUrl"` // webUrl Oauth string `gorm:"column:oauth;type:varchar(256);NOT NULL" json:"oauth"` // oauth State string `gorm:"column:state;type:varchar(256);NOT NULL" json:"state"` // state OauthId string `gorm:"column:oauth_id;type:varchar(256);NOT NULL" json:"oauthId"` // oauthId Password string `gorm:"column:password;type:varchar(256);NOT NULL" json:"password"` // password CurrentAuthority string `gorm:"column:current_authority;type:varchar(256);NOT NULL" json:"currentAuthority"` // currentAuthority Access string `gorm:"column:access;type:varchar(256);NOT NULL" json:"access"` // access OauthToken OAuthToken `gorm:"column:oauth_token;type:text" json:"-"` // oauth_token }
func UserListPage ¶
UserListPage return item list by pagination