pbrds

package
v0.0.0-...-a156103 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package pbrds is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_idl_pbrds_rds_proto protoreflect.FileDescriptor
View Source
var RdsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pbrds.RdsService",
	HandlerType: (*RdsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListRdsDetail",
			Handler:    _RdsService_ListRdsDetail_Handler,
		},
		{
			MethodName: "ListRds",
			Handler:    _RdsService_ListRds_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "idl/pbrds/rds.proto",
}

RdsService_ServiceDesc is the grpc.ServiceDesc for RdsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRdsServiceHandler

func RegisterRdsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterRdsServiceHandler registers the http handlers for service RdsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterRdsServiceHandlerClient

func RegisterRdsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RdsServiceClient) error

RegisterRdsServiceHandlerClient registers the http handlers for service RdsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RdsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RdsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RdsServiceClient" to call the correct interceptors.

func RegisterRdsServiceHandlerFromEndpoint

func RegisterRdsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterRdsServiceHandlerFromEndpoint is same as RegisterRdsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterRdsServiceHandlerServer

func RegisterRdsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RdsServiceServer) error

RegisterRdsServiceHandlerServer registers the http handlers for service RdsService to "mux". UnaryRPC :call RdsServiceServer 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 RegisterRdsServiceHandlerFromEndpoint instead.

func RegisterRdsServiceServer

func RegisterRdsServiceServer(s grpc.ServiceRegistrar, srv RdsServiceServer)

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 {

	// Rds 机器集合
	Rdses []*RdsInstance `protobuf:"bytes,1,rep,name=rdses,proto3" json:"rdses,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) GetRdses

func (x *ListDetailResp) GetRdses() []*RdsInstance

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

Deprecated: Use ListReq.ProtoReflect.Descriptor instead.

func (*ListReq) GetProvider

func (x *ListReq) GetProvider() pbtenant.CloudProvider

func (*ListReq) ProtoMessage

func (*ListReq) ProtoMessage()

func (*ListReq) ProtoReflect

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

func (*ListReq) Reset

func (x *ListReq) Reset()

func (*ListReq) String

func (x *ListReq) String() string

type ListResp

type ListResp struct {

	// Rds 机器集合
	Rdses []*RdsInstance `protobuf:"bytes,1,rep,name=rdses,proto3" json:"rdses,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResp) Descriptor deprecated

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

Deprecated: Use ListResp.ProtoReflect.Descriptor instead.

func (*ListResp) GetRdses

func (x *ListResp) GetRdses() []*RdsInstance

func (*ListResp) ProtoMessage

func (*ListResp) ProtoMessage()

func (*ListResp) ProtoReflect

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

func (*ListResp) Reset

func (x *ListResp) Reset()

func (*ListResp) String

func (x *ListResp) String() string

type RdsInstance

type RdsInstance 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"`
	// 实例类型
	InstanceType string `protobuf:"bytes,6,opt,name=instance_type,json=instanceType,proto3" json:"instance_type,omitempty"`
	// 数据库类型
	Engine string `protobuf:"bytes,7,opt,name=engine,proto3" json:"engine,omitempty"`
	// 数据库类型的版本
	EngineVersion string `protobuf:"bytes,8,opt,name=engine_version,json=engineVersion,proto3" json:"engine_version,omitempty"`
	// 数据库实例规格
	InstanceClass string `protobuf:"bytes,9,opt,name=instance_class,json=instanceClass,proto3" json:"instance_class,omitempty"`
	// 状态
	Status string `protobuf:"bytes,10,opt,name=status,proto3" json:"status,omitempty"`
	// 创建时间,ISO8601
	CreationTime string `protobuf:"bytes,11,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
	// 过期时间
	ExpireTime string `protobuf:"bytes,12,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
	// contains filtered or unexported fields
}

func (*RdsInstance) Descriptor deprecated

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

Deprecated: Use RdsInstance.ProtoReflect.Descriptor instead.

func (*RdsInstance) GetAccoutName

func (x *RdsInstance) GetAccoutName() string

func (*RdsInstance) GetCreationTime

func (x *RdsInstance) GetCreationTime() string

func (*RdsInstance) GetEngine

func (x *RdsInstance) GetEngine() string

func (*RdsInstance) GetEngineVersion

func (x *RdsInstance) GetEngineVersion() string

func (*RdsInstance) GetExpireTime

func (x *RdsInstance) GetExpireTime() string

func (*RdsInstance) GetInstanceClass

func (x *RdsInstance) GetInstanceClass() string

func (*RdsInstance) GetInstanceId

func (x *RdsInstance) GetInstanceId() string

func (*RdsInstance) GetInstanceName

func (x *RdsInstance) GetInstanceName() string

func (*RdsInstance) GetInstanceType

func (x *RdsInstance) GetInstanceType() string

func (*RdsInstance) GetProvider

func (x *RdsInstance) GetProvider() pbtenant.CloudProvider

func (*RdsInstance) GetRegionName

func (x *RdsInstance) GetRegionName() string

func (*RdsInstance) GetStatus

func (x *RdsInstance) GetStatus() string

func (*RdsInstance) ProtoMessage

func (*RdsInstance) ProtoMessage()

func (*RdsInstance) ProtoReflect

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

func (*RdsInstance) Reset

func (x *RdsInstance) Reset()

func (*RdsInstance) String

func (x *RdsInstance) String() string

type RdsServiceClient

type RdsServiceClient interface {
	// 查询RDS明细 - 支持云类型、区域、账户、分页等过滤条件
	ListRdsDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error)
	// 查询RDS全量 - 根据云类型
	ListRds(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error)
}

RdsServiceClient is the client API for RdsService 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 NewRdsServiceClient

func NewRdsServiceClient(cc grpc.ClientConnInterface) RdsServiceClient

type RdsServiceServer

type RdsServiceServer interface {
	// 查询RDS明细 - 支持云类型、区域、账户、分页等过滤条件
	ListRdsDetail(context.Context, *ListDetailReq) (*ListDetailResp, error)
	// 查询RDS全量 - 根据云类型
	ListRds(context.Context, *ListReq) (*ListResp, error)
	// contains filtered or unexported methods
}

RdsServiceServer is the server API for RdsService service. All implementations must embed UnimplementedRdsServiceServer for forward compatibility

type UnimplementedRdsServiceServer

type UnimplementedRdsServiceServer struct {
}

UnimplementedRdsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRdsServiceServer) ListRds

func (UnimplementedRdsServiceServer) ListRdsDetail

type UnsafeRdsServiceServer

type UnsafeRdsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeRdsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RdsServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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