request

package
v0.0.0-...-b97b37b Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPageSize = 50
	MaxPageSize     = 500
	DefaultLimit    = 50
)

Variables

This section is empty.

Functions

func FilterIgnoreDatabases

func FilterIgnoreDatabases(databases []string) []string

过滤掉可以忽略掉数据库

func GetParam

func GetParam(c *gin.Context, key string) (string, error)

获取参数

func GetParamInt64

func GetParamInt64(c *gin.Context, key string) (int64, error)

获取参数

func NewRequest

func NewRequest(c *gin.Context, obj interface{}) (interface{}, error)

Types

type DBOperationClusterDBNamesRequest

type DBOperationClusterDBNamesRequest struct {
	MetaClusterId types.NullInt64 `json:"meta_cluster_id" form:"meta_cluster_id"`
}

func (*DBOperationClusterDBNamesRequest) Check

type InstanceAddRequest

type InstanceAddRequest struct {
	InstanceId    types.NullString `json:"instance_id" form:"instance_id"`
	InstanceName  types.NullString `json:"instance_name" form:"instance_name"`
	MetaClusterId types.NullInt64  `json:"meta_cluster_id" form:"meta_cluster_id" binding:"required"`
	MachineHost   types.NullString `json:"machine_host" form:"machine_host"`
	VpcgwRip      types.NullString `json:"vpcgw_rip" form:"vpcgw_rip"`
	Port          types.NullInt64  `json:"port" form:"port"`
	MasterHost    types.NullString `json:"master_host" form:"master_host"`
	MasterPort    types.NullInt64  `json:"master_port" form:"master_port"`
	VipPort       types.NullString `json:"vip_port" form:"vip_port"`
	VpcgwVipPort  types.NullString `json:"vpcgw_vip_port" form:"vpcgw_vip_port"`
	Role          types.NullString `json:"role" form:"role" binding:"required"`
	Cpu           types.NullInt64  `json:"cpu" form:"cpu"`
	Mem           types.NullInt64  `json:"mem" form:"mem"`
	Disk          types.NullInt64  `json:"disk" form:"disk"`
	Version       types.NullString `json:"version" form:"version"`
	IsMaintenance types.NullInt64  `json:"is_maintenance" form:"is_maintenance"`
	Descript      types.NullString `json:"descript" form:"descript"`
}

func (*InstanceAddRequest) Check

func (this *InstanceAddRequest) Check() error

type InstanceDeleteByIdRequest

type InstanceDeleteByIdRequest struct {
	ID types.NullInt64 `json:"id" form:"id" binding:"required"`
}

type InstanceEditByIdRequest

type InstanceEditByIdRequest struct {
	ID            types.NullInt64  `json:"id" form:"id" binding:"required"`
	InstanceId    types.NullString `json:"instance_id" form:"instance_id"`
	InstanceName  types.NullString `json:"instance_name" form:"instance_name"`
	MetaClusterId types.NullInt64  `json:"meta_cluster_id" form:"meta_cluster_id"`
	MachineHost   types.NullString `json:"machine_host" form:"machine_host"`
	VpcgwRip      types.NullString `json:"vpcgw_rip" form:"vpcgw_rip"`
	Port          types.NullInt64  `json:"port" form:"port"`
	MasterHost    types.NullString `json:"master_host" form:"master_host"`
	MasterPort    types.NullInt64  `json:"master_port" form:"master_port"`
	VipPort       types.NullString `json:"vip_port" form:"vip_port"`
	VpcgwVipPort  types.NullString `json:"vpcgw_vip_port" form:"vpcgw_vip_port"`
	Role          types.NullString `json:"role" form:"role"`
	Cpu           types.NullInt64  `json:"cpu" form:"cpu"`
	Mem           types.NullInt64  `json:"mem" form:"mem"`
	Disk          types.NullInt64  `json:"disk" form:"disk"`
	Version       types.NullString `json:"version" form:"version"`
	IsMaintenance types.NullInt64  `json:"is_maintenance" form:"is_maintenance"`
	Descript      types.NullString `json:"descript" form:"descript"`
}

type InstanceFindMasterSlavesRequest

type InstanceFindMasterSlavesRequest struct {
	MetaClusterId types.NullInt64  `json:"meta_cluster_id" form:"meta_cluster_id"`
	ClusterName   types.NullString `json:"cluster_name" form:"cluster_name"`
	SetName       types.NullString `json:"set_name" form:"set_name"`
}

type InstanceFindRequest

type InstanceFindRequest struct {
	Pager
	Keyword types.NullString `json:"keyword" form:"keyword"`
}

type MCAddRequest

type MCAddRequest struct {
	Name          types.NullString   `json:"name" form:"name"`
	ClusterId     types.NullString   `json:"cluster_id" form:"cluster_id"`
	Owner         types.NullString   `json:"owner" form:"owner"`
	BusinessLine  types.NullString   `json:"business_line" form:"business_line"`
	DomainNames   []types.NullString `json:"domain_names" form:"domain_names"`
	VipPorts      []types.NullString `json:"vip_ports" form:"vip_ports"`
	VpcgwVipPorts []types.NullString `json:"vpcgw_vip_ports" form:"vpcgw_vip_ports"`
	ReadHostPort  types.NullString   `json:"read_host_port" form:"read_host_port"`
	IsShard       types.NullInt64    `json:"is_shard" form:"is_shard"`
	ShardType     types.NullString   `json:"shard_type" form:"shard_type"`
	Category      types.NullInt64    `json:"category" form:"category"`
	SetName       types.NullString   `json:"set_name" form:"set_name"`
}

func (*MCAddRequest) Check

func (this *MCAddRequest) Check() error

type MCDeleteByIdRequest

type MCDeleteByIdRequest struct {
	ID types.NullInt64 `json:"id" form:"id" binding:"required"`
}

type MCEditByIdRequest

type MCEditByIdRequest struct {
	ID            types.NullInt64    `json:"id" form:"id" binding:"required"`
	Name          types.NullString   `json:"name" form:"name"`
	ClusterId     types.NullString   `json:"cluster_id" form:"cluster_id"`
	BusinessLine  types.NullString   `json:"business_line" form:"business_line"`
	Owner         types.NullString   `json:"owner" form:"owner"`
	DomainNames   []types.NullString `json:"domain_names" form:"domain_names"`
	VipPorts      []types.NullString `json:"vip_ports" form:"vip_ports"`
	VpcgwVipPorts []types.NullString `json:"vpcgw_vip_ports" form:"vpcgw_vip_ports"`
	ReadHostPort  types.NullString   `json:"read_host_port" form:"read_host_port"`
	IsShard       types.NullInt64    `json:"is_shard" form:"is_shard"`
	ShardType     types.NullString   `json:"shard_type" form:"shard_type"`
	Category      types.NullInt64    `json:"category" form:"category"`
	IsDeleted     types.NullInt64    `json:"is_deleted" form:"is_deleted"`
	SetName       types.NullString   `json:"set_name" form:"set_name"`
}

type MCFindNameByNameRequest

type MCFindNameByNameRequest struct {
	Name  types.NullString `json:"name" form:"name"`
	Limit types.NullInt64  `json:"limit" form:"limit"`
}

func (*MCFindNameByNameRequest) GetLimit

func (this *MCFindNameByNameRequest) GetLimit() int64

type MCFindRequest

type MCFindRequest struct {
	Pager
	Keyword types.NullString `json:"keyword" form:"keyword"`
}

type MysqlExecSqlRequest

type MysqlExecSqlRequest struct {
	PrivId types.NullInt64  `json:"priv_id" form:"priv_id"`
	Query  types.NullString `json:"query" form:"query"`
}

func (*MysqlExecSqlRequest) Check

func (this *MysqlExecSqlRequest) Check() error

type Pager

type Pager struct {
	Current  int `json:"current" form:"current"`   // 第一页从1开始
	PageSize int `json:"pageSize" form:"pageSize"` // 每业大小
}

func (*Pager) Check

func (this *Pager) Check() error

func (*Pager) Limit

func (this *Pager) Limit() int

func (*Pager) Offset

func (this *Pager) Offset() int

type PrivsApplyMysqlPriv

type PrivsApplyMysqlPriv struct {
	MetaClusterId types.NullInt64  `json:"meta_cluster_id" form:"meta_cluster_id"`
	ClusterName   types.NullString `json:"cluster_name" form:"cluster_name"`
	DBName        types.NullString `json:"db_name" form:"db_name"`
	VipPort       types.NullString `json:"vip_port" form:"vip_port"`
}

type PrivsApplyMysqlPrivByUUIDRequest

type PrivsApplyMysqlPrivByUUIDRequest struct {
	OrderUUID types.NullString `json:"order_uuid" form:"order_uuid"`
}

func (*PrivsApplyMysqlPrivByUUIDRequest) Check

type PrivsApplyMysqlPrivOrderEditByUUIDRequest

type PrivsApplyMysqlPrivOrderEditByUUIDRequest struct {
	OrderUUID   types.NullString `json:"order_uuid" form:"order_uuid"`
	ApplyStatus types.NullInt64  `json:"apply_status" form:"apply_status"`
}

func (*PrivsApplyMysqlPrivOrderEditByUUIDRequest) Check

type PrivsApplyMysqlPrivOrderRequest

type PrivsApplyMysqlPrivOrderRequest struct {
	Pager
	OrderUUID   types.NullString `json:"order_uuid" form:"order_uuid"`
	Username    types.NullString `json:"username" form:"username"`
	ApplyStatus types.NullInt64  `json:"apply_status" form:"apply_status"`
}

type PrivsApplyMysqlPrivRequest

type PrivsApplyMysqlPrivRequest struct {
	ApplyReason types.NullString       `json:"apply_reason" form:"apply_reason"`
	Privs       []*PrivsApplyMysqlPriv `json:"privs" form:"privs"`
}

func (*PrivsApplyMysqlPrivRequest) Check

func (this *PrivsApplyMysqlPrivRequest) Check() error

type PrivsApplyPrivSuccessRequest

type PrivsApplyPrivSuccessRequest struct {
	OrderUUID types.NullString `json:"order_uuid" form:"order_uuid"`
}

func (*PrivsApplyPrivSuccessRequest) Check

func (this *PrivsApplyPrivSuccessRequest) Check() error

type PrivsMysqlFindTablesByUserRequest

type PrivsMysqlFindTablesByUserRequest struct {
	MetaClusterId types.NullInt64  `json:"meta_cluster_id" form:"meta_cluster_id"`
	DBName        types.NullString `json:"db_name" form:"db_name"`
}

func (*PrivsMysqlFindTablesByUserRequest) Check

type PrivsMysqlFindTreeByUsername

type PrivsMysqlFindTreeByUsername struct {
	Username types.NullString `json:"username" form:"username"`
}

func (*PrivsMysqlFindTreeByUsername) Check

func (this *PrivsMysqlFindTreeByUsername) Check() error

type UserDeleteByIdRequest

type UserDeleteByIdRequest struct {
	ID types.NullInt64 `json:"id" form:"id" binding:"required"`
}

type UserEditByIdRequest

type UserEditByIdRequest struct {
	ID       types.NullInt64  `json:"id" form:"id" binding:"required"`
	Username types.NullString `json:"username" form:"username"`
	Password types.NullString `json:"password" form:"password"`
	Email    types.NullString `json:"email" form:"email"`
	Mobile   types.NullString `json:"mobile" form:"mobile"`
	NameEn   types.NullString `json:"name_en" form:"name_en"`
	NameZh   types.NullString `json:"name_zh" form:"name_zh"`
	Role     types.NullString `json:"role" form:"role"`
}

type UserFindRequest

type UserFindRequest struct {
	Pager
	Keyword types.NullString `json:"keyword" form:"keyword"`
}

type UserLoginRequest

type UserLoginRequest struct {
	Username types.NullString `json:"username" form:"username" binding:"required"`
	Password types.NullString `json:"password" form:"password"`
}

type UserRegisterRequest

type UserRegisterRequest struct {
	Username types.NullString `json:"username" form:"username" binding:"required"`
	Password types.NullString `json:"password" form:"password"`
	Email    types.NullString `json:"email" form:"email"`
	NameEn   types.NullString `json:"name_en" form:"name_en"`
	NameZh   types.NullString `json:"name_zh" form:"name_zh"`
}

type UtilDecryptRequest

type UtilDecryptRequest struct {
	Data string `json:"data" form:"data" binding:"required"`
}

type UtilEncreptRequest

type UtilEncreptRequest struct {
	Data string `json:"data" form:"data" binding:"required"`
}

type UtilGetBatchInsertSqlRequest

type UtilGetBatchInsertSqlRequest struct {
	TableName   string                   `json:"table_name" form:"table_name"`
	ColumnNames []string                 `json:"column_names" form:"column_names"`
	Rows        []map[string]interface{} `json:"rows" form:"rows"`
}

func (*UtilGetBatchInsertSqlRequest) Check

func (this *UtilGetBatchInsertSqlRequest) Check() error

type UtilSqlFingerprintRequest

type UtilSqlFingerprintRequest struct {
	Statements []string `json:"statements" form:"statements" binding:"required"`
}

type UtilTextToSqlsRequest

type UtilTextToSqlsRequest struct {
	Text string `json:"text" form:"text" binding:"required"`
}

func (*UtilTextToSqlsRequest) Check

func (this *UtilTextToSqlsRequest) Check() error

Jump to

Keyboard shortcuts

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