Documentation ¶
Overview ¶
Package pbstatistic is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterStatisticServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterStatisticServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StatisticServiceClient) error
- func RegisterStatisticServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterStatisticServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StatisticServiceServer) error
- func RegisterStatisticServiceServer(s grpc.ServiceRegistrar, srv StatisticServiceServer)
- type StatisticAllReq
- type StatisticInfo
- func (*StatisticInfo) Descriptor() ([]byte, []int)deprecated
- func (x *StatisticInfo) GetAccountName() string
- func (x *StatisticInfo) GetCount() int32
- func (x *StatisticInfo) GetProduct() pbtenant.CloudProduct
- func (x *StatisticInfo) GetProvider() pbtenant.CloudProvider
- func (x *StatisticInfo) GetRegionId() int32
- func (x *StatisticInfo) GetRegionName() string
- func (*StatisticInfo) ProtoMessage()
- func (x *StatisticInfo) ProtoReflect() protoreflect.Message
- func (x *StatisticInfo) Reset()
- func (x *StatisticInfo) String() string
- type StatisticReq
- type StatisticResp
- type StatisticServiceClient
- type StatisticServiceServer
- type UnimplementedStatisticServiceServer
- type UnsafeStatisticServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_idl_pbstatistic_statistic_proto protoreflect.FileDescriptor
var StatisticService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pbstatistic.StatisticService", HandlerType: (*StatisticServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Statistic", Handler: _StatisticService_Statistic_Handler, }, { MethodName: "StatisticAll", Handler: _StatisticService_StatisticAll_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "idl/pbstatistic/statistic.proto", }
StatisticService_ServiceDesc is the grpc.ServiceDesc for StatisticService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStatisticServiceHandler ¶
func RegisterStatisticServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterStatisticServiceHandler registers the http handlers for service StatisticService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterStatisticServiceHandlerClient ¶
func RegisterStatisticServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StatisticServiceClient) error
RegisterStatisticServiceHandlerClient registers the http handlers for service StatisticService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StatisticServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StatisticServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "StatisticServiceClient" to call the correct interceptors.
func RegisterStatisticServiceHandlerFromEndpoint ¶
func RegisterStatisticServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterStatisticServiceHandlerFromEndpoint is same as RegisterStatisticServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterStatisticServiceHandlerServer ¶
func RegisterStatisticServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StatisticServiceServer) error
RegisterStatisticServiceHandlerServer registers the http handlers for service StatisticService to "mux". UnaryRPC :call StatisticServiceServer 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 RegisterStatisticServiceHandlerFromEndpoint instead.
func RegisterStatisticServiceServer ¶
func RegisterStatisticServiceServer(s grpc.ServiceRegistrar, srv StatisticServiceServer)
Types ¶
type StatisticAllReq ¶
type StatisticAllReq struct {
// contains filtered or unexported fields
}
func (*StatisticAllReq) Descriptor
deprecated
func (*StatisticAllReq) Descriptor() ([]byte, []int)
Deprecated: Use StatisticAllReq.ProtoReflect.Descriptor instead.
func (*StatisticAllReq) ProtoMessage ¶
func (*StatisticAllReq) ProtoMessage()
func (*StatisticAllReq) ProtoReflect ¶
func (x *StatisticAllReq) ProtoReflect() protoreflect.Message
func (*StatisticAllReq) Reset ¶
func (x *StatisticAllReq) Reset()
func (*StatisticAllReq) String ¶
func (x *StatisticAllReq) String() string
type StatisticInfo ¶
type StatisticInfo struct { // 云提供商 Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` // 账户名称,在config.yaml里配置的name AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // 资源类型,参考 tenant.proto 中的 CloudProduct Product pbtenant.CloudProduct `protobuf:"varint,3,opt,name=product,proto3,enum=pbtenant.CloudProduct" json:"product,omitempty"` // 区域Id,参考 tenant.proto 中的各个云的区域 RegionId int32 `protobuf:"varint,4,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` // 区域名称,方便可读,参考 tenant.proto 中的各个云的区域 RegionName string `protobuf:"bytes,5,opt,name=region_name,json=regionName,proto3" json:"region_name,omitempty"` // 数量 Count int32 `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*StatisticInfo) Descriptor
deprecated
func (*StatisticInfo) Descriptor() ([]byte, []int)
Deprecated: Use StatisticInfo.ProtoReflect.Descriptor instead.
func (*StatisticInfo) GetAccountName ¶
func (x *StatisticInfo) GetAccountName() string
func (*StatisticInfo) GetCount ¶
func (x *StatisticInfo) GetCount() int32
func (*StatisticInfo) GetProduct ¶
func (x *StatisticInfo) GetProduct() pbtenant.CloudProduct
func (*StatisticInfo) GetProvider ¶
func (x *StatisticInfo) GetProvider() pbtenant.CloudProvider
func (*StatisticInfo) GetRegionId ¶
func (x *StatisticInfo) GetRegionId() int32
func (*StatisticInfo) GetRegionName ¶
func (x *StatisticInfo) GetRegionName() string
func (*StatisticInfo) ProtoMessage ¶
func (*StatisticInfo) ProtoMessage()
func (*StatisticInfo) ProtoReflect ¶
func (x *StatisticInfo) ProtoReflect() protoreflect.Message
func (*StatisticInfo) Reset ¶
func (x *StatisticInfo) Reset()
func (*StatisticInfo) String ¶
func (x *StatisticInfo) String() string
type StatisticReq ¶
type StatisticReq struct { Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` // contains filtered or unexported fields }
func (*StatisticReq) Descriptor
deprecated
func (*StatisticReq) Descriptor() ([]byte, []int)
Deprecated: Use StatisticReq.ProtoReflect.Descriptor instead.
func (*StatisticReq) GetProvider ¶
func (x *StatisticReq) GetProvider() pbtenant.CloudProvider
func (*StatisticReq) ProtoMessage ¶
func (*StatisticReq) ProtoMessage()
func (*StatisticReq) ProtoReflect ¶
func (x *StatisticReq) ProtoReflect() protoreflect.Message
func (*StatisticReq) Reset ¶
func (x *StatisticReq) Reset()
func (*StatisticReq) String ¶
func (x *StatisticReq) String() string
type StatisticResp ¶
type StatisticResp struct { Cfgs []*StatisticInfo `protobuf:"bytes,1,rep,name=cfgs,proto3" json:"cfgs,omitempty"` // contains filtered or unexported fields }
func (*StatisticResp) Descriptor
deprecated
func (*StatisticResp) Descriptor() ([]byte, []int)
Deprecated: Use StatisticResp.ProtoReflect.Descriptor instead.
func (*StatisticResp) GetCfgs ¶
func (x *StatisticResp) GetCfgs() []*StatisticInfo
func (*StatisticResp) ProtoMessage ¶
func (*StatisticResp) ProtoMessage()
func (*StatisticResp) ProtoReflect ¶
func (x *StatisticResp) ProtoReflect() protoreflect.Message
func (*StatisticResp) Reset ¶
func (x *StatisticResp) Reset()
func (*StatisticResp) String ¶
func (x *StatisticResp) String() string
type StatisticServiceClient ¶
type StatisticServiceClient interface { // 按云统计云产品数量 Statistic(ctx context.Context, in *StatisticReq, opts ...grpc.CallOption) (*StatisticResp, error) // 全量统计云产品数量 StatisticAll(ctx context.Context, in *StatisticAllReq, opts ...grpc.CallOption) (*StatisticResp, error) }
StatisticServiceClient is the client API for StatisticService 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 NewStatisticServiceClient ¶
func NewStatisticServiceClient(cc grpc.ClientConnInterface) StatisticServiceClient
type StatisticServiceServer ¶
type StatisticServiceServer interface { // 按云统计云产品数量 Statistic(context.Context, *StatisticReq) (*StatisticResp, error) // 全量统计云产品数量 StatisticAll(context.Context, *StatisticAllReq) (*StatisticResp, error) // contains filtered or unexported methods }
StatisticServiceServer is the server API for StatisticService service. All implementations must embed UnimplementedStatisticServiceServer for forward compatibility
type UnimplementedStatisticServiceServer ¶
type UnimplementedStatisticServiceServer struct { }
UnimplementedStatisticServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedStatisticServiceServer) Statistic ¶
func (UnimplementedStatisticServiceServer) Statistic(context.Context, *StatisticReq) (*StatisticResp, error)
func (UnimplementedStatisticServiceServer) StatisticAll ¶
func (UnimplementedStatisticServiceServer) StatisticAll(context.Context, *StatisticAllReq) (*StatisticResp, error)
type UnsafeStatisticServiceServer ¶
type UnsafeStatisticServiceServer interface {
// contains filtered or unexported methods
}
UnsafeStatisticServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatisticServiceServer will result in compilation errors.