Documentation ¶
Index ¶
- Constants
- Variables
- func ApproveWorkflow(c echo.Context) error
- func BatchCancelWorkflows(c echo.Context) error
- func CancelWorkflow(c echo.Context) error
- func CheckInstanceAndRuleTemplateDbType(ruleTemplates []*model.RuleTemplate, instances ...*model.Instance) error
- func CheckInstanceCanBindOneRuleTemplate(ruleTemplates []string) bool
- func CheckInstanceIsConnectable(c echo.Context) error
- func CheckInstanceIsConnectableByName(c echo.Context) error
- func CheckRuleTemplateCanBeBindEachInstance(s *model.Storage, tplName string, instances []*model.Instance) error
- func CloneRuleTemplate(c echo.Context) error
- func CreateAndAuditTask(c echo.Context) error
- func CreateAuditPlan(c echo.Context) error
- func CreateAuditWhitelist(c echo.Context) error
- func CreateInstance(c echo.Context) error
- func CreateRole(c echo.Context) error
- func CreateRuleTemplate(c echo.Context) error
- func CreateUser(c echo.Context) error
- func CreateWorkflow(c echo.Context) error
- func CreateWorkflowTemplate(c echo.Context) error
- func Dashboard(c echo.Context) error
- func DeleteAuditPlan(c echo.Context) error
- func DeleteAuditWhitelistById(c echo.Context) error
- func DeleteInstance(c echo.Context) error
- func DeleteRole(c echo.Context) error
- func DeleteRuleTemplate(c echo.Context) error
- func DeleteUser(c echo.Context) error
- func DeleteWorkflowTemplate(c echo.Context) error
- func DownloadTaskSQLFile(c echo.Context) error
- func DownloadTaskSQLReportFile(c echo.Context) error
- func FormatStringToInt(s string) (ret int, err error)
- func FullSyncAuditPlanSQLs(c echo.Context) error
- func GetAuditPlan(c echo.Context) error
- func GetAuditPlanReportSQLs(c echo.Context) error
- func GetAuditPlanReports(c echo.Context) error
- func GetAuditPlanSQLs(c echo.Context) error
- func GetAuditPlans(c echo.Context) error
- func GetAuditTaskSQLContent(c echo.Context) error
- func GetCurrentUser(c echo.Context) error
- func GetDrivers(c echo.Context) error
- func GetInstance(c echo.Context) error
- func GetInstanceRules(c echo.Context) error
- func GetInstanceSchemas(c echo.Context) error
- func GetInstanceTips(c echo.Context) error
- func GetInstances(c echo.Context) error
- func GetLDAPConfiguration(c echo.Context) error
- func GetRoleTips(c echo.Context) error
- func GetRoles(c echo.Context) error
- func GetRuleTemplate(c echo.Context) error
- func GetRuleTemplateTips(c echo.Context) error
- func GetRuleTemplates(c echo.Context) error
- func GetRules(c echo.Context) error
- func GetSMTPConfiguration(c echo.Context) error
- func GetSqlWhitelist(c echo.Context) error
- func GetSystemVariables(c echo.Context) error
- func GetTask(c echo.Context) error
- func GetTaskSQLs(c echo.Context) error
- func GetUser(c echo.Context) error
- func GetUserTips(c echo.Context) error
- func GetUsers(c echo.Context) error
- func GetWorkflow(c echo.Context) error
- func GetWorkflowTemplate(c echo.Context) error
- func GetWorkflowTemplateTips(c echo.Context) error
- func GetWorkflowTemplates(c echo.Context) error
- func GetWorkflows(c echo.Context) error
- func Login(c echo.Context) error
- func PartialSyncAuditPlanSQLs(c echo.Context) error
- func RejectWorkflow(c echo.Context) error
- func TriggerAuditPlan(c echo.Context) error
- func UpdateAuditPlan(c echo.Context) error
- func UpdateAuditWhitelistById(c echo.Context) error
- func UpdateCurrentUser(c echo.Context) error
- func UpdateCurrentUserPassword(c echo.Context) error
- func UpdateInstance(c echo.Context) error
- func UpdateLDAPConfiguration(c echo.Context) error
- func UpdateOtherUserPassword(c echo.Context) error
- func UpdateRole(c echo.Context) error
- func UpdateRuleTemplate(c echo.Context) error
- func UpdateSMTPConfiguration(c echo.Context) error
- func UpdateSystemVariables(c echo.Context) error
- func UpdateUser(c echo.Context) error
- func UpdateWorkflow(c echo.Context) error
- func UpdateWorkflowTemplate(c echo.Context) error
- type AuditPlanReportResV1
- type AuditPlanReportSQLResV1
- type AuditPlanResV1
- type AuditPlanSQLReqV1
- type AuditPlanSQLResV1
- type AuditTaskResV1
- type AuditTaskSQLContentResV1
- type AuditTaskSQLResV1
- type AuditWhitelistResV1
- type BatchCancelWorkflowsReqV1
- type CloneRuleTemplateReqV1
- type CreateAuditPlanReqV1
- type CreateAuditTaskReqV1
- type CreateAuditWhitelistReqV1
- type CreateInstanceReqV1
- type CreateRoleReqV1
- type CreateRuleTemplateReqV1
- type CreateUserReqV1
- type CreateWorkflowReqV1
- type CreateWorkflowTemplateReqV1
- type DashboardResV1
- type DownloadAuditTaskSQLsFileReqV1
- type DriversResV1
- type FullSyncAuditPlanSQLsReqV1
- type GetAuditPlanReportSQLsReqV1
- type GetAuditPlanReportSQLsResV1
- type GetAuditPlanReportsReqV1
- type GetAuditPlanReportsResV1
- type GetAuditPlanResV1
- type GetAuditPlanSQLsReqV1
- type GetAuditPlanSQLsResV1
- type GetAuditPlansReqV1
- type GetAuditPlansResV1
- type GetAuditTaskResV1
- type GetAuditTaskSQLContentResV1
- type GetAuditTaskSQLsReqV1
- type GetAuditTaskSQLsResV1
- type GetAuditWhitelistReqV1
- type GetAuditWhitelistResV1
- type GetDashboardResV1
- type GetDriversResV1
- type GetInstanceConnectableReqV1
- type GetInstanceConnectableResV1
- type GetInstanceResV1
- type GetInstanceSchemaResV1
- type GetInstanceTipsResV1
- type GetInstancesReqV1
- type GetInstancesResV1
- type GetLDAPConfigurationResV1
- type GetRoleTipsResV1
- type GetRolesReqV1
- type GetRolesResV1
- type GetRuleTemplateResV1
- type GetRuleTemplateTipsResV1
- type GetRuleTemplatesReqV1
- type GetRuleTemplatesResV1
- type GetRulesReqV1
- type GetRulesResV1
- type GetSMTPConfigurationResV1
- type GetSystemVariablesResV1
- type GetUserDetailResV1
- type GetUserLoginResV1
- type GetUserTipsResV1
- type GetUsersReqV1
- type GetUsersResV1
- type GetWorkflowResV1
- type GetWorkflowTemplateResV1
- type GetWorkflowTemplateTipResV1
- type GetWorkflowTemplatesReqV1
- type GetWorkflowTemplatesResV1
- type GetWorkflowsReqV1
- type GetWorkflowsResV1
- type InstanceConnectableResV1
- type InstanceResV1
- type InstanceSchemaResV1
- type InstanceTipReqV1
- type InstanceTipResV1
- type LDAPConfigurationReqV1
- type LDAPConfigurationResV1
- type LoginChecker
- type PartialSyncAuditPlanSQLsReqV1
- type RejectWorkflowReqV1
- type RoleResV1
- type RoleTipResV1
- type RuleReqV1
- type RuleResV1
- type RuleTemplateDetailResV1
- type RuleTemplateResV1
- type RuleTemplateTipReqV1
- type RuleTemplateTipResV1
- type SMTPConfigurationResV1
- type SystemVariablesResV1
- type TriggerAuditPlanResV1
- type UpdateAuditPlanReqV1
- type UpdateAuditWhitelistReqV1
- type UpdateCurrentUserPasswordReqV1
- type UpdateCurrentUserReqV1
- type UpdateInstanceReqV1
- type UpdateOtherUserPasswordReqV1
- type UpdateRoleReqV1
- type UpdateRuleTemplateReqV1
- type UpdateSMTPConfigurationReqV1
- type UpdateSystemVariablesReqV1
- type UpdateUserReqV1
- type UpdateWorkflowReqV1
- type UpdateWorkflowTemplateReqV1
- type UserDetailResV1
- type UserLoginReqV1
- type UserLoginResV1
- type UserResV1
- type UserTipResV1
- type WorkFlowStepTemplateReqV1
- type WorkFlowStepTemplateResV1
- type WorkflowDetailResV1
- type WorkflowRecordResV1
- type WorkflowResV1
- type WorkflowStatisticsResV1
- type WorkflowStepResV1
- type WorkflowTemplateDetailResV1
- type WorkflowTemplateResV1
- type WorkflowTemplateTipResV1
Constants ¶
const ( InputSQLFileName = "input_sql_file" InputMyBatisXMLFileName = "input_mybatis_xml_file" )
Variables ¶
var ForbidMyBatisXMLTaskError = errors.New(errors.DataConflict, fmt.Errorf("the task for audit mybatis xml file is not allow to create workflow"))
var TaskNoAccessError = errors.New(errors.DataNotExist, fmt.Errorf("task is not exist or you can't access it"))
var WorkflowNoAccessError = errors.New(errors.DataNotExist, fmt.Errorf("worrkflow is not exist or you can't access it"))
Functions ¶
func ApproveWorkflow ¶
func ApproveWorkflow(c echo.Context) error
@Summary 审批通过 @Description approve workflow @Tags workflow @Id approveWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param workflow_step_id path string true "workflow step id" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/steps/{workflow_step_id}/approve [post]
func BatchCancelWorkflows ¶
func BatchCancelWorkflows(c echo.Context) error
BatchCancelWorkflows batch cancel workflows. @Summary 批量取消工单 @Description batch cancel workflows @Tags workflow @Id batchCancelWorkflowsV1 @Security ApiKeyAuth @Param BatchCancelWorkflowsReqV1 body v1.BatchCancelWorkflowsReqV1 true "batch cancel workflows request" @Success 200 {object} controller.BaseRes @router /v1/workflows/cancel [post]
func CancelWorkflow ¶
func CancelWorkflow(c echo.Context) error
@Summary 审批关闭(中止) @Description cancel workflow @Tags workflow @Id cancelWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/cancel [post]
func CheckInstanceAndRuleTemplateDbType ¶
func CheckInstanceAndRuleTemplateDbType(ruleTemplates []*model.RuleTemplate, instances ...*model.Instance) error
func CheckInstanceIsConnectable ¶
func CheckInstanceIsConnectable(c echo.Context) error
CheckInstanceIsConnectable test instance db connection @Summary 实例连通性测试(实例提交前) @Description test instance db connection 注:可直接提交创建实例接口的body,该接口的json 内容是创建实例的 json 的子集 @Accept json @Id checkInstanceIsConnectableV1 @Tags instance @Security ApiKeyAuth @Param instance body v1.GetInstanceConnectableReqV1 true "instance info" @Success 200 {object} v1.GetInstanceConnectableResV1 @router /v1/instance_connection [post]
func CheckInstanceIsConnectableByName ¶
func CheckInstanceIsConnectableByName(c echo.Context) error
CheckInstanceIsConnectableByName test instance db connection @Summary 实例连通性测试(实例提交后) @Description test instance db connection @Id checkInstanceIsConnectableByNameV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceConnectableResV1 @router /v1/instances/{instance_name}/connection [get]
func CloneRuleTemplate ¶
func CloneRuleTemplate(c echo.Context) error
@Summary 克隆规则模板 @Description clone a rule template @Id CloneRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Accept json @Param rule_template_name path string true "rule template name" @Param instance body v1.CloneRuleTemplateReqV1 true "clone rule template request" @Success 200 {object} controller.BaseRes @router /v1/rule_templates/{rule_template_name}/clone [post]
func CreateAndAuditTask ¶
func CreateAndAuditTask(c echo.Context) error
@Summary 创建Sql审核任务并提交审核 @Description create and audit a task, you can upload sql content in three ways, any one can be used, but only one is effective. @Description 1. formData[sql]: sql content; @Description 2. file[input_sql_file]: it is a sql file; @Description 3. file[input_mybatis_xml_file]: it is mybatis xml file, sql will be parsed from it. @Accept mpfd @Produce json @Tags task @Id createAndAuditTaskV1 @Security ApiKeyAuth @Param instance_name formData string true "instance name" @Param instance_schema formData string false "schema of instance" @Param sql formData string false "sqls for audit" @Param input_sql_file formData file false "input SQL file" @Param input_mybatis_xml_file formData file false "input mybatis XML file" @Success 200 {object} v1.GetAuditTaskResV1 @router /v1/tasks/audits [post]
func CreateAuditPlan ¶
func CreateAuditPlan(c echo.Context) error
@Summary 添加审核计划 @Description create audit plan @Id createAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Accept json @Param audit_plan body v1.CreateAuditPlanReqV1 true "create audit plan" @Success 200 {object} controller.BaseRes @router /v1/audit_plans [post]
func CreateAuditWhitelist ¶
func CreateAuditWhitelist(c echo.Context) error
@Summary 添加SQL白名单 @Description create a sql whitelist @Accept json @Id createAuditWhitelistV1 @Tags audit_whitelist @Security ApiKeyAuth @Param instance body v1.CreateAuditWhitelistReqV1 true "add sql whitelist req" @Success 200 {object} controller.BaseRes @router /v1/audit_whitelist [post]
func CreateInstance ¶
func CreateInstance(c echo.Context) error
CreateInstance create instance @Summary 添加实例 @Description create a instance @Id createInstanceV1 @Tags instance @Security ApiKeyAuth @Accept json @Param instance body v1.CreateInstanceReqV1 true "add instance" @Success 200 {object} controller.BaseRes @router /v1/instances [post]
func CreateRole ¶
func CreateRole(c echo.Context) error
@Summary 创建角色 @Description create role @Id createRoleV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.CreateRoleReqV1 true "create role" @Success 200 {object} controller.BaseRes @router /v1/roles [post]
func CreateRuleTemplate ¶
func CreateRuleTemplate(c echo.Context) error
@Summary 添加规则模板 @Description create a rule template @Id createRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Accept json @Param instance body v1.CreateRuleTemplateReqV1 true "add rule template request" @Success 200 {object} controller.BaseRes @router /v1/rule_templates [post]
func CreateUser ¶
func CreateUser(c echo.Context) error
@Summary 创建用户 @Description create user @Id createUserV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.CreateUserReqV1 true "create user" @Success 200 {object} controller.BaseRes @router /v1/users [post]
func CreateWorkflow ¶
func CreateWorkflow(c echo.Context) error
@Summary 创建工单 @Description create workflow @Accept json @Produce json @Tags workflow @Id createWorkflowV1 @Security ApiKeyAuth @Param instance body v1.CreateWorkflowReqV1 true "create workflow request" @Success 200 {object} controller.BaseRes @router /v1/workflows [post]
func CreateWorkflowTemplate ¶
func CreateWorkflowTemplate(c echo.Context) error
@Summary 创建Sql审批流程模板 @Description create a workflow template @Accept json @Produce json @Tags workflow @Id createWorkflowTemplateV1 @Security ApiKeyAuth @Param instance body v1.CreateWorkflowTemplateReqV1 true "create workflow template request" @Success 200 {object} controller.BaseRes @router /v1/workflow_templates [post]
func Dashboard ¶
func Dashboard(c echo.Context) error
@Summary 获取 dashboard 信息 @Description get dashboard info @Id getDashboardV1 @Tags dashboard @Security ApiKeyAuth @Produce json @Success 200 {object} v1.GetDashboardResV1 @router /v1/dashboard [get]
func DeleteAuditPlan ¶
func DeleteAuditPlan(c echo.Context) error
@Summary 删除审核计划 @Description delete audit plan @Id deleteAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/ [delete]
func DeleteAuditWhitelistById ¶
func DeleteAuditWhitelistById(c echo.Context) error
@Summary 删除SQL白名单信息 @Description remove sql white @Id deleteAuditWhitelistByIdV1 @Tags audit_whitelist @Security ApiKeyAuth @Param audit_whitelist_id path string true "audit whitelist id" @Success 200 {object} controller.BaseRes @router /v1/audit_whitelist/{audit_whitelist_id}/ [delete]
func DeleteInstance ¶
func DeleteInstance(c echo.Context) error
DeleteInstance delete instance @Summary 删除实例 @Description delete instance db @Id deleteInstanceV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} controller.BaseRes @router /v1/instances/{instance_name}/ [delete]
func DeleteRole ¶
func DeleteRole(c echo.Context) error
@Summary 删除角色 @Description delete role @Id deleteRoleV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param role_name path string true "role name" @Success 200 {object} controller.BaseRes @router /v1/roles/{role_name}/ [delete]
func DeleteRuleTemplate ¶
func DeleteRuleTemplate(c echo.Context) error
@Summary 删除规则模板 @Description delete rule template @Id deleteRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Param rule_template_name path string true "rule template name" @Success 200 {object} controller.BaseRes @router /v1/rule_templates/{rule_template_name}/ [delete]
func DeleteUser ¶
func DeleteUser(c echo.Context) error
@Summary 删除用户 @Description delete user @Id deleteUserV1 @Tags user @Security ApiKeyAuth @Param user_name path string true "user name" @Success 200 {object} controller.BaseRes @router /v1/users/{user_name}/ [delete]
func DeleteWorkflowTemplate ¶
func DeleteWorkflowTemplate(c echo.Context) error
@Summary 删除Sql审批流程模板 @Description update the workflow template @Tags workflow @Id deleteWorkflowTemplateV1 @Security ApiKeyAuth @Accept json @Produce json @Param workflow_template_name path string true "workflow template name" @Success 200 {object} controller.BaseRes @router /v1/workflow_templates/{workflow_template_name}/ [delete]
func DownloadTaskSQLFile ¶
func DownloadTaskSQLFile(c echo.Context) error
@Summary 下载指定审核任务的SQL文件 @Description download SQL file for the audit task @Tags task @Id downloadAuditTaskSQLFileV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Success 200 file 1 "sql file" @router /v1/tasks/audits/{task_id}/sql_file [get]
func DownloadTaskSQLReportFile ¶
func DownloadTaskSQLReportFile(c echo.Context) error
@Summary 下载指定审核任务的SQLs信息报告 @Description download report file of all SQLs information belong to the specified audit task @Tags task @Id downloadAuditTaskSQLReportV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Param no_duplicate query boolean false "select unique (fingerprint and audit result) for task sql" @Success 200 file 1 "sql report csv file" @router /v1/tasks/audits/{task_id}/sql_report [get]
func FormatStringToInt ¶
func FullSyncAuditPlanSQLs ¶
func FullSyncAuditPlanSQLs(c echo.Context) error
@Summary 全量同步SQL到审核计划 @Description full sync audit plan SQLs @Id fullSyncAuditPlanSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param sqls body v1.FullSyncAuditPlanSQLsReqV1 true "full sync audit plan SQLs request" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/sqls/full [post]
func GetAuditPlan ¶
func GetAuditPlan(c echo.Context) error
@Summary 获取指定审核计划 @Description get audit plan @Id getAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Success 200 {object} v1.GetAuditPlanResV1 @router /v1/audit_plans/{audit_plan_name}/ [get]
func GetAuditPlanReportSQLs ¶
func GetAuditPlanReportSQLs(c echo.Context) error
@Summary 获取指定审核计划的SQL审核详情 @Description get audit plan report SQLs @Id getAuditPlanReportSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param audit_plan_report_id path string true "audit plan report id" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlanReportSQLsResV1 @router /v1/audit_plans/{audit_plan_name}/report/{audit_plan_report_id}/ [get]
func GetAuditPlanReports ¶
func GetAuditPlanReports(c echo.Context) error
@Summary 获取指定审核计划的报告列表 @Description get audit plan report list @Id getAuditPlanReportsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlanReportsResV1 @router /v1/audit_plans/{audit_plan_name}/reports [get]
func GetAuditPlanSQLs ¶
func GetAuditPlanSQLs(c echo.Context) error
@Summary 获取指定审核计划的SQLs信息(不包括审核结果) @Description get audit plan SQLs @Id getAuditPlanSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlanSQLsResV1 @router /v1/audit_plans/{audit_plan_name}/sqls [get]
func GetAuditPlans ¶
func GetAuditPlans(c echo.Context) error
@Summary 获取审核计划信息列表 @Description get audit plan info list @Id getAuditPlansV1 @Tags audit_plan @Security ApiKeyAuth @Param filter_audit_plan_db_type query string false "filter audit plan db type" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetAuditPlansResV1 @router /v1/audit_plans [get]
func GetAuditTaskSQLContent ¶
func GetAuditTaskSQLContent(c echo.Context) error
@Summary 获取指定审核任务的SQL内容 @Description get SQL content for the audit task @Tags task @Id getAuditTaskSQLContentV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Success 200 {object} v1.GetAuditTaskSQLContentResV1 @router /v1/tasks/audits/{task_id}/sql_content [get]
func GetCurrentUser ¶
func GetCurrentUser(c echo.Context) error
@Summary 获取当前用户信息 @Description get current user info @Id getCurrentUserV1 @Tags user @Security ApiKeyAuth @Success 200 {object} v1.GetUserDetailResV1 @router /v1/user [get]
func GetDrivers ¶
func GetDrivers(c echo.Context) error
GetDrivers get support Driver list. @Summary 获取当前 server 支持的审核类型 @Description get drivers @Id getDriversV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetDriversResV1 @router /v1/configurations/drivers [get]
func GetInstance ¶
func GetInstance(c echo.Context) error
GetInstance get instance @Summary 获取实例信息 @Description get instance db @Id getInstanceV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceResV1 @router /v1/instances/{instance_name}/ [get]
func GetInstanceRules ¶
func GetInstanceRules(c echo.Context) error
GetInstanceRules get instance all rule @Summary 获取实例应用的规则列表 @Description get instance all rule @Id getInstanceRuleListV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetRulesResV1 @router /v1/instances/{instance_name}/rules [get]
func GetInstanceSchemas ¶
func GetInstanceSchemas(c echo.Context) error
GetInstanceSchemas get instance schema list @Summary 实例 Schema 列表 @Description instance schema list @Id getInstanceSchemasV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @Success 200 {object} v1.GetInstanceSchemaResV1 @router /v1/instances/{instance_name}/schemas [get]
func GetInstanceTips ¶
func GetInstanceTips(c echo.Context) error
GetInstanceTips get instance tip list @Summary 获取实例提示列表 @Description get instance tip list @Tags instance @Id getInstanceTipListV1 @Security ApiKeyAuth @Param filter_db_type query string false "filter db type" @Success 200 {object} v1.GetInstanceTipsResV1 @router /v1/instance_tips [get]
func GetInstances ¶
func GetInstances(c echo.Context) error
GetInstances get instances @Summary 获取实例信息列表 @Description get instance info list @Id getInstanceListV1 @Tags instance @Security ApiKeyAuth @Param filter_instance_name query string false "filter instance name" @Param filter_db_type query string false "filter db type" @Param filter_db_host query string false "filter db host" @Param filter_db_port query string false "filter db port" @Param filter_db_user query string false "filter db user" @Param filter_workflow_template_name query string false "filter workflow rule template name" @Param filter_rule_template_name query string false "filter rule template name" @Param filter_role_name query string false "filter role name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetInstancesResV1 @router /v1/instances [get]
func GetLDAPConfiguration ¶ added in v1.2111.0
func GetLDAPConfiguration(c echo.Context) error
@Summary 获取 LDAP 配置 @Description get LDAP configuration @Id getLDAPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetLDAPConfigurationResV1 @router /v1/configurations/ldap [get]
func GetRoleTips ¶
func GetRoleTips(c echo.Context) error
@Summary 获取角色提示列表 @Description get role tip list @Tags role @Id getRoleTipListV1 @Security ApiKeyAuth @Success 200 {object} v1.GetRoleTipsResV1 @router /v1/role_tips [get]
func GetRoles ¶
func GetRoles(c echo.Context) error
@Summary 获取角色列表 @Description get role list @Id getRoleListV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param filter_role_name query string false "filter role name" @Param filter_user_name query string false "filter user name" @Param filter_instance_name query string false "filter instance name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetRolesResV1 @router /v1/roles [get]
func GetRuleTemplate ¶
func GetRuleTemplate(c echo.Context) error
@Summary 获取规则模板信息 @Description get rule template @Id getRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Param rule_template_name path string true "rule template name" @Success 200 {object} v1.GetRuleTemplateResV1 @router /v1/rule_templates/{rule_template_name}/ [get]
func GetRuleTemplateTips ¶
func GetRuleTemplateTips(c echo.Context) error
@Summary 获取规则模板提示 @Description get rule template tips @Id getRuleTemplateTipsV1 @Tags rule_template @Security ApiKeyAuth @Param filter_db_type query string false "filter db type" @Success 200 {object} v1.GetRuleTemplateTipsResV1 @router /v1/rule_template_tips [get]
func GetRuleTemplates ¶
func GetRuleTemplates(c echo.Context) error
@Summary 规则模板列表 @Description get all rule template @Id getRuleTemplateListV1 @Tags rule_template @Security ApiKeyAuth @Param filter_instance_name query string false "filter instance name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetRuleTemplatesResV1 @router /v1/rule_templates [get]
func GetRules ¶
func GetRules(c echo.Context) error
@Summary 规则列表 @Description get all rule template @Id getRuleListV1 @Tags rule_template @Security ApiKeyAuth @Param filter_db_type query string false "filter db type" @Success 200 {object} v1.GetRulesResV1 @router /v1/rules [get]
func GetSMTPConfiguration ¶
func GetSMTPConfiguration(c echo.Context) error
@Summary 获取 SMTP 配置 @Description get SMTP configuration @Id getSMTPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetSMTPConfigurationResV1 @router /v1/configurations/smtp [get]
func GetSqlWhitelist ¶
func GetSqlWhitelist(c echo.Context) error
@Summary 获取Sql审核白名单 @Description get all whitelist @Id getAuditWhitelistV1 @Tags audit_whitelist @Security ApiKeyAuth @Param page_index query string false "page index" @Param page_size query string false "page size" @Success 200 {object} v1.GetAuditWhitelistResV1 @router /v1/audit_whitelist [get]
func GetSystemVariables ¶
func GetSystemVariables(c echo.Context) error
@Summary 获取系统变量 @Description get system variables @Id getSystemVariablesV1 @Tags configuration @Security ApiKeyAuth @Success 200 {object} v1.GetSystemVariablesResV1 @router /v1/configurations/system_variables [get]
func GetTask ¶
func GetTask(c echo.Context) error
@Summary 获取Sql审核任务信息 @Description get task @Tags task @Id getAuditTaskV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Success 200 {object} v1.GetAuditTaskResV1 @router /v1/tasks/audits/{task_id}/ [get]
func GetTaskSQLs ¶
func GetTaskSQLs(c echo.Context) error
@Summary 获取指定审核任务的SQLs信息 @Description get information of all SQLs belong to the specified audit task @Tags task @Id getAuditTaskSQLsV1 @Security ApiKeyAuth @Param task_id path string true "task id" @Param filter_exec_status query string false "filter: exec status of task sql" Enums(initialized,doing,succeeded,failed) @Param filter_audit_status query string false "filter: audit status of task sql" Enums(initialized,doing,finished) @Param no_duplicate query boolean false "select unique (fingerprint and audit result) for task sql" @Param page_index query string false "page index" @Param page_size query string false "page size" @Success 200 {object} v1.GetAuditTaskSQLsResV1 @router /v1/tasks/audits/{task_id}/sqls [get]
func GetUser ¶
func GetUser(c echo.Context) error
@Summary 获取用户信息 @Description get user info @Id getUserV1 @Tags user @Security ApiKeyAuth @Param user_name path string true "user name" @Success 200 {object} v1.GetUserDetailResV1 @router /v1/users/{user_name}/ [get]
func GetUserTips ¶
func GetUserTips(c echo.Context) error
@Summary 获取用户提示列表 @Description get user tip list @Tags user @Id getUserTipListV1 @Security ApiKeyAuth @Success 200 {object} v1.GetUserTipsResV1 @router /v1/user_tips [get]
func GetUsers ¶
func GetUsers(c echo.Context) error
@Summary 获取用户信息列表 @Description get user info list @Tags user @Id getUserListV1 @Security ApiKeyAuth @Param filter_user_name query string false "filter user name" @Param filter_role_name query string false "filter role name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetUsersResV1 @router /v1/users [get]
func GetWorkflow ¶
func GetWorkflow(c echo.Context) error
@Summary 获取审批流程详情 @Description get workflow detail @Tags workflow @Id getWorkflowV1 @Security ApiKeyAuth @Param workflow_id path integer true "workflow id" @Success 200 {object} v1.GetWorkflowResV1 @router /v1/workflows/{workflow_id}/ [get]
func GetWorkflowTemplate ¶
func GetWorkflowTemplate(c echo.Context) error
@Summary 获取审批流程模板详情 @Description get workflow template detail @Tags workflow @Id getWorkflowTemplateV1 @Security ApiKeyAuth @Param workflow_template_name path string true "workflow template name" @Success 200 {object} v1.GetWorkflowTemplateResV1 @router /v1/workflow_templates/{workflow_template_name}/ [get]
func GetWorkflowTemplateTips ¶
func GetWorkflowTemplateTips(c echo.Context) error
@Summary 获取审批流程模板提示信息 @Description get workflow template tips @Tags workflow @Id getWorkflowTemplateTipsV1 @Security ApiKeyAuth @Success 200 {object} v1.GetWorkflowTemplateTipResV1 @router /v1/workflow_template_tips [get]
func GetWorkflowTemplates ¶
func GetWorkflowTemplates(c echo.Context) error
@Summary 获取审批流程模板列表 @Description get workflow template list @Tags workflow @Id getWorkflowTemplateListV1 @Security ApiKeyAuth @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetWorkflowTemplatesResV1 @router /v1/workflow_templates [get]
func GetWorkflows ¶
func GetWorkflows(c echo.Context) error
@Summary 获取审批流程列表 @Description get workflow list @Tags workflow @Id getWorkflowListV1 @Security ApiKeyAuth @Param filter_subject query string false "filter subject" @Param filter_create_time_from query string false "filter create time from" @Param filter_create_time_to query string false "filter create time to" @Param filter_create_user_name query string false "filter create user name" @Param filter_current_step_type query string false "filter current step type" Enums(sql_review, sql_execute) @Param filter_status query string false "filter workflow status" Enums(on_process, finished, rejected, canceled) @Param filter_current_step_assignee_user_name query string false "filter current step assignee user name" @Param filter_task_status query string false "filter task status" Enums(initialized, audited, executing, exec_succeeded, exec_failed) @Param filter_task_instance_name query string false "filter instance name" @Param page_index query uint32 false "page index" @Param page_size query uint32 false "size of per page" @Success 200 {object} v1.GetWorkflowsResV1 @router /v1/workflows [get]
func Login ¶
func Login(c echo.Context) error
@Summary 用户登录 @Description user login @Tags user @Id loginV1 @Param user body v1.UserLoginReqV1 true "user login request" @Success 200 {object} v1.GetUserLoginResV1 @router /v1/login [post]
func PartialSyncAuditPlanSQLs ¶
func PartialSyncAuditPlanSQLs(c echo.Context) error
@Summary 增量同步SQL到审核计划 @Description partial sync audit plan SQLs @Id partialSyncAuditPlanSQLsV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Param sqls body v1.PartialSyncAuditPlanSQLsReqV1 true "partial sync audit plan SQLs request" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/sqls/partial [post]
func RejectWorkflow ¶
func RejectWorkflow(c echo.Context) error
@Summary 审批驳回 @Description reject workflow @Tags workflow @Id rejectWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param workflow_step_id path string true "workflow step id" @param workflow_approve body v1.RejectWorkflowReqV1 true "workflow approve request" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/steps/{workflow_step_id}/reject [post]
func TriggerAuditPlan ¶
func TriggerAuditPlan(c echo.Context) error
@Summary 触发审核计划 @Description trigger audit plan @Id triggerAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @Success 200 {object} v1.TriggerAuditPlanResV1 @router /v1/audit_plans/{audit_plan_name}/trigger [post]
func UpdateAuditPlan ¶
func UpdateAuditPlan(c echo.Context) error
@Summary 更新审核计划 @Description update audit plan @Id updateAuditPlanV1 @Tags audit_plan @Security ApiKeyAuth @Param audit_plan_name path string true "audit plan name" @param audit_plan body v1.UpdateAuditPlanReqV1 true "update audit plan" @Success 200 {object} controller.BaseRes @router /v1/audit_plans/{audit_plan_name}/ [patch]
func UpdateAuditWhitelistById ¶
func UpdateAuditWhitelistById(c echo.Context) error
@Summary 更新SQL白名单 @Description update sql whitelist by id @Accept json @Id UpdateAuditWhitelistByIdV1 @Tags audit_whitelist @Security ApiKeyAuth @Param audit_whitelist_id path string true "sql audit whitelist id" @Param instance body v1.UpdateAuditWhitelistReqV1 true "update sql whitelist req" @Success 200 {object} controller.BaseRes @router /v1/audit_whitelist/{audit_whitelist_id}/ [patch]
func UpdateCurrentUser ¶
func UpdateCurrentUser(c echo.Context) error
@Summary 更新个人信息 @Description update current user @Id updateCurrentUserV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.UpdateCurrentUserReqV1 true "update user" @Success 200 {object} controller.BaseRes @router /v1/user [patch]
func UpdateCurrentUserPassword ¶
func UpdateCurrentUserPassword(c echo.Context) error
@Summary 用户修改密码 @Description update current user's password @Id UpdateCurrentUserPasswordV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param instance body v1.UpdateCurrentUserPasswordReqV1 true "update user's password" @Success 200 {object} controller.BaseRes @router /v1/user/password [put]
func UpdateInstance ¶
func UpdateInstance(c echo.Context) error
UpdateInstance update instance @Summary 更新实例 @Description update instance @Id updateInstanceV1 @Tags instance @Security ApiKeyAuth @Param instance_name path string true "instance name" @param instance body v1.UpdateInstanceReqV1 true "update instance request" @Success 200 {object} controller.BaseRes @router /v1/instances/{instance_name}/ [patch]
func UpdateLDAPConfiguration ¶ added in v1.2111.0
func UpdateLDAPConfiguration(c echo.Context) error
@Summary 添加 LDAP 配置 @Description update LDAP configuration @Accept json @Id updateLDAPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.LDAPConfigurationReqV1 true "update LDAP configuration req" @Success 200 {object} controller.BaseRes @router /v1/configurations/ldap [patch]
func UpdateOtherUserPassword ¶
func UpdateOtherUserPassword(c echo.Context) error
@Summary admin修改其他用户密码 @Description admin modifies the passwords of other users @Id UpdateOtherUserPasswordV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param user_name path string true "user name" @Param instance body v1.UpdateOtherUserPasswordReqV1 true "change user's password" @Success 200 {object} controller.BaseRes @router /v1/users/{user_name}/password [patch]
func UpdateRole ¶
func UpdateRole(c echo.Context) error
@Summary 更新角色信息 @Description update role @Id updateRoleV1 @Tags role @Security ApiKeyAuth @Accept json @Produce json @Param role_name path string true "role name" @Param instance body v1.UpdateRoleReqV1 true "update role request" @Success 200 {object} controller.BaseRes @router /v1/roles/{role_name}/ [patch]
func UpdateRuleTemplate ¶
func UpdateRuleTemplate(c echo.Context) error
@Summary 更新规则模板 @Description update rule template @Id updateRuleTemplateV1 @Tags rule_template @Security ApiKeyAuth @Param rule_template_name path string true "rule template name" @Param instance body v1.UpdateRuleTemplateReqV1 true "update rule template request" @Success 200 {object} controller.BaseRes @router /v1/rule_templates/{rule_template_name}/ [patch]
func UpdateSMTPConfiguration ¶
func UpdateSMTPConfiguration(c echo.Context) error
@Summary 添加 SMTP 配置 @Description update SMTP configuration @Accept json @Id updateSMTPConfigurationV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.UpdateSMTPConfigurationReqV1 true "update SMTP configuration req" @Success 200 {object} controller.BaseRes @router /v1/configurations/smtp [patch]
func UpdateSystemVariables ¶
func UpdateSystemVariables(c echo.Context) error
@Summary 修改系统变量 @Description update system variables @Accept json @Id updateSystemVariablesV1 @Tags configuration @Security ApiKeyAuth @Param instance body v1.UpdateSystemVariablesReqV1 true "update system variables request" @Success 200 {object} controller.BaseRes @router /v1/configurations/system_variables [patch]
func UpdateUser ¶
func UpdateUser(c echo.Context) error
@Summary 更新用户信息 @Description update user @Id updateUserV1 @Tags user @Security ApiKeyAuth @Accept json @Produce json @Param user_name path string true "user name" @Param instance body v1.UpdateUserReqV1 true "update user" @Success 200 {object} controller.BaseRes @router /v1/users/{user_name}/ [patch]
func UpdateWorkflow ¶
func UpdateWorkflow(c echo.Context) error
@Summary 更新审批流程(驳回后才可更新) @Description update workflow when it is rejected to creator. @Tags workflow @Accept json @Produce json @Id updateWorkflowV1 @Security ApiKeyAuth @Param workflow_id path string true "workflow id" @Param instance body v1.UpdateWorkflowReqV1 true "update workflow request" @Success 200 {object} controller.BaseRes @router /v1/workflows/{workflow_id}/ [patch]
func UpdateWorkflowTemplate ¶
func UpdateWorkflowTemplate(c echo.Context) error
@Summary 更新Sql审批流程模板 @Description update the workflow template @Tags workflow @Id updateWorkflowTemplateV1 @Security ApiKeyAuth @Accept json @Produce json @Param workflow_template_name path string true "workflow template name" @Param instance body v1.UpdateWorkflowTemplateReqV1 true "create workflow template" @Success 200 {object} controller.BaseRes @router /v1/workflow_templates/{workflow_template_name}/ [patch]
Types ¶
type AuditPlanReportResV1 ¶
type AuditPlanReportSQLResV1 ¶
type AuditPlanReportSQLResV1 struct { Fingerprint string `json:"audit_plan_report_sql_fingerprint" example:"select * from t1 where id = ?"` LastReceiveText string `json:"audit_plan_report_sql_last_receive_text" example:"select * from t1 where id = 1"` LastReceiveTimestamp string `json:"audit_plan_report_sql_last_receive_timestamp" example:"RFC3339"` AuditResult string `json:"audit_plan_report_sql_audit_result" example:"same format as task audit result"` }
type AuditPlanResV1 ¶
type AuditPlanResV1 struct { Name string `json:"audit_plan_name" example:"audit_for_java_app1"` Cron string `json:"audit_plan_cron" example:"0 */2 * * *"` DBType string `json:"audit_plan_db_type" example:"mysql"` Token string `json:"audit_plan_token" example:"it's a JWT Token for scanner"` InstanceName string `json:"audit_plan_instance_name" example:"test_mysql"` InstanceDatabase string `json:"audit_plan_instance_database" example:"app1"` }
type AuditPlanSQLReqV1 ¶
type AuditPlanSQLReqV1 struct { Fingerprint string `json:"audit_plan_sql_fingerprint" form:"audit_plan_sql_fingerprint" example:"select * from t1 where id = ?" valid:"required"` Counter string `json:"audit_plan_sql_counter" form:"audit_plan_sql_counter" example:"6" valid:"required"` LastReceiveText string `json:"audit_plan_sql_last_receive_text" form:"audit_plan_sql_last_receive_text" example:"select * from t1 where id = 1"` LastReceiveTimestamp string `json:"audit_plan_sql_last_receive_timestamp" form:"audit_plan_sql_last_receive_timestamp" example:"RFC3339"` }
type AuditPlanSQLResV1 ¶
type AuditPlanSQLResV1 struct { Fingerprint string `json:"audit_plan_sql_fingerprint" example:"select * from t1 where id = ?"` Counter string `json:"audit_plan_sql_counter" example:"6"` LastReceiveText string `json:"audit_plan_sql_last_receive_text" example:"select * from t1 where id = 1"` LastReceiveTimestamp string `json:"audit_plan_sql_last_receive_timestamp" example:"RFC3339"` }
type AuditTaskResV1 ¶
type AuditTaskResV1 struct { Id uint `json:"task_id"` InstanceName string `json:"instance_name"` InstanceSchema string `json:"instance_schema" example:"db1"` PassRate float64 `json:"pass_rate"` Status string `json:"status" enums:"initialized,audited,executing,exec_success,exec_failed"` SQLSource string `json:"sql_source" enums:"form_data,sql_file,mybatis_xml_file,audit_plan"` }
type AuditTaskSQLContentResV1 ¶
type AuditTaskSQLContentResV1 struct {
Sql string `json:"sql" example:"alter table tb1 drop columns c1"`
}
type AuditTaskSQLResV1 ¶
type AuditTaskSQLResV1 struct { Number uint `json:"number"` ExecSQL string `json:"exec_sql"` AuditResult string `json:"audit_result"` AuditLevel string `json:"audit_level"` AuditStatus string `json:"audit_status"` ExecResult string `json:"exec_result"` ExecStatus string `json:"exec_status"` RollbackSQL string `json:"rollback_sql,omitempty"` }
type AuditWhitelistResV1 ¶
type BatchCancelWorkflowsReqV1 ¶
type BatchCancelWorkflowsReqV1 struct {
WorkflowIds []string `json:"workflow_ids" form:"workflow_ids"`
}
type CloneRuleTemplateReqV1 ¶
type CreateAuditPlanReqV1 ¶
type CreateAuditPlanReqV1 struct { Name string `json:"audit_plan_name" form:"audit_plan_name" example:"audit_plan_for_java_repo_1" valid:"required,name"` Cron string `json:"audit_plan_cron" form:"audit_plan_cron" example:"0 */2 * * *" valid:"required,cron"` InstanceType string `json:"audit_plan_instance_type" form:"audit_plan_instance_type" example:"mysql" valid:"required"` InstanceName string `json:"audit_plan_instance_name" form:"audit_plan_instance_name" example:"test_mysql"` InstanceDatabase string `json:"audit_plan_instance_database" form:"audit_plan_instance_database" example:"app1"` }
type CreateAuditTaskReqV1 ¶
type CreateAuditWhitelistReqV1 ¶
type CreateAuditWhitelistReqV1 struct { Value string `json:"value" example:"create table" valid:"required"` MatchType string `json:"match_type" example:"exact_match" enums:"exact_match,fp_match" valid:"omitempty,oneof=exact_match fp_match"` Desc string `json:"desc" example:"used for rapid release"` }
type CreateInstanceReqV1 ¶
type CreateInstanceReqV1 struct { Name string `json:"instance_name" form:"instance_name" example:"test" valid:"required,name"` DBType string `json:"db_type" form:"db_type" example:"mysql"` User string `json:"db_user" form:"db_user" example:"root" valid:"required"` Host string `json:"db_host" form:"db_host" example:"10.10.10.10" valid:"required,ipv4"` Port string `json:"db_port" form:"db_port" example:"3306" valid:"required,port"` Password string `json:"db_password" form:"db_password" example:"123456" valid:"required"` Desc string `json:"desc" example:"this is a test instance"` WorkflowTemplateName string `json:"workflow_template_name" form:"workflow_template_name"` RuleTemplates []string `json:"rule_template_name_list" form:"rule_template_name_list"` Roles []string `json:"role_name_list" form:"role_name_list"` }
type CreateRoleReqV1 ¶
type CreateRuleTemplateReqV1 ¶
type CreateRuleTemplateReqV1 struct { Name string `json:"rule_template_name" valid:"required,name"` Desc string `json:"desc"` DBType string `json:"db_type" valid:"required"` Instances []string `json:"instance_name_list"` RuleList []RuleReqV1 `json:"rule_list" form:"rule_list" valid:"required,dive,required"` }
type CreateUserReqV1 ¶
type CreateUserReqV1 struct { Name string `json:"user_name" form:"user_name" example:"test" valid:"required,name"` Password string `json:"user_password" form:"user_name" example:"123456" valid:"required"` Email string `json:"email" form:"email" example:"test@email.com" valid:"omitempty,email"` Roles []string `json:"role_name_list" form:"role_name_list"` }
type CreateWorkflowReqV1 ¶
type CreateWorkflowTemplateReqV1 ¶
type CreateWorkflowTemplateReqV1 struct { Name string `json:"workflow_template_name" form:"workflow_template_name" valid:"required,name"` Desc string `json:"desc" form:"desc"` Steps []*WorkFlowStepTemplateReqV1 `json:"workflow_step_template_list" form:"workflow_step_template_list" valid:"required,dive,required"` Instances []string `json:"instance_name_list" form:"instance_name_list"` }
type DashboardResV1 ¶
type DashboardResV1 struct {
WorkflowStatistics *WorkflowStatisticsResV1 `json:"workflow_statistics"`
}
type DownloadAuditTaskSQLsFileReqV1 ¶
type DownloadAuditTaskSQLsFileReqV1 struct {
NoDuplicate bool `json:"no_duplicate" query:"no_duplicate"`
}
type DriversResV1 ¶
type DriversResV1 struct {
Drivers []string `json:"driver_name_list"`
}
type FullSyncAuditPlanSQLsReqV1 ¶
type FullSyncAuditPlanSQLsReqV1 struct {
SQLs []AuditPlanSQLReqV1 `json:"audit_plan_sql_list" form:"audit_plan_sql_list"`
}
type GetAuditPlanReportSQLsResV1 ¶
type GetAuditPlanReportSQLsResV1 struct { controller.BaseRes Data []AuditPlanReportSQLResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetAuditPlanReportsResV1 ¶
type GetAuditPlanReportsResV1 struct { controller.BaseRes Data []AuditPlanReportResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetAuditPlanResV1 ¶
type GetAuditPlanResV1 struct { controller.BaseRes Data AuditPlanResV1 `json:"data"` }
type GetAuditPlanSQLsReqV1 ¶
type GetAuditPlanSQLsResV1 ¶
type GetAuditPlanSQLsResV1 struct { controller.BaseRes Data []AuditPlanSQLResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetAuditPlansReqV1 ¶
type GetAuditPlansResV1 ¶
type GetAuditPlansResV1 struct { controller.BaseRes Data []AuditPlanResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetAuditTaskResV1 ¶
type GetAuditTaskResV1 struct { controller.BaseRes Data *AuditTaskResV1 `json:"data"` }
type GetAuditTaskSQLContentResV1 ¶
type GetAuditTaskSQLContentResV1 struct { controller.BaseRes Data *AuditTaskSQLContentResV1 `json:"data"` }
type GetAuditTaskSQLsReqV1 ¶
type GetAuditTaskSQLsReqV1 struct { FilterExecStatus string `json:"filter_exec_status" query:"filter_exec_status"` FilterAuditStatus string `json:"filter_audit_status" query:"filter_audit_status"` NoDuplicate bool `json:"no_duplicate" query:"no_duplicate"` PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"` PageSize uint32 `json:"page_size" query:"page_size" valid:"required"` }
type GetAuditTaskSQLsResV1 ¶
type GetAuditTaskSQLsResV1 struct { controller.BaseRes Data []*AuditTaskSQLResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetAuditWhitelistReqV1 ¶
type GetAuditWhitelistResV1 ¶
type GetAuditWhitelistResV1 struct { controller.BaseRes Data []*AuditWhitelistResV1 `json:"data"` TotalNums uint32 `json:"total_nums"` }
type GetDashboardResV1 ¶
type GetDashboardResV1 struct { controller.BaseRes Data *DashboardResV1 `json:"data"` }
type GetDriversResV1 ¶
type GetDriversResV1 struct { controller.BaseRes Data DriversResV1 `json:"data"` }
type GetInstanceConnectableReqV1 ¶
type GetInstanceConnectableReqV1 struct { DBType string `json:"db_type" form:"db_type" example:"mysql"` User string `json:"user" form:"db_user" example:"root" valid:"required"` Host string `json:"host" form:"db_host" example:"10.10.10.10" valid:"required,ipv4"` Port string `json:"port" form:"db_port" example:"3306" valid:"required,port"` Password string `json:"password" form:"db_password" example:"123456"` }
type GetInstanceConnectableResV1 ¶
type GetInstanceConnectableResV1 struct { controller.BaseRes Data InstanceConnectableResV1 `json:"data"` }
type GetInstanceResV1 ¶
type GetInstanceResV1 struct { controller.BaseRes Data InstanceResV1 `json:"data"` }
type GetInstanceSchemaResV1 ¶
type GetInstanceSchemaResV1 struct { controller.BaseRes Data InstanceSchemaResV1 `json:"data"` }
type GetInstanceTipsResV1 ¶
type GetInstanceTipsResV1 struct { controller.BaseRes Data []InstanceTipResV1 `json:"data"` }
type GetInstancesReqV1 ¶
type GetInstancesReqV1 struct { FilterInstanceName string `json:"filter_instance_name" query:"filter_instance_name"` FilterDBType string `json:"filter_db_type" query:"filter_db_type"` FilterDBHost string `json:"filter_db_host" query:"filter_db_host"` FilterDBPort string `json:"filter_db_port" query:"filter_db_port"` FilterDBUser string `json:"filter_db_user" query:"filter_db_user"` FilterWorkflowTemplateName string `json:"filter_workflow_template_name" query:"filter_workflow_template_name"` FilterRuleTemplateName string `json:"filter_rule_template_name" query:"filter_rule_template_name"` FilterRoleName string `json:"filter_role_name" query:"filter_role_name"` PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"` PageSize uint32 `json:"page_size" query:"page_size" valid:"required"` }
type GetInstancesResV1 ¶
type GetInstancesResV1 struct { controller.BaseRes Data []InstanceResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetLDAPConfigurationResV1 ¶ added in v1.2111.0
type GetLDAPConfigurationResV1 struct { controller.BaseRes Data LDAPConfigurationResV1 `json:"data"` }
type GetRoleTipsResV1 ¶
type GetRoleTipsResV1 struct { controller.BaseRes Data []RoleTipResV1 `json:"data"` }
type GetRolesReqV1 ¶
type GetRolesReqV1 struct { FilterRoleName string `json:"filter_role_name" query:"filter_role_name"` FilterUserName string `json:"filter_user_name" query:"filter_user_name"` FilterInstanceName string `json:"filter_instance_name" query:"filter_instance_name"` PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"` PageSize uint32 `json:"page_size" query:"page_size" valid:"required"` }
type GetRolesResV1 ¶
type GetRolesResV1 struct { controller.BaseRes Data []RoleResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetRuleTemplateResV1 ¶
type GetRuleTemplateResV1 struct { controller.BaseRes Data *RuleTemplateDetailResV1 `json:"data"` }
type GetRuleTemplateTipsResV1 ¶
type GetRuleTemplateTipsResV1 struct { controller.BaseRes Data []RuleTemplateTipResV1 `json:"data"` }
type GetRuleTemplatesReqV1 ¶
type GetRuleTemplatesResV1 ¶
type GetRuleTemplatesResV1 struct { controller.BaseRes Data []RuleTemplateResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetRulesReqV1 ¶
type GetRulesReqV1 struct {
FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
}
type GetRulesResV1 ¶
type GetRulesResV1 struct { controller.BaseRes Data []RuleResV1 `json:"data"` }
type GetSMTPConfigurationResV1 ¶
type GetSMTPConfigurationResV1 struct { controller.BaseRes Data SMTPConfigurationResV1 `json:"data"` }
type GetSystemVariablesResV1 ¶
type GetSystemVariablesResV1 struct { controller.BaseRes Data SystemVariablesResV1 `json:"data"` }
type GetUserDetailResV1 ¶
type GetUserDetailResV1 struct { controller.BaseRes Data UserDetailResV1 `json:"data"` }
type GetUserLoginResV1 ¶
type GetUserLoginResV1 struct { controller.BaseRes Data UserLoginResV1 `json:"data"` }
type GetUserTipsResV1 ¶
type GetUserTipsResV1 struct { controller.BaseRes Data []UserTipResV1 `json:"data"` }
type GetUsersReqV1 ¶
type GetUsersReqV1 struct { FilterUserName string `json:"filter_user_name" query:"filter_user_name"` FilterRoleName string `json:"filter_role_name" query:"filter_role_name"` PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"` PageSize uint32 `json:"page_size" query:"page_size" valid:"required"` }
type GetUsersResV1 ¶
type GetUsersResV1 struct { controller.BaseRes Data []UserResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetWorkflowResV1 ¶
type GetWorkflowResV1 struct { controller.BaseRes Data *WorkflowResV1 `json:"data"` }
type GetWorkflowTemplateResV1 ¶
type GetWorkflowTemplateResV1 struct { controller.BaseRes Data *WorkflowTemplateDetailResV1 `json:"data"` }
type GetWorkflowTemplateTipResV1 ¶
type GetWorkflowTemplateTipResV1 struct { controller.BaseRes Data []*WorkflowTemplateTipResV1 `json:"data"` }
type GetWorkflowTemplatesResV1 ¶
type GetWorkflowTemplatesResV1 struct { controller.BaseRes Data []*WorkflowTemplateResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type GetWorkflowsReqV1 ¶
type GetWorkflowsReqV1 struct { FilterSubject string `json:"filter_subject" query:"filter_subject"` FilterCreateTimeFrom string `json:"filter_create_time_from" query:"filter_create_time_from"` FilterCreateTimeTo string `json:"filter_create_time_to" query:"filter_create_time_to"` FilterCreateUserName string `json:"filter_create_user_name" query:"filter_create_user_name"` FilterCurrentStepType string `json:"filter_current_step_type" query:"filter_current_step_type" valid:"omitempty,oneof=sql_review sql_execute"` FilterStatus string `json:"filter_status" query:"filter_status" valid:"omitempty,oneof=on_process finished rejected canceled"` FilterCurrentStepAssigneeUserName string `json:"filter_current_step_assignee_user_name" query:"filter_current_step_assignee_user_name"` FilterTaskStatus string `` /* 133-byte string literal not displayed */ FilterTaskInstanceName string `json:"filter_task_instance_name" query:"filter_task_instance_name"` PageIndex uint32 `json:"page_index" query:"page_index" valid:"required"` PageSize uint32 `json:"page_size" query:"page_size" valid:"required"` }
type GetWorkflowsResV1 ¶
type GetWorkflowsResV1 struct { controller.BaseRes Data []*WorkflowDetailResV1 `json:"data"` TotalNums uint64 `json:"total_nums"` }
type InstanceResV1 ¶
type InstanceResV1 struct { Name string `json:"instance_name"` DBType string `json:"db_type" example:"mysql"` Host string `json:"db_host" example:"10.10.10.10"` Port string `json:"db_port" example:"3306"` User string `json:"db_user" example:"root"` Desc string `json:"desc" example:"this is a instance"` WorkflowTemplateName string `json:"workflow_template_name,omitempty"` RuleTemplates []string `json:"rule_template_name_list,omitempty"` Roles []string `json:"role_name_list,omitempty"` }
type InstanceSchemaResV1 ¶
type InstanceSchemaResV1 struct {
Schemas []string `json:"schema_name_list"`
}
type InstanceTipReqV1 ¶
type InstanceTipReqV1 struct {
FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
}
type InstanceTipResV1 ¶
type LDAPConfigurationReqV1 ¶ added in v1.2111.0
type LDAPConfigurationReqV1 struct { EnableLdap *bool `json:"enable_ldap"` LdapServerHost *string `json:"ldap_server_host"` LdapServerPort *string `json:"ldap_server_port"` LdapConnectDn *string `json:"ldap_connect_dn"` LdapConnectPwd *string `json:"ldap_connect_pwd"` LdapSearchBaseDn *string `json:"ldap_search_base_dn"` LdapUserNameRdnKey *string `json:"ldap_user_name_rdn_key"` LdapUserEmailRdnKey *string `json:"ldap_user_email_rdn_key"` }
type LDAPConfigurationResV1 ¶ added in v1.2111.0
type LDAPConfigurationResV1 struct { EnableLdap bool `json:"enable_ldap"` LdapServerHost string `json:"ldap_server_host"` LdapServerPort string `json:"ldap_server_port"` LdapConnectDn string `json:"ldap_connect_dn"` LdapSearchBaseDn string `json:"ldap_search_base_dn"` LdapUserNameRdnKey string `json:"ldap_user_name_rdn_key"` LdapUserEmailRdnKey string `json:"ldap_user_email_rdn_key"` }
type LoginChecker ¶ added in v1.2111.0
type LoginChecker interface {
// contains filtered or unexported methods
}
func GetLoginCheckerByUserName ¶ added in v1.2111.0
func GetLoginCheckerByUserName(userName string) (LoginChecker, error)
GetLoginCheckerByUserName get login checker by user name and init login checker
type PartialSyncAuditPlanSQLsReqV1 ¶
type PartialSyncAuditPlanSQLsReqV1 struct {
SQLs []AuditPlanSQLReqV1 `json:"audit_plan_sql_list" form:"audit_plan_sql_list"`
}
type RejectWorkflowReqV1 ¶
type RejectWorkflowReqV1 struct {
Reason string `json:"reason" form:"reason"`
}
type RoleTipResV1 ¶
type RoleTipResV1 struct {
Name string `json:"role_name"`
}
type RuleTemplateDetailResV1 ¶
type RuleTemplateResV1 ¶
type RuleTemplateTipReqV1 ¶
type RuleTemplateTipReqV1 struct {
FilterDBType string `json:"filter_db_type" query:"filter_db_type"`
}
type RuleTemplateTipResV1 ¶
type SMTPConfigurationResV1 ¶
type SystemVariablesResV1 ¶
type SystemVariablesResV1 struct {
WorkflowExpiredHours int `json:"workflow_expired_hours"`
}
type TriggerAuditPlanResV1 ¶
type TriggerAuditPlanResV1 struct { controller.BaseRes Data AuditPlanReportResV1 `json:"data"` }
type UpdateAuditPlanReqV1 ¶
type UpdateAuditPlanReqV1 struct { Cron *string `json:"audit_plan_cron" form:"audit_plan_cron" example:"0 */2 * * *" valid:"omitempty,cron"` InstanceName *string `json:"audit_plan_instance_name" form:"audit_plan_instance_name" example:"test_mysql"` InstanceDatabase *string `json:"audit_plan_instance_database" form:"audit_plan_instance_database" example:"app1"` }
type UpdateCurrentUserReqV1 ¶
type UpdateCurrentUserReqV1 struct {
Email *string `json:"email"`
}
type UpdateInstanceReqV1 ¶
type UpdateInstanceReqV1 struct { DBType *string `json:"db_type" form:"db_type" example:"mysql"` User *string `json:"db_user" form:"db_user" example:"root"` Host *string `json:"db_host" form:"db_host" example:"10.10.10.10" valid:"omitempty,ipv4"` Port *string `json:"db_port" form:"db_port" example:"3306" valid:"omitempty,port"` Password *string `json:"db_password" form:"db_password" example:"123456"` Desc *string `json:"desc" example:"this is a test instance"` WorkflowTemplateName *string `json:"workflow_template_name" form:"workflow_template_name"` RuleTemplates []string `json:"rule_template_name_list" form:"rule_template_name_list"` Roles []string `json:"role_name_list" form:"role_name_list"` }
type UpdateOtherUserPasswordReqV1 ¶
type UpdateOtherUserPasswordReqV1 struct {
Password string `json:"password" valid:"required"`
}
type UpdateRoleReqV1 ¶
type UpdateRuleTemplateReqV1 ¶
type UpdateSMTPConfigurationReqV1 ¶
type UpdateSMTPConfigurationReqV1 struct { Host *string `json:"smtp_host" form:"smtp_host" example:"smtp.exmail.qq.com"` Port *string `json:"smtp_port" form:"smtp_port" example:"465" valid:"omitempty,port"` Username *string `json:"smtp_username" form:"smtp_username" example:"test@qq.com" valid:"omitempty,email"` Password *string `json:"smtp_password" form:"smtp_password" example:"123"` }
type UpdateSystemVariablesReqV1 ¶
type UpdateSystemVariablesReqV1 struct {
WorkflowExpiredHours *int `json:"workflow_expired_hours" form:"workflow_expired_hours" example:"720"`
}
type UpdateUserReqV1 ¶
type UpdateWorkflowReqV1 ¶
type UpdateWorkflowReqV1 struct {
TaskId string `json:"task_id" form:"task_id" valid:"required"`
}
type UpdateWorkflowTemplateReqV1 ¶
type UpdateWorkflowTemplateReqV1 struct { Desc *string `json:"desc" form:"desc"` Steps []*WorkFlowStepTemplateReqV1 `json:"workflow_step_template_list" form:"workflow_step_template_list"` Instances []string `json:"instance_name_list" form:"instance_name_list"` }
type UserDetailResV1 ¶
type UserLoginReqV1 ¶
type UserLoginResV1 ¶
type UserLoginResV1 struct {
Token string `json:"token" example:"this is a jwt token string"`
}
type UserTipResV1 ¶
type UserTipResV1 struct {
Name string `json:"user_name"`
}
type WorkflowDetailResV1 ¶
type WorkflowDetailResV1 struct { Id uint `json:"workflow_id"` Subject string `json:"subject"` Desc string `json:"desc"` TaskStatus string `json:"task_status" enums:"initialized,audited,executing,exec_succeeded,exec_failed"` TaskPassRate float64 `json:"task_pass_rate"` TaskInstance string `json:"task_instance_name"` TaskInstanceSchema string `json:"task_instance_schema"` CreateUser string `json:"create_user_name"` CreateTime *time.Time `json:"create_time"` CurrentStepType string `json:"current_step_type,omitempty" enums:"sql_review,sql_execute"` CurrentStepAssigneeUser []string `json:"current_step_assignee_user_name_list,omitempty"` Status string `json:"status" enums:"on_process,finished,rejected,canceled"` }
type WorkflowRecordResV1 ¶
type WorkflowRecordResV1 struct { TaskId uint `json:"task_id"` CurrentStepNumber uint `json:"current_step_number,omitempty"` Status string `json:"status" enums:"on_process,finished,rejected,canceled"` Steps []*WorkflowStepResV1 `json:"workflow_step_list,omitempty"` }
type WorkflowResV1 ¶
type WorkflowResV1 struct { Id uint `json:"workflow_id"` Subject string `json:"subject"` Desc string `json:"desc,omitempty"` CreateUser string `json:"create_user_name"` CreateTime *time.Time `json:"create_time"` Record *WorkflowRecordResV1 `json:"record"` RecordHistory []*WorkflowRecordResV1 `json:"record_history_list,omitempty"` }
type WorkflowStatisticsResV1 ¶
type WorkflowStatisticsResV1 struct { MyWorkflowNumber uint64 `json:"my_on_process_workflow_number"` MyRejectedWorkflowNumber uint64 `json:"my_rejected_workflow_number"` NeedMeReviewNumber uint64 `json:"need_me_to_review_workflow_number"` NeedMeExecuteNumber uint64 `json:"need_me_to_execute_workflow_number"` }
type WorkflowStepResV1 ¶
type WorkflowStepResV1 struct { Id uint `json:"workflow_step_id,omitempty"` Number uint `json:"number"` Type string `json:"type" enums:"create_workflow,update_workflow,sql_review,sql_execute"` Desc string `json:"desc,omitempty"` Users []string `json:"assignee_user_name_list,omitempty"` OperationUser string `json:"operation_user_name,omitempty"` OperationTime *time.Time `json:"operation_time,omitempty"` State string `json:"state,omitempty" enums:"initialized,approved,rejected"` Reason string `json:"reason,omitempty"` }
type WorkflowTemplateDetailResV1 ¶
type WorkflowTemplateDetailResV1 struct { Name string `json:"workflow_template_name"` Desc string `json:"desc,omitempty"` Steps []*WorkFlowStepTemplateResV1 `json:"workflow_step_template_list"` Instances []string `json:"instance_name_list,omitempty"` }
type WorkflowTemplateResV1 ¶
type WorkflowTemplateTipResV1 ¶
type WorkflowTemplateTipResV1 struct {
Name string `json:"workflow_template_name"`
}