redis

package
v0.0.0-...-7aae7b9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 13 Imported by: 0

README

Redis管理

统一状态

各厂商状态

阿里云: API 文档

  • Normal:正常。
  • Creating:创建中。
  • Error:创建失败。
  • Flushing:清除中。
  • Released:已释放。
  • BackupRecovering:备份恢复中。
  • MinorVersionUpgrading:小版本升级中。
  • MajorVersionUpgrading:大版本升级中,可正常访问。
  • NetworkModifying:网络变更中。
  • Inactive:被禁用。
  • Changing:修改中。
  • Transforming:转换中。
  • Migrating:迁移中。
  • Unavailable:服务停止。
  • SSLModifying:SSL变更中。

腾讯云: API 文档

  • 0-待初始化

  • 1-流程中

  • 2-运行中

  • -2-已隔离

  • -3-待删除

华为云: 缓存实例状态说明

  • CREATING: 申请缓存实例后,在缓存实例状态进入运行中之前的状态。
  • RUNNING: 缓存实例正常运行状态。在这个状态的实例可以运行您的业务。
  • CREATEFAILED: 缓存实例处于创建失败的状态。
  • ERROR: 缓存实例处于故障的状态。
  • RESTARTING: 缓存实例正在进行重启操作。
  • FROZEN: 缓存实例处于已冻结状态,用户可以在“我的订单”中续费开启冻结的缓存实例。
  • FLUSHING: 缓存实例数据清空中的状态。
  • RESTORING: 缓存实例数据恢复中的状态。
  • EXTENDING: 缓存实例处于正在扩容的状态。
统一状态
  • PENDING:表示创建中
  • RUNNING:表示运行中
  • ERROR: 缓存实例处于故障的状态。
  • REBOOTING:表示重启中
  • ISOLATIONING: 隔离中
  • ISOLATIONED: 已隔中
  • FLUSHING: 缓存实例数据清空中的状态。
  • RESTORING: 缓存实例数据恢复中的状态。
  • DESTROYED: 已销毁
  • RESTORING: 备份恢复中
  • UPGRADING: 迁移版本中
  • NET_CHANGING: 内外网切换中
  • EXTENDING: 缓存实例处于正在扩容的状态。
  • MODIFYING: 实例配置变更生效中
  • TRANSING: 迁移中

Documentation

Index

Constants

View Source
const (
	AppName = "redis"
)

Variables

View Source
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.

View Source
var File_apps_redis_pb_redis_proto protoreflect.FileDescriptor
View Source
var File_apps_redis_pb_rpc_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Describe.ProtoReflect.Descriptor instead.

func (*Describe) GetArchitectureType

func (x *Describe) GetArchitectureType() string

func (*Describe) GetConfig

func (x *Describe) GetConfig() string

func (*Describe) GetConnectAddr

func (x *Describe) GetConnectAddr() string

func (*Describe) GetConnectPort

func (x *Describe) GetConnectPort() int64

func (*Describe) GetEngineType

func (x *Describe) GetEngineType() string

func (*Describe) GetEngineVersion

func (x *Describe) GetEngineVersion() string

func (*Describe) GetMaxConnection

func (x *Describe) GetMaxConnection() int64

func (*Describe) GetNetworkType

func (x *Describe) GetNetworkType() string

func (*Describe) GetNodeType

func (x *Describe) GetNodeType() string

func (*Describe) GetQps

func (x *Describe) GetQps() int64

func (*Describe) GetReplicaId

func (x *Describe) GetReplicaId() string

func (*Describe) GetReplicationMode

func (x *Describe) GetReplicationMode() string

func (*Describe) GetSecurityIpList

func (x *Describe) GetSecurityIpList() string

func (*Describe) ProtoMessage

func (*Describe) ProtoMessage()

func (*Describe) ProtoReflect

func (x *Describe) ProtoReflect() protoreflect.Message

func (*Describe) Reset

func (x *Describe) Reset()

func (*Describe) String

func (x *Describe) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Redis.ProtoReflect.Descriptor instead.

func (*Redis) GetDescribe

func (x *Redis) GetDescribe() *Describe

func (*Redis) GetResource

func (x *Redis) GetResource() *resource.Resource

func (*Redis) ProtoMessage

func (*Redis) ProtoMessage()

func (*Redis) ProtoReflect

func (x *Redis) ProtoReflect() protoreflect.Message

func (*Redis) Reset

func (x *Redis) Reset()

func (*Redis) String

func (x *Redis) String() string

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

func ParseSTATUSFromString(str string) (STATUS, error)

ParseSTATUSFromString Parse STATUS from string

func (STATUS) Descriptor

func (STATUS) Descriptor() protoreflect.EnumDescriptor

func (STATUS) Enum

func (x STATUS) Enum() *STATUS

func (STATUS) EnumDescriptor deprecated

func (STATUS) EnumDescriptor() ([]byte, []int)

Deprecated: Use STATUS.Descriptor instead.

func (STATUS) Equal

func (t STATUS) Equal(target STATUS) bool

Equal type compare

func (STATUS) IsIn

func (t STATUS) IsIn(targets ...STATUS) bool

IsIn todo

func (STATUS) MarshalJSON

func (t STATUS) MarshalJSON() ([]byte, error)

MarshalJSON todo

func (STATUS) Number

func (x STATUS) Number() protoreflect.EnumNumber

func (STATUS) String

func (x STATUS) String() string

func (STATUS) Type

func (STATUS) Type() protoreflect.EnumType

func (*STATUS) UnmarshalJSON

func (t *STATUS) UnmarshalJSON(b []byte) error

UnmarshalJSON todo

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 NewSet

func NewSet() *Set

func (*Set) Add

func (s *Set) Add(items ...any)

func (*Set) Descriptor deprecated

func (*Set) Descriptor() ([]byte, []int)

Deprecated: Use Set.ProtoReflect.Descriptor instead.

func (*Set) GetItems

func (x *Set) GetItems() []*Redis

func (*Set) GetTotal

func (x *Set) GetTotal() int64

func (*Set) Length

func (s *Set) Length() int64

func (*Set) ProtoMessage

func (*Set) ProtoMessage()

func (*Set) ProtoReflect

func (x *Set) ProtoReflect() protoreflect.Message

func (*Set) Reset

func (x *Set) Reset()

func (*Set) String

func (x *Set) String() string

func (*Set) ToAny

func (s *Set) ToAny() (items []any)

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) QueryRedis

func (UnimplementedServiceServer) SyncRedis

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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