Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Account
- func (*Account) Descriptor() ([]byte, []int)deprecated
- func (x *Account) GetAccountPrivilege() string
- func (x *Account) GetAccountPrivilegeDetail() string
- func (x *Account) GetCreateAt() int64
- func (x *Account) GetDescription() string
- func (x *Account) GetModifyAt() int64
- func (x *Account) GetName() string
- func (*Account) ProtoMessage()
- func (x *Account) ProtoReflect() protoreflect.Message
- func (x *Account) Reset()
- func (x *Account) String() string
- type ConnectionAddr
- func (*ConnectionAddr) Descriptor() ([]byte, []int)deprecated
- func (x *ConnectionAddr) GetHost() string
- func (x *ConnectionAddr) GetPort() int64
- func (x *ConnectionAddr) GetType() string
- func (*ConnectionAddr) ProtoMessage()
- func (x *ConnectionAddr) ProtoReflect() protoreflect.Message
- func (x *ConnectionAddr) Reset()
- func (x *ConnectionAddr) String() string
- type Database
- func (*Database) Descriptor() ([]byte, []int)deprecated
- func (x *Database) GetAccounts() []*Account
- func (x *Database) GetCharacterSet() string
- func (x *Database) GetDescription() string
- func (x *Database) GetEngine() string
- func (x *Database) GetName() string
- func (x *Database) GetStatus() string
- func (*Database) ProtoMessage()
- func (x *Database) ProtoReflect() protoreflect.Message
- func (x *Database) Reset()
- func (x *Database) String() string
- type Describe
- func (*Describe) Descriptor() ([]byte, []int)deprecated
- func (d *Describe) ExtraToJson() string
- func (x *Describe) GetAccountMaxQuantity() int64
- func (x *Describe) GetClassType() string
- func (x *Describe) GetCollation() string
- func (x *Describe) GetConnectionAddr() []*ConnectionAddr
- func (x *Describe) GetConnectionMode() string
- func (x *Describe) GetDatabases() []*Database
- func (x *Describe) GetDbMaxQuantity() int64
- func (x *Describe) GetDeployMode() string
- func (x *Describe) GetEngineType() string
- func (x *Describe) GetEngineVersion() string
- func (x *Describe) GetExportType() string
- func (x *Describe) GetExtra() map[string]string
- func (x *Describe) GetInstanceClass() string
- func (x *Describe) GetIpType() string
- func (x *Describe) GetMaxConnections() int64
- func (x *Describe) GetMaxIops() int64
- func (x *Describe) GetNetworkType() string
- func (x *Describe) GetPort() int64
- func (x *Describe) GetSecurityIpList() []string
- func (x *Describe) GetSecurityIpMode() string
- func (x *Describe) GetStorageType() string
- func (x *Describe) GetTimeZone() string
- func (x *Describe) GetType() string
- func (*Describe) ProtoMessage()
- func (x *Describe) ProtoReflect() protoreflect.Message
- func (x *Describe) Reset()
- func (d *Describe) SecurityIpListToString() string
- func (x *Describe) String() string
- type QueryRDSRequest
- type Rds
- func (*Rds) Descriptor() ([]byte, []int)deprecated
- func (r *Rds) GenHash() error
- func (x *Rds) GetDescribe() *Describe
- func (x *Rds) GetResource() *resource.Resource
- func (*Rds) ProtoMessage()
- func (x *Rds) ProtoReflect() protoreflect.Message
- func (x *Rds) Reset()
- func (r *Rds) ShortDesc() string
- func (x *Rds) String() string
- type RdsSet
- func (s *RdsSet) Add(items ...any)
- func (s *RdsSet) AddSet(set *RdsSet)
- func (*RdsSet) Descriptor() ([]byte, []int)deprecated
- func (x *RdsSet) GetItems() []*Rds
- func (x *RdsSet) GetTotal() int64
- func (s *RdsSet) Length() int64
- func (*RdsSet) ProtoMessage()
- func (x *RdsSet) ProtoReflect() protoreflect.Message
- func (x *RdsSet) Reset()
- func (x *RdsSet) String() string
- func (s *RdsSet) ToAny() (items []any)
- type STATUS
- func (STATUS) Descriptor() protoreflect.EnumDescriptor
- func (x STATUS) Enum() *STATUS
- func (STATUS) EnumDescriptor() ([]byte, []int)deprecated
- func (t STATUS) Equal(target STATUS) bool
- func (t STATUS) IsIn(targets ...STATUS) bool
- func (t STATUS) MarshalJSON() ([]byte, error)
- func (x STATUS) Number() protoreflect.EnumNumber
- func (x STATUS) String() string
- func (STATUS) Type() protoreflect.EnumType
- func (t *STATUS) UnmarshalJSON(b []byte) error
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const (
AppName = "rds"
)
Variables ¶
var ( STATUS_name = map[int32]string{ 0: "UNKNOW", 5: "PENDING", 6: "CREATE_FAILED", 11: "RUNNING", 20: "MODIFYING", 30: "REBOOTING", 31: "RESTORING", 32: "TRANSING", 33: "IMPORTING", 34: "CLONING", 35: "UPGRADING", 36: "BACKING_UP", 37: "NET_CHANGING", 40: "SWITCHOVER", 41: "GUARD_CREATING", 50: "ERROR", 51: "STORAGE_FULL", 70: "LOCKED", 71: "ISOLATIONING", 72: "ISOLATIONED", 80: "SHUTDOWN", 81: "DELETING", 90: "DESTROYED", } STATUS_value = map[string]int32{ "UNKNOW": 0, "PENDING": 5, "CREATE_FAILED": 6, "RUNNING": 11, "MODIFYING": 20, "REBOOTING": 30, "RESTORING": 31, "TRANSING": 32, "IMPORTING": 33, "CLONING": 34, "UPGRADING": 35, "BACKING_UP": 36, "NET_CHANGING": 37, "SWITCHOVER": 40, "GUARD_CREATING": 41, "ERROR": 50, "STORAGE_FULL": 51, "LOCKED": 70, "ISOLATIONING": 71, "ISOLATIONED": 72, "SHUTDOWN": 80, "DELETING": 81, "DESTROYED": 90, } )
Enum value maps for STATUS.
var File_apps_rds_pb_rds_proto protoreflect.FileDescriptor
var File_apps_rds_pb_rpc_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.cmdb.rds.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SyncRDS", Handler: _Service_SyncRDS_Handler, }, { MethodName: "QueryRDS", Handler: _Service_QueryRDS_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/rds/pb/rpc.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type Account ¶
type Account struct { // 账号名称 // @gotags: json:"name" Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` // 账号对该数据库拥有的权限 // @gotags: json:"account_privilege" AccountPrivilege string `protobuf:"bytes,2,opt,name=account_privilege,json=accountPrivilege,proto3" json:"account_privilege"` // 账号对该数据库具有的权限。 // @gotags: json:"account_privilege_detail" AccountPrivilegeDetail string `protobuf:"bytes,3,opt,name=account_privilege_detail,json=accountPrivilegeDetail,proto3" json:"account_privilege_detail"` // 账号描述 // @gotags: json:"description" Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description"` // 创建时间 // @gotags: json:"create_at" CreateAt int64 `protobuf:"varint,5,opt,name=create_at,json=createAt,proto3" json:"create_at"` // 修改时间 // @gotags: json:"modify_at" ModifyAt int64 `protobuf:"varint,6,opt,name=modify_at,json=modifyAt,proto3" json:"modify_at"` // contains filtered or unexported fields }
数据库 账号信息
func (*Account) Descriptor
deprecated
func (*Account) GetAccountPrivilege ¶
func (*Account) GetAccountPrivilegeDetail ¶
func (*Account) GetCreateAt ¶
func (*Account) GetDescription ¶
func (*Account) GetModifyAt ¶
func (*Account) ProtoMessage ¶
func (*Account) ProtoMessage()
func (*Account) ProtoReflect ¶
func (x *Account) ProtoReflect() protoreflect.Message
type ConnectionAddr ¶
type ConnectionAddr struct { // 连接地址类型, 内网链接/公网链接 // @gotags: json:"type" Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` // 连接地址 // @gotags: json:"host" Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host"` // 连接端口 // @gotags: json:"port" Port int64 `protobuf:"varint,3,opt,name=port,proto3" json:"port"` // contains filtered or unexported fields }
数据库 连接地址
func (*ConnectionAddr) Descriptor
deprecated
func (*ConnectionAddr) Descriptor() ([]byte, []int)
Deprecated: Use ConnectionAddr.ProtoReflect.Descriptor instead.
func (*ConnectionAddr) GetHost ¶
func (x *ConnectionAddr) GetHost() string
func (*ConnectionAddr) GetPort ¶
func (x *ConnectionAddr) GetPort() int64
func (*ConnectionAddr) GetType ¶
func (x *ConnectionAddr) GetType() string
func (*ConnectionAddr) ProtoMessage ¶
func (*ConnectionAddr) ProtoMessage()
func (*ConnectionAddr) ProtoReflect ¶
func (x *ConnectionAddr) ProtoReflect() protoreflect.Message
func (*ConnectionAddr) Reset ¶
func (x *ConnectionAddr) Reset()
func (*ConnectionAddr) String ¶
func (x *ConnectionAddr) String() string
type Database ¶
type Database struct { // 数据库 库的名称 // @gotags: json:"name" Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` // 数据库实例类型 // @gotags: json:"engine" Engine string `protobuf:"bytes,2,opt,name=engine,proto3" json:"engine"` // 数据库状态 // @gotags: json:"status" Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status"` // 字符集 // @gotags: json:"character_set" CharacterSet string `protobuf:"bytes,4,opt,name=character_set,json=characterSet,proto3" json:"character_set"` // 数据库描述 // @gotags: json:"description" Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description"` // 数据库账号 // @gotags: json:"accounts" Accounts []*Account `protobuf:"bytes,6,rep,name=accounts,proto3" json:"accounts"` // contains filtered or unexported fields }
func (*Database) Descriptor
deprecated
func (*Database) GetAccounts ¶
func (*Database) GetCharacterSet ¶
func (*Database) GetDescription ¶
func (*Database) ProtoMessage ¶
func (*Database) ProtoMessage()
func (*Database) ProtoReflect ¶
func (x *Database) ProtoReflect() protoreflect.Message
type Describe ¶
type Describe struct { // 引擎 比如 MYSQL, SQLServer, PGSQL // @gotags: json:"engine_type" EngineType string `protobuf:"bytes,1,opt,name=engine_type,json=engineType,proto3" json:"engine_type"` // 引擎版本 // @gotags: json:"engine_version" EngineVersion string `protobuf:"bytes,2,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version"` // 实例规格: 对应ALI(DBInstanceClass) // @gotags: json:"instance_class" InstanceClass string `protobuf:"bytes,3,opt,name=instance_class,json=instanceClass,proto3" json:"instance_class"` // 实例规格族,取值:s:共享型;x:通用型;d:独享套餐;h:独占物理机。 // @gotags: json:"class_type" ClassType string `protobuf:"bytes,4,opt,name=class_type,json=classType,proto3" json:"class_type"` // 实例是内网或外网 (Internet:外网/Intranet:内网) // @gotags: json:"export_type" ExportType string `protobuf:"bytes,5,opt,name=export_type,json=exportType,proto3" json:"export_type"` // 实例的网络类型 (Classic:经典网络/VPC:专有网络。) // @gotags: json:"network_type" NetworkType string `protobuf:"bytes,6,opt,name=network_type,json=networkType,proto3" json:"network_type"` // 实例类型 Primary:主实例, Readonly:只读实例, Guard:灾备实例, Temp:临时实例 // @gotags: json:"type" Type string `protobuf:"bytes,7,opt,name=type,proto3" json:"type"` // 一个实例下可创建最大数据库数量 // @gotags: json:"db_max_quantity" DbMaxQuantity int64 `protobuf:"varint,8,opt,name=db_max_quantity,json=dbMaxQuantity,proto3" json:"db_max_quantity"` // 可创建账号的最大数量 // @gotags: json:"account_max_quantity" AccountMaxQuantity int64 `protobuf:"varint,9,opt,name=account_max_quantity,json=accountMaxQuantity,proto3" json:"account_max_quantity"` // 最大并发连接数 // @gotags: json:"max_connections" MaxConnections int64 `protobuf:"varint,10,opt,name=max_connections,json=maxConnections,proto3" json:"max_connections"` // 最大每秒IO请求次数 // @gotags: json:"max_iops" MaxIops int64 `protobuf:"varint,11,opt,name=max_iops,json=maxIops,proto3" json:"max_iops"` // 系统字符集排序规则 // @gotags: json:"collation" Collation string `protobuf:"bytes,12,opt,name=collation,proto3" json:"collation"` // 时区 // @gotags: json:"time_zone" TimeZone string `protobuf:"bytes,13,opt,name=time_zone,json=timeZone,proto3" json:"time_zone"` // 实例储存类型 local_ssd/ephemeral_ssd:本地SSD盘, cloud_ssd:SSD云盘;cloud_essd:ESSD云盘 // @gotags: json:"storage_type" StorageType string `protobuf:"bytes,14,opt,name=storage_type,json=storageType,proto3" json:"storage_type"` // 安全名单模式, 默认白名单 // @gotags: json:"security_ip_mode" SecurityIpMode string `protobuf:"bytes,15,opt,name=security_ip_mode,json=securityIpMode,proto3" json:"security_ip_mode"` // IP白名单 // @gotags: json:"security_ip_list" SecurityIpList []string `protobuf:"bytes,16,rep,name=security_ip_list,json=securityIpList,proto3" json:"security_ip_list"` // 实例的访问模式,取值:Standard:标准访问模式;Safe:数据库代理模式。 // @gotags: json:"connection_mode" ConnectionMode string `protobuf:"bytes,17,opt,name=connection_mode,json=connectionMode,proto3" json:"connection_mode"` // IP类型 // @gotags: json:"ip_type" IpType string `protobuf:"bytes,18,opt,name=ip_type,json=ipType,proto3" json:"ip_type"` // 部署模式(腾讯云独有) // @gotags: json:"deploy_mode" DeployMode string `protobuf:"bytes,21,opt,name=deploy_mode,json=deployMode,proto3" json:"deploy_mode"` // 端口 // @gotags: json:"port" Port int64 `protobuf:"varint,22,opt,name=port,proto3" json:"port"` // 额外的无法通用的一些属性, 比如只有腾讯云独有的一些属性 // @gotags: json:"extra" Extra map[string]string `` /* 142-byte string literal not displayed */ // 实例链接地址 // @gotags: json:"connection_addr" ConnectionAddr []*ConnectionAddr `protobuf:"bytes,28,rep,name=connection_addr,json=connectionAddr,proto3" json:"connection_addr"` // 数据库 // @gotags: json:"databases" Databases []*Database `protobuf:"bytes,29,rep,name=databases,proto3" json:"databases"` // contains filtered or unexported fields }
func (*Describe) Descriptor
deprecated
func (*Describe) ExtraToJson ¶
func (*Describe) GetAccountMaxQuantity ¶
func (*Describe) GetClassType ¶
func (*Describe) GetCollation ¶
func (*Describe) GetConnectionAddr ¶
func (x *Describe) GetConnectionAddr() []*ConnectionAddr
func (*Describe) GetConnectionMode ¶
func (*Describe) GetDatabases ¶
func (*Describe) GetDbMaxQuantity ¶
func (*Describe) GetDeployMode ¶
func (*Describe) GetEngineType ¶
func (*Describe) GetEngineVersion ¶
func (*Describe) GetExportType ¶
func (*Describe) GetInstanceClass ¶
func (*Describe) GetMaxConnections ¶
func (*Describe) GetMaxIops ¶
func (*Describe) GetNetworkType ¶
func (*Describe) GetSecurityIpList ¶
func (*Describe) GetSecurityIpMode ¶
func (*Describe) GetStorageType ¶
func (*Describe) GetTimeZone ¶
func (*Describe) ProtoMessage ¶
func (*Describe) ProtoMessage()
func (*Describe) ProtoReflect ¶
func (x *Describe) ProtoReflect() protoreflect.Message
func (*Describe) SecurityIpListToString ¶
type QueryRDSRequest ¶
type QueryRDSRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // contains filtered or unexported fields }
func (*QueryRDSRequest) Descriptor
deprecated
func (*QueryRDSRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRDSRequest.ProtoReflect.Descriptor instead.
func (*QueryRDSRequest) GetPage ¶
func (x *QueryRDSRequest) GetPage() *request.PageRequest
func (*QueryRDSRequest) ProtoMessage ¶
func (*QueryRDSRequest) ProtoMessage()
func (*QueryRDSRequest) ProtoReflect ¶
func (x *QueryRDSRequest) ProtoReflect() protoreflect.Message
func (*QueryRDSRequest) Reset ¶
func (x *QueryRDSRequest) Reset()
func (*QueryRDSRequest) String ¶
func (x *QueryRDSRequest) String() string
type Rds ¶
type Rds struct { // @gotags: json:"resource" Resource *resource.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` // Rds描述信息 // @gotags: json:"describe" Describe *Describe `protobuf:"bytes,2,opt,name=describe,proto3" json:"describe"` // contains filtered or unexported fields }
func NewDefaultRDS ¶
func NewDefaultRDS() *Rds
func (*Rds) Descriptor
deprecated
func (*Rds) GetDescribe ¶
func (*Rds) GetResource ¶
func (*Rds) ProtoMessage ¶
func (*Rds) ProtoMessage()
func (*Rds) ProtoReflect ¶
func (x *Rds) ProtoReflect() protoreflect.Message
type RdsSet ¶
type RdsSet struct { // 总数量 // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // 列表项 // @gotags: json:"items" Items []*Rds `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
func (*RdsSet) Descriptor
deprecated
func (*RdsSet) ProtoMessage ¶
func (*RdsSet) ProtoMessage()
func (*RdsSet) ProtoReflect ¶
func (x *RdsSet) ProtoReflect() protoreflect.Message
type STATUS ¶
type STATUS int32
const ( // 未知状态 STATUS_UNKNOW STATUS = 0 // 表示创建中 STATUS_PENDING STATUS = 5 // 表示创建失败 STATUS_CREATE_FAILED STATUS = 6 // 表示运行中 STATUS_RUNNING STATUS = 11 // 实例配置变更生效中 STATUS_MODIFYING STATUS = 20 // 表示重启中 STATUS_REBOOTING STATUS = 30 // 备份恢复中 STATUS_RESTORING STATUS = 31 // 迁移中 STATUS_TRANSING STATUS = 32 // 数据导入中 STATUS_IMPORTING STATUS = 33 // 实例克隆中 STATUS_CLONING STATUS = 34 // 迁移版本中 STATUS_UPGRADING STATUS = 35 // 表示实例正在进行备份 STATUS_BACKING_UP STATUS = 36 // 内外网切换中 STATUS_NET_CHANGING STATUS = 37 // 表示实例正在主备切换 STATUS_SWITCHOVER STATUS = 40 // 灾备实例创建同步中 STATUS_GUARD_CREATING STATUS = 41 // 状态异常 STATUS_ERROR STATUS = 50 // 表示实例磁盘空间满 STATUS_STORAGE_FULL STATUS = 51 // 表示实例已经锁定 STATUS_LOCKED STATUS = 70 // 隔离中 STATUS_ISOLATIONING STATUS = 71 // 已隔中 STATUS_ISOLATIONED STATUS = 72 // 表示停止待销毁 STATUS_SHUTDOWN STATUS = 80 // 表示销毁中 STATUS_DELETING STATUS = 81 // 已销毁 STATUS_DESTROYED STATUS = 90 )
func ParseSTATUSFromString ¶
ParseSTATUSFromString Parse STATUS from string
func (STATUS) Descriptor ¶
func (STATUS) Descriptor() protoreflect.EnumDescriptor
func (STATUS) EnumDescriptor
deprecated
func (STATUS) Number ¶
func (x STATUS) Number() protoreflect.EnumNumber
func (STATUS) Type ¶
func (STATUS) Type() protoreflect.EnumType
type ServiceClient ¶
type ServiceClient interface { SyncRDS(ctx context.Context, in *Rds, opts ...grpc.CallOption) (*Rds, error) QueryRDS(ctx context.Context, in *QueryRDSRequest, opts ...grpc.CallOption) (*RdsSet, error) }
ServiceClient is the client API for Service service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { SyncRDS(context.Context, *Rds) (*Rds, error) QueryRDS(context.Context, *QueryRDSRequest) (*RdsSet, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) QueryRDS ¶
func (UnimplementedServiceServer) QueryRDS(context.Context, *QueryRDSRequest) (*RdsSet, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.