Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Describe
- func (*Describe) Descriptor() ([]byte, []int)deprecated
- func (x *Describe) GetArchitectureType() string
- func (x *Describe) GetConfig() string
- func (x *Describe) GetConnectAddr() string
- func (x *Describe) GetConnectPort() int64
- func (x *Describe) GetEngineType() string
- func (x *Describe) GetEngineVersion() string
- func (x *Describe) GetMaxConnection() int64
- func (x *Describe) GetNetworkType() string
- func (x *Describe) GetNodeType() string
- func (x *Describe) GetQps() int64
- func (x *Describe) GetReplicaId() string
- func (x *Describe) GetReplicationMode() string
- func (x *Describe) GetSecurityIpList() string
- func (*Describe) ProtoMessage()
- func (x *Describe) ProtoReflect() protoreflect.Message
- func (x *Describe) Reset()
- func (x *Describe) String() string
- type QueryRedisRequest
- func (*QueryRedisRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRedisRequest) GetPage() *request.PageRequest
- func (*QueryRedisRequest) ProtoMessage()
- func (x *QueryRedisRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRedisRequest) Reset()
- func (x *QueryRedisRequest) String() string
- type Redis
- 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 Set
- func (s *Set) Add(items ...any)
- func (*Set) Descriptor() ([]byte, []int)deprecated
- func (x *Set) GetItems() []*Redis
- func (x *Set) GetTotal() int64
- func (s *Set) Length() int64
- func (*Set) ProtoMessage()
- func (x *Set) ProtoReflect() protoreflect.Message
- func (x *Set) Reset()
- func (x *Set) String() string
- func (s *Set) ToAny() (items []any)
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const (
AppName = "redis"
)
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: "FLUSHING", 34: "EXTENDING", 35: "UPGRADING", 36: "BACKING_UP", 37: "NET_CHANGING", 50: "ERROR", 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, "FLUSHING": 33, "EXTENDING": 34, "UPGRADING": 35, "BACKING_UP": 36, "NET_CHANGING": 37, "ERROR": 50, "LOCKED": 70, "ISOLATIONING": 71, "ISOLATIONED": 72, "SHUTDOWN": 80, "DELETING": 81, "DESTROYED": 90, } )
Enum value maps for STATUS.
var File_apps_redis_pb_redis_proto protoreflect.FileDescriptor
var File_apps_redis_pb_rpc_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.cmdb.redis.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SyncRedis", Handler: _Service_SyncRedis_Handler, }, { MethodName: "QueryRedis", Handler: _Service_QueryRedis_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/redis/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 Describe ¶
type Describe struct { // 链接地址 // @gotags: json:"connect_addr" ConnectAddr string `protobuf:"bytes,2,opt,name=connect_addr,json=connectAddr,proto3" json:"connect_addr"` // 链接端口 // @gotags: json:"connect_port" ConnectPort int64 `protobuf:"varint,3,opt,name=connect_port,json=connectPort,proto3" json:"connect_port"` // 指定架构类型返回实例列表:cluster(集群版)standard(标准版) SplitRW(读写分离版)NULL(所有类型,默认值) // @gotags: json:"architecture_type" ArchitectureType string `protobuf:"bytes,4,opt,name=architecture_type,json=architectureType,proto3" json:"architecture_type"` // 理论最大QPS值 // @gotags: json:"qps" Qps int64 `protobuf:"varint,5,opt,name=qps,proto3" json:"qps"` // 实例连接数限制,单位:个 // @gotags: json:"max_connection" MaxConnection int64 `protobuf:"varint,7,opt,name=max_connection,json=maxConnection,proto3" json:"max_connection"` // 配置 // @gotags: json:"config" Config string `protobuf:"bytes,8,opt,name=config,proto3" json:"config"` // 节点类型:double(双节点) single(单节点) // @gotags: json:"node_type" NodeType string `protobuf:"bytes,9,opt,name=node_type,json=nodeType,proto3" json:"node_type"` // 网络类型:CLASSIC(经典网络)VPC(VPC网络) // @gotags: json:"network_type" NetworkType string `protobuf:"bytes,10,opt,name=network_type,json=networkType,proto3" json:"network_type"` // 数据库类型。 // @gotags: json:"engine_type" EngineType string `protobuf:"bytes,11,opt,name=engine_type,json=engineType,proto3" json:"engine_type"` // 数据库版本:2.8 4.0 5.0 // @gotags: json:"engine_version" EngineVersion string `protobuf:"bytes,12,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version"` // 副本架构:master-slave(包括主从版和单节点版)cluster(包括读写分离版与集群版) // @gotags: json:"replication_mode" ReplicationMode string `protobuf:"bytes,13,opt,name=replication_mode,json=replicationMode,proto3" json:"replication_mode"` // 副本ID。 // @gotags: json:"replica_id" ReplicaId string `protobuf:"bytes,14,opt,name=replica_id,json=replicaId,proto3" json:"replica_id"` // IP白名单 // @gotags: json:"security_ip_list" SecurityIpList string `protobuf:"bytes,15,opt,name=security_ip_list,json=securityIpList,proto3" json:"security_ip_list"` // contains filtered or unexported fields }
func (*Describe) Descriptor
deprecated
func (*Describe) GetArchitectureType ¶
func (*Describe) GetConnectAddr ¶
func (*Describe) GetConnectPort ¶
func (*Describe) GetEngineType ¶
func (*Describe) GetEngineVersion ¶
func (*Describe) GetMaxConnection ¶
func (*Describe) GetNetworkType ¶
func (*Describe) GetNodeType ¶
func (*Describe) GetReplicaId ¶
func (*Describe) GetReplicationMode ¶
func (*Describe) GetSecurityIpList ¶
func (*Describe) ProtoMessage ¶
func (*Describe) ProtoMessage()
func (*Describe) ProtoReflect ¶
func (x *Describe) ProtoReflect() protoreflect.Message
type QueryRedisRequest ¶
type QueryRedisRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // contains filtered or unexported fields }
func (*QueryRedisRequest) Descriptor
deprecated
func (*QueryRedisRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRedisRequest.ProtoReflect.Descriptor instead.
func (*QueryRedisRequest) GetPage ¶
func (x *QueryRedisRequest) GetPage() *request.PageRequest
func (*QueryRedisRequest) ProtoMessage ¶
func (*QueryRedisRequest) ProtoMessage()
func (*QueryRedisRequest) ProtoReflect ¶
func (x *QueryRedisRequest) ProtoReflect() protoreflect.Message
func (*QueryRedisRequest) Reset ¶
func (x *QueryRedisRequest) Reset()
func (*QueryRedisRequest) String ¶
func (x *QueryRedisRequest) String() string
type Redis ¶
type Redis struct { // @gotags: json:"resource" Resource *resource.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` // @gotags: json:"describe" Describe *Describe `protobuf:"bytes,3,opt,name=describe,proto3" json:"describe"` // contains filtered or unexported fields }
func NewDefaultRedis ¶
func NewDefaultRedis() *Redis
func (*Redis) Descriptor
deprecated
func (*Redis) GetDescribe ¶
func (*Redis) GetResource ¶
func (*Redis) ProtoMessage ¶
func (*Redis) ProtoMessage()
func (*Redis) ProtoReflect ¶
func (x *Redis) 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_FLUSHING STATUS = 33 // 缓存实例处于正在扩容的状态 STATUS_EXTENDING STATUS = 34 // 迁移版本中 STATUS_UPGRADING STATUS = 35 // 表示实例正在进行备份 STATUS_BACKING_UP STATUS = 36 // 内外网切换中 STATUS_NET_CHANGING STATUS = 37 // 状态异常 STATUS_ERROR STATUS = 50 // 表示实例已经锁定 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 { SyncRedis(ctx context.Context, in *Redis, opts ...grpc.CallOption) (*Redis, error) QueryRedis(ctx context.Context, in *QueryRedisRequest, opts ...grpc.CallOption) (*Set, 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 { SyncRedis(context.Context, *Redis) (*Redis, error) QueryRedis(context.Context, *QueryRedisRequest) (*Set, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Set ¶
type Set struct { // 总数量 // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // 列表项 // @gotags: json:"items" Items []*Redis `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
func (*Set) Descriptor
deprecated
func (*Set) ProtoMessage ¶
func (*Set) ProtoMessage()
func (*Set) ProtoReflect ¶
func (x *Set) ProtoReflect() protoreflect.Message
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) QueryRedis ¶
func (UnimplementedServiceServer) QueryRedis(context.Context, *QueryRedisRequest) (*Set, 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.