pboss

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 pboss is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_idl_pboss_oss_proto protoreflect.FileDescriptor
View Source
var OssService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pboss.OssService",
	HandlerType: (*OssServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListOssDetail",
			Handler:    _OssService_ListOssDetail_Handler,
		},
		{
			MethodName: "ListOss",
			Handler:    _OssService_ListOss_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "idl/pboss/oss.proto",
}

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

Functions

func RegisterOssServiceHandler

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

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

func RegisterOssServiceHandlerClient

func RegisterOssServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OssServiceClient) error

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

func RegisterOssServiceHandlerFromEndpoint

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

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

func RegisterOssServiceHandlerServer

func RegisterOssServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OssServiceServer) error

RegisterOssServiceHandlerServer registers the http handlers for service OssService to "mux". UnaryRPC :call OssServiceServer 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 RegisterOssServiceHandlerFromEndpoint instead.

func RegisterOssServiceServer

func RegisterOssServiceServer(s grpc.ServiceRegistrar, srv OssServiceServer)

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"`
	// 分页相关参数,页码
	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"`
	// 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) 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 {

	// Oss 机器集合
	Osses []*OssInstance `protobuf:"bytes,1,rep,name=osses,proto3" json:"osses,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) GetOsses

func (x *ListDetailResp) GetOsses() []*OssInstance

func (*ListDetailResp) GetPageNumber

func (x *ListDetailResp) GetPageNumber() int32

func (*ListDetailResp) GetPageSize

func (x *ListDetailResp) GetPageSize() int32

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 {

	// Oss 机器集合
	Osses []*OssInstance `protobuf:"bytes,1,rep,name=osses,proto3" json:"osses,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResp) Descriptor deprecated

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

Deprecated: Use ListResp.ProtoReflect.Descriptor instead.

func (*ListResp) GetOsses

func (x *ListResp) GetOsses() []*OssInstance

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 OssInstance

type OssInstance struct {

	// 云类型
	Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"`
	// 账号名称
	AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"`
	// bucket名称
	BucketName string `protobuf:"bytes,3,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"`
	// 区域
	Location string `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"`
	// contains filtered or unexported fields
}

func (*OssInstance) Descriptor deprecated

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

Deprecated: Use OssInstance.ProtoReflect.Descriptor instead.

func (*OssInstance) GetAccountName

func (x *OssInstance) GetAccountName() string

func (*OssInstance) GetBucketName

func (x *OssInstance) GetBucketName() string

func (*OssInstance) GetLocation

func (x *OssInstance) GetLocation() string

func (*OssInstance) GetProvider

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

func (*OssInstance) ProtoMessage

func (*OssInstance) ProtoMessage()

func (*OssInstance) ProtoReflect

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

func (*OssInstance) Reset

func (x *OssInstance) Reset()

func (*OssInstance) String

func (x *OssInstance) String() string

type OssServiceClient

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

OssServiceClient is the client API for OssService 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 NewOssServiceClient

func NewOssServiceClient(cc grpc.ClientConnInterface) OssServiceClient

type OssServiceServer

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

OssServiceServer is the server API for OssService service. All implementations must embed UnimplementedOssServiceServer for forward compatibility

type UnimplementedOssServiceServer

type UnimplementedOssServiceServer struct {
}

UnimplementedOssServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedOssServiceServer) ListOss

func (UnimplementedOssServiceServer) ListOssDetail

type UnsafeOssServiceServer

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

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

Jump to

Keyboard shortcuts

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