Documentation ¶
Overview ¶
Package pbredis is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterRedisServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterRedisServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RedisServiceClient) error
- func RegisterRedisServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterRedisServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RedisServiceServer) error
- func RegisterRedisServiceServer(s grpc.ServiceRegistrar, srv RedisServiceServer)
- type ListDetailReq
- func (*ListDetailReq) Descriptor() ([]byte, []int)deprecated
- func (x *ListDetailReq) GetAccountName() string
- func (x *ListDetailReq) GetNextToken() string
- func (x *ListDetailReq) GetPageNumber() int32
- func (x *ListDetailReq) GetPageSize() int32
- func (x *ListDetailReq) GetProvider() pbtenant.CloudProvider
- func (x *ListDetailReq) GetRegionId() int32
- func (*ListDetailReq) ProtoMessage()
- func (x *ListDetailReq) ProtoReflect() protoreflect.Message
- func (x *ListDetailReq) Reset()
- func (x *ListDetailReq) String() string
- type ListDetailResp
- func (*ListDetailResp) Descriptor() ([]byte, []int)deprecated
- func (x *ListDetailResp) GetFinished() bool
- func (x *ListDetailResp) GetNextToken() string
- func (x *ListDetailResp) GetPageNumber() int32
- func (x *ListDetailResp) GetPageSize() int32
- func (x *ListDetailResp) GetRedises() []*RedisInstance
- func (x *ListDetailResp) GetRequestId() string
- func (*ListDetailResp) ProtoMessage()
- func (x *ListDetailResp) ProtoReflect() protoreflect.Message
- func (x *ListDetailResp) Reset()
- func (x *ListDetailResp) String() string
- type ListReq
- type ListResp
- type RedisInstance
- func (*RedisInstance) Descriptor() ([]byte, []int)deprecated
- func (x *RedisInstance) GetAccoutName() string
- func (x *RedisInstance) GetCreationTime() string
- func (x *RedisInstance) GetExpireTime() string
- func (x *RedisInstance) GetInstanceId() string
- func (x *RedisInstance) GetInstanceName() string
- func (x *RedisInstance) GetProvider() pbtenant.CloudProvider
- func (x *RedisInstance) GetRegionName() string
- func (x *RedisInstance) GetSize() int32
- func (x *RedisInstance) GetStatus() string
- func (*RedisInstance) ProtoMessage()
- func (x *RedisInstance) ProtoReflect() protoreflect.Message
- func (x *RedisInstance) Reset()
- func (x *RedisInstance) String() string
- type RedisServiceClient
- type RedisServiceServer
- type UnimplementedRedisServiceServer
- type UnsafeRedisServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_idl_pbredis_redis_proto protoreflect.FileDescriptor
var RedisService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pbredis.RedisService", HandlerType: (*RedisServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListRedisDetail", Handler: _RedisService_ListRedisDetail_Handler, }, { MethodName: "ListRedis", Handler: _RedisService_ListRedis_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "idl/pbredis/redis.proto", }
RedisService_ServiceDesc is the grpc.ServiceDesc for RedisService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRedisServiceHandler ¶
func RegisterRedisServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterRedisServiceHandler registers the http handlers for service RedisService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterRedisServiceHandlerClient ¶
func RegisterRedisServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RedisServiceClient) error
RegisterRedisServiceHandlerClient registers the http handlers for service RedisService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RedisServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RedisServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RedisServiceClient" to call the correct interceptors.
func RegisterRedisServiceHandlerFromEndpoint ¶
func RegisterRedisServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterRedisServiceHandlerFromEndpoint is same as RegisterRedisServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterRedisServiceHandlerServer ¶
func RegisterRedisServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RedisServiceServer) error
RegisterRedisServiceHandlerServer registers the http handlers for service RedisService to "mux". UnaryRPC :call RedisServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterRedisServiceHandlerFromEndpoint instead.
func RegisterRedisServiceServer ¶
func RegisterRedisServiceServer(s grpc.ServiceRegistrar, srv RedisServiceServer)
Types ¶
type ListDetailReq ¶
type ListDetailReq struct { // 云名称 Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // 区域Id,参考 tenant.proto 中的各个云的区域 RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` // 分页相关参数,页码 PageNumber int32 `protobuf:"varint,4,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` // 分页相关参数,每页数量 PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 分页相关参数,下一页的token NextToken string `protobuf:"bytes,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` // contains filtered or unexported fields }
func (*ListDetailReq) Descriptor
deprecated
func (*ListDetailReq) Descriptor() ([]byte, []int)
Deprecated: Use ListDetailReq.ProtoReflect.Descriptor instead.
func (*ListDetailReq) GetAccountName ¶
func (x *ListDetailReq) GetAccountName() string
func (*ListDetailReq) GetNextToken ¶
func (x *ListDetailReq) GetNextToken() string
func (*ListDetailReq) GetPageNumber ¶
func (x *ListDetailReq) GetPageNumber() int32
func (*ListDetailReq) GetPageSize ¶
func (x *ListDetailReq) GetPageSize() int32
func (*ListDetailReq) GetProvider ¶
func (x *ListDetailReq) GetProvider() pbtenant.CloudProvider
func (*ListDetailReq) GetRegionId ¶
func (x *ListDetailReq) GetRegionId() int32
func (*ListDetailReq) ProtoMessage ¶
func (*ListDetailReq) ProtoMessage()
func (*ListDetailReq) ProtoReflect ¶
func (x *ListDetailReq) ProtoReflect() protoreflect.Message
func (*ListDetailReq) Reset ¶
func (x *ListDetailReq) Reset()
func (*ListDetailReq) String ¶
func (x *ListDetailReq) String() string
type ListDetailResp ¶
type ListDetailResp struct { // Redis 机器集合 Redises []*RedisInstance `protobuf:"bytes,1,rep,name=redises,proto3" json:"redises,omitempty"` // 查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询 Finished bool `protobuf:"varint,2,opt,name=finished,proto3" json:"finished,omitempty"` // 分页相关参数,页码 PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` // 分页相关参数,每页数量 PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 分页相关参数,下一页的token NextToken string `protobuf:"bytes,5,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` // 请求id,出现问题后提供给云厂商,排查问题 RequestId string `protobuf:"bytes,6,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // contains filtered or unexported fields }
func (*ListDetailResp) Descriptor
deprecated
func (*ListDetailResp) Descriptor() ([]byte, []int)
Deprecated: Use ListDetailResp.ProtoReflect.Descriptor instead.
func (*ListDetailResp) GetFinished ¶
func (x *ListDetailResp) GetFinished() bool
func (*ListDetailResp) GetNextToken ¶
func (x *ListDetailResp) GetNextToken() string
func (*ListDetailResp) GetPageNumber ¶
func (x *ListDetailResp) GetPageNumber() int32
func (*ListDetailResp) GetPageSize ¶
func (x *ListDetailResp) GetPageSize() int32
func (*ListDetailResp) GetRedises ¶
func (x *ListDetailResp) GetRedises() []*RedisInstance
func (*ListDetailResp) GetRequestId ¶
func (x *ListDetailResp) GetRequestId() string
func (*ListDetailResp) ProtoMessage ¶
func (*ListDetailResp) ProtoMessage()
func (*ListDetailResp) ProtoReflect ¶
func (x *ListDetailResp) ProtoReflect() protoreflect.Message
func (*ListDetailResp) Reset ¶
func (x *ListDetailResp) Reset()
func (*ListDetailResp) String ¶
func (x *ListDetailResp) String() string
type ListReq ¶
type ListReq struct { // 云名称 Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` // contains filtered or unexported fields }
func (*ListReq) Descriptor
deprecated
func (*ListReq) GetProvider ¶
func (x *ListReq) GetProvider() pbtenant.CloudProvider
func (*ListReq) ProtoMessage ¶
func (*ListReq) ProtoMessage()
func (*ListReq) ProtoReflect ¶
func (x *ListReq) ProtoReflect() protoreflect.Message
type ListResp ¶
type ListResp struct { // Redis 机器集合 Redises []*RedisInstance `protobuf:"bytes,1,rep,name=redises,proto3" json:"redises,omitempty"` // contains filtered or unexported fields }
func (*ListResp) Descriptor
deprecated
func (*ListResp) GetRedises ¶
func (x *ListResp) GetRedises() []*RedisInstance
func (*ListResp) ProtoMessage ¶
func (*ListResp) ProtoMessage()
func (*ListResp) ProtoReflect ¶
func (x *ListResp) ProtoReflect() protoreflect.Message
type RedisInstance ¶
type RedisInstance struct { // 云类型 Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` // 账号名称 AccoutName string `protobuf:"bytes,2,opt,name=accout_name,json=accoutName,proto3" json:"accout_name,omitempty"` // 实例id InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` // 实例名称 InstanceName string `protobuf:"bytes,4,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` // 地域,数据中心 RegionName string `protobuf:"bytes,5,opt,name=region_name,json=regionName,proto3" json:"region_name,omitempty"` // 实例容量大小,单位:MB Size int32 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` // 状态 Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` // 创建时间,ISO8601 CreationTime string `protobuf:"bytes,8,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` // 过期时间 ExpireTime string `protobuf:"bytes,9,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` // contains filtered or unexported fields }
func (*RedisInstance) Descriptor
deprecated
func (*RedisInstance) Descriptor() ([]byte, []int)
Deprecated: Use RedisInstance.ProtoReflect.Descriptor instead.
func (*RedisInstance) GetAccoutName ¶
func (x *RedisInstance) GetAccoutName() string
func (*RedisInstance) GetCreationTime ¶
func (x *RedisInstance) GetCreationTime() string
func (*RedisInstance) GetExpireTime ¶
func (x *RedisInstance) GetExpireTime() string
func (*RedisInstance) GetInstanceId ¶
func (x *RedisInstance) GetInstanceId() string
func (*RedisInstance) GetInstanceName ¶
func (x *RedisInstance) GetInstanceName() string
func (*RedisInstance) GetProvider ¶
func (x *RedisInstance) GetProvider() pbtenant.CloudProvider
func (*RedisInstance) GetRegionName ¶
func (x *RedisInstance) GetRegionName() string
func (*RedisInstance) GetSize ¶
func (x *RedisInstance) GetSize() int32
func (*RedisInstance) GetStatus ¶
func (x *RedisInstance) GetStatus() string
func (*RedisInstance) ProtoMessage ¶
func (*RedisInstance) ProtoMessage()
func (*RedisInstance) ProtoReflect ¶
func (x *RedisInstance) ProtoReflect() protoreflect.Message
func (*RedisInstance) Reset ¶
func (x *RedisInstance) Reset()
func (*RedisInstance) String ¶
func (x *RedisInstance) String() string
type RedisServiceClient ¶
type RedisServiceClient interface { // 查询Redis明细 - 支持云类型、区域、账户、分页等过滤条件 ListRedisDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error) // 查询Redis全量 - 根据云类型 ListRedis(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error) }
RedisServiceClient is the client API for RedisService 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 NewRedisServiceClient ¶
func NewRedisServiceClient(cc grpc.ClientConnInterface) RedisServiceClient
type RedisServiceServer ¶
type RedisServiceServer interface { // 查询Redis明细 - 支持云类型、区域、账户、分页等过滤条件 ListRedisDetail(context.Context, *ListDetailReq) (*ListDetailResp, error) // 查询Redis全量 - 根据云类型 ListRedis(context.Context, *ListReq) (*ListResp, error) // contains filtered or unexported methods }
RedisServiceServer is the server API for RedisService service. All implementations must embed UnimplementedRedisServiceServer for forward compatibility
type UnimplementedRedisServiceServer ¶
type UnimplementedRedisServiceServer struct { }
UnimplementedRedisServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedRedisServiceServer) ListRedisDetail ¶
func (UnimplementedRedisServiceServer) ListRedisDetail(context.Context, *ListDetailReq) (*ListDetailResp, error)
type UnsafeRedisServiceServer ¶
type UnsafeRedisServiceServer interface {
// contains filtered or unexported methods
}
UnsafeRedisServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RedisServiceServer will result in compilation errors.