mirror of
https://github.com/singchia/frontier.git
synced 2025-09-26 20:31:25 +08:00
frontlas: add controlplane http apis
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -35,34 +35,27 @@ message GetFrontierByEdgeIDResponse {
|
||||
Frontier fontier = 1;
|
||||
}
|
||||
|
||||
// multi get frontiers
|
||||
message GetFrontiersByEdgeIDsRequest {
|
||||
repeated uint64 edge_ids = 1;
|
||||
}
|
||||
|
||||
message GetFrontiersByEdgeIDsResponse {
|
||||
repeated Frontier frontiers = 1;
|
||||
}
|
||||
|
||||
// list frontiers
|
||||
message ListFrontiersRequest {
|
||||
uint32 cursor = 1;
|
||||
uint32 count = 2;
|
||||
optional uint32 cursor = 1;
|
||||
optional uint32 count = 2;
|
||||
repeated uint64 edge_ids = 3;
|
||||
}
|
||||
|
||||
message ListFrontiersResponse {
|
||||
uint32 cursor = 1;
|
||||
optional uint32 cursor = 1;
|
||||
repeated Frontier frontiers = 2;
|
||||
}
|
||||
|
||||
// list edges
|
||||
message ListEdgesRequest {
|
||||
uint32 cursor = 1;
|
||||
uint32 count = 2;
|
||||
optional uint32 cursor = 1;
|
||||
optional uint32 count = 2;
|
||||
optional uint64 edge_ids = 3;
|
||||
}
|
||||
|
||||
message ListEdgesResponse {
|
||||
uint32 cursor = 1;
|
||||
optional uint32 cursor = 1;
|
||||
repeated Edge edges = 2;
|
||||
}
|
||||
|
||||
@@ -75,23 +68,22 @@ message GetEdgeByIDResponse {
|
||||
Edge edge = 1;
|
||||
}
|
||||
|
||||
// get edges
|
||||
message GetEdgesByIDsRequest {
|
||||
repeated uint64 edge_ids = 1;
|
||||
}
|
||||
// get edges count
|
||||
message GetEdgesCountRequest {}
|
||||
|
||||
message GetEdgesByIDsResponse {
|
||||
repeated Edge edges = 2;
|
||||
message GetEdgesCountResponse {
|
||||
uint64 count = 1;
|
||||
}
|
||||
|
||||
// list services
|
||||
message ListServicesRequest {
|
||||
uint32 cursor = 1;
|
||||
uint32 count = 2;
|
||||
optional uint32 cursor = 1;
|
||||
optional uint32 count = 2;
|
||||
repeated uint64 service_id = 3;
|
||||
}
|
||||
|
||||
message ListServicesResponse {
|
||||
uint32 cursor = 1;
|
||||
optional uint32 cursor = 1;
|
||||
repeated Service services = 2;
|
||||
}
|
||||
|
||||
@@ -104,25 +96,54 @@ message GetServiceByIDResponse {
|
||||
Service service = 1;
|
||||
}
|
||||
|
||||
// get services
|
||||
message GetServicesByIDsRequest {
|
||||
repeated uint64 service_id = 1;
|
||||
}
|
||||
// get services count
|
||||
message GetServicesCountRequest {}
|
||||
|
||||
message GetServicesByIDsResponse {
|
||||
repeated Service service = 1;
|
||||
message GetServicesCountResponse {
|
||||
uint64 count = 1;
|
||||
}
|
||||
|
||||
service ClusterService {
|
||||
rpc GetFrontierByEdge(GetFrontierByEdgeIDRequest) returns (GetFrontierByEdgeIDResponse);
|
||||
rpc MultiGetFrontiersByEdges(GetFrontiersByEdgeIDsRequest) returns (GetFrontiersByEdgeIDsResponse);
|
||||
rpc ListFrontiers(ListFrontiersRequest) returns (ListFrontiersResponse);
|
||||
rpc GetFrontierByEdge(GetFrontierByEdgeIDRequest) returns (GetFrontierByEdgeIDResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/frontier"
|
||||
};
|
||||
};
|
||||
rpc ListFrontiers(ListFrontiersRequest) returns (ListFrontiersResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/frontiers"
|
||||
};
|
||||
};
|
||||
|
||||
rpc ListEdges(ListEdgesRequest) returns (ListEdgesResponse);
|
||||
rpc GetEdgesByIDs(GetEdgesByIDsRequest) returns (GetEdgesByIDsResponse);
|
||||
rpc GetEdgeByID(GetEdgeByIDRequest) return (GetEdgeByIDResponse);
|
||||
rpc ListEdges(ListEdgesRequest) returns (ListEdgesResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/edges"
|
||||
};
|
||||
};
|
||||
rpc GetEdgeByID(GetEdgeByIDRequest) returns (GetEdgeByIDResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/edge"
|
||||
};
|
||||
};
|
||||
rpc GetEdgesCount(GetEdgesCountRequest) returns (GetEdgesCountResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/edges/count"
|
||||
};
|
||||
};
|
||||
|
||||
rpc ListServices(ListServicesRequest) returns (ListServicesResponse);
|
||||
rpc GetServicesByIDs(GetServicesByIDsRequest) returns (GetServicesByIDsResponse);
|
||||
rpc GetServiceByID(GetServiceByIDRequest) returns (GetServiceByIDResponse);
|
||||
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/services"
|
||||
};
|
||||
};
|
||||
rpc GetServiceByID(GetServiceByIDRequest) returns (GetServiceByIDResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/service"
|
||||
};
|
||||
};
|
||||
rpc GetServicesCount(GetServicesCountRequest) returns (GetServicesCountResponse) {
|
||||
option(google.api.http) = {
|
||||
get: "/cluster/v1/services/count"
|
||||
};
|
||||
};
|
||||
}
|
@@ -19,8 +19,14 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
ClusterService_GetFrontierByEdge_FullMethodName = "/controlplane.ClusterService/GetFrontierByEdge"
|
||||
ClusterService_MultiGetFrontiersByEdges_FullMethodName = "/controlplane.ClusterService/MultiGetFrontiersByEdges"
|
||||
ClusterService_GetFrontierByEdge_FullMethodName = "/controlplane.ClusterService/GetFrontierByEdge"
|
||||
ClusterService_ListFrontiers_FullMethodName = "/controlplane.ClusterService/ListFrontiers"
|
||||
ClusterService_ListEdges_FullMethodName = "/controlplane.ClusterService/ListEdges"
|
||||
ClusterService_GetEdgeByID_FullMethodName = "/controlplane.ClusterService/GetEdgeByID"
|
||||
ClusterService_GetEdgesCount_FullMethodName = "/controlplane.ClusterService/GetEdgesCount"
|
||||
ClusterService_ListServices_FullMethodName = "/controlplane.ClusterService/ListServices"
|
||||
ClusterService_GetServiceByID_FullMethodName = "/controlplane.ClusterService/GetServiceByID"
|
||||
ClusterService_GetServicesCount_FullMethodName = "/controlplane.ClusterService/GetServicesCount"
|
||||
)
|
||||
|
||||
// ClusterServiceClient is the client API for ClusterService service.
|
||||
@@ -28,7 +34,13 @@ const (
|
||||
// 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.
|
||||
type ClusterServiceClient interface {
|
||||
GetFrontierByEdge(ctx context.Context, in *GetFrontierByEdgeIDRequest, opts ...grpc.CallOption) (*GetFrontierByEdgeIDResponse, error)
|
||||
MultiGetFrontiersByEdges(ctx context.Context, in *GetFrontierByEdgeIDsRequest, opts ...grpc.CallOption) (*GetFrontiersByEdgeIDsResponse, error)
|
||||
ListFrontiers(ctx context.Context, in *ListFrontiersRequest, opts ...grpc.CallOption) (*ListFrontiersResponse, error)
|
||||
ListEdges(ctx context.Context, in *ListEdgesRequest, opts ...grpc.CallOption) (*ListEdgesResponse, error)
|
||||
GetEdgeByID(ctx context.Context, in *GetEdgeByIDRequest, opts ...grpc.CallOption) (*GetEdgeByIDResponse, error)
|
||||
GetEdgesCount(ctx context.Context, in *GetEdgesCountRequest, opts ...grpc.CallOption) (*GetEdgesCountResponse, error)
|
||||
ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error)
|
||||
GetServiceByID(ctx context.Context, in *GetServiceByIDRequest, opts ...grpc.CallOption) (*GetServiceByIDResponse, error)
|
||||
GetServicesCount(ctx context.Context, in *GetServicesCountRequest, opts ...grpc.CallOption) (*GetServicesCountResponse, error)
|
||||
}
|
||||
|
||||
type clusterServiceClient struct {
|
||||
@@ -48,9 +60,63 @@ func (c *clusterServiceClient) GetFrontierByEdge(ctx context.Context, in *GetFro
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) MultiGetFrontiersByEdges(ctx context.Context, in *GetFrontierByEdgeIDsRequest, opts ...grpc.CallOption) (*GetFrontiersByEdgeIDsResponse, error) {
|
||||
out := new(GetFrontiersByEdgeIDsResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_MultiGetFrontiersByEdges_FullMethodName, in, out, opts...)
|
||||
func (c *clusterServiceClient) ListFrontiers(ctx context.Context, in *ListFrontiersRequest, opts ...grpc.CallOption) (*ListFrontiersResponse, error) {
|
||||
out := new(ListFrontiersResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_ListFrontiers_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) ListEdges(ctx context.Context, in *ListEdgesRequest, opts ...grpc.CallOption) (*ListEdgesResponse, error) {
|
||||
out := new(ListEdgesResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_ListEdges_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) GetEdgeByID(ctx context.Context, in *GetEdgeByIDRequest, opts ...grpc.CallOption) (*GetEdgeByIDResponse, error) {
|
||||
out := new(GetEdgeByIDResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_GetEdgeByID_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) GetEdgesCount(ctx context.Context, in *GetEdgesCountRequest, opts ...grpc.CallOption) (*GetEdgesCountResponse, error) {
|
||||
out := new(GetEdgesCountResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_GetEdgesCount_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) {
|
||||
out := new(ListServicesResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_ListServices_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) GetServiceByID(ctx context.Context, in *GetServiceByIDRequest, opts ...grpc.CallOption) (*GetServiceByIDResponse, error) {
|
||||
out := new(GetServiceByIDResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_GetServiceByID_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *clusterServiceClient) GetServicesCount(ctx context.Context, in *GetServicesCountRequest, opts ...grpc.CallOption) (*GetServicesCountResponse, error) {
|
||||
out := new(GetServicesCountResponse)
|
||||
err := c.cc.Invoke(ctx, ClusterService_GetServicesCount_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -62,7 +128,13 @@ func (c *clusterServiceClient) MultiGetFrontiersByEdges(ctx context.Context, in
|
||||
// for forward compatibility
|
||||
type ClusterServiceServer interface {
|
||||
GetFrontierByEdge(context.Context, *GetFrontierByEdgeIDRequest) (*GetFrontierByEdgeIDResponse, error)
|
||||
MultiGetFrontiersByEdges(context.Context, *GetFrontierByEdgeIDsRequest) (*GetFrontiersByEdgeIDsResponse, error)
|
||||
ListFrontiers(context.Context, *ListFrontiersRequest) (*ListFrontiersResponse, error)
|
||||
ListEdges(context.Context, *ListEdgesRequest) (*ListEdgesResponse, error)
|
||||
GetEdgeByID(context.Context, *GetEdgeByIDRequest) (*GetEdgeByIDResponse, error)
|
||||
GetEdgesCount(context.Context, *GetEdgesCountRequest) (*GetEdgesCountResponse, error)
|
||||
ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error)
|
||||
GetServiceByID(context.Context, *GetServiceByIDRequest) (*GetServiceByIDResponse, error)
|
||||
GetServicesCount(context.Context, *GetServicesCountRequest) (*GetServicesCountResponse, error)
|
||||
mustEmbedUnimplementedClusterServiceServer()
|
||||
}
|
||||
|
||||
@@ -73,8 +145,26 @@ type UnimplementedClusterServiceServer struct {
|
||||
func (UnimplementedClusterServiceServer) GetFrontierByEdge(context.Context, *GetFrontierByEdgeIDRequest) (*GetFrontierByEdgeIDResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetFrontierByEdge not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) MultiGetFrontiersByEdges(context.Context, *GetFrontierByEdgeIDsRequest) (*GetFrontiersByEdgeIDsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method MultiGetFrontiersByEdges not implemented")
|
||||
func (UnimplementedClusterServiceServer) ListFrontiers(context.Context, *ListFrontiersRequest) (*ListFrontiersResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListFrontiers not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) ListEdges(context.Context, *ListEdgesRequest) (*ListEdgesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListEdges not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) GetEdgeByID(context.Context, *GetEdgeByIDRequest) (*GetEdgeByIDResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetEdgeByID not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) GetEdgesCount(context.Context, *GetEdgesCountRequest) (*GetEdgesCountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetEdgesCount not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) GetServiceByID(context.Context, *GetServiceByIDRequest) (*GetServiceByIDResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetServiceByID not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) GetServicesCount(context.Context, *GetServicesCountRequest) (*GetServicesCountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetServicesCount not implemented")
|
||||
}
|
||||
func (UnimplementedClusterServiceServer) mustEmbedUnimplementedClusterServiceServer() {}
|
||||
|
||||
@@ -107,20 +197,128 @@ func _ClusterService_GetFrontierByEdge_Handler(srv interface{}, ctx context.Cont
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_MultiGetFrontiersByEdges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetFrontierByEdgeIDsRequest)
|
||||
func _ClusterService_ListFrontiers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListFrontiersRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).MultiGetFrontiersByEdges(ctx, in)
|
||||
return srv.(ClusterServiceServer).ListFrontiers(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_MultiGetFrontiersByEdges_FullMethodName,
|
||||
FullMethod: ClusterService_ListFrontiers_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).MultiGetFrontiersByEdges(ctx, req.(*GetFrontierByEdgeIDsRequest))
|
||||
return srv.(ClusterServiceServer).ListFrontiers(ctx, req.(*ListFrontiersRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_ListEdges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListEdgesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).ListEdges(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_ListEdges_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).ListEdges(ctx, req.(*ListEdgesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_GetEdgeByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetEdgeByIDRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).GetEdgeByID(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_GetEdgeByID_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).GetEdgeByID(ctx, req.(*GetEdgeByIDRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_GetEdgesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetEdgesCountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).GetEdgesCount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_GetEdgesCount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).GetEdgesCount(ctx, req.(*GetEdgesCountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListServicesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).ListServices(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_ListServices_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).ListServices(ctx, req.(*ListServicesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_GetServiceByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetServiceByIDRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).GetServiceByID(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_GetServiceByID_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).GetServiceByID(ctx, req.(*GetServiceByIDRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ClusterService_GetServicesCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetServicesCountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ClusterServiceServer).GetServicesCount(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ClusterService_GetServicesCount_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ClusterServiceServer).GetServicesCount(ctx, req.(*GetServicesCountRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -137,8 +335,32 @@ var ClusterService_ServiceDesc = grpc.ServiceDesc{
|
||||
Handler: _ClusterService_GetFrontierByEdge_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "MultiGetFrontiersByEdges",
|
||||
Handler: _ClusterService_MultiGetFrontiersByEdges_Handler,
|
||||
MethodName: "ListFrontiers",
|
||||
Handler: _ClusterService_ListFrontiers_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListEdges",
|
||||
Handler: _ClusterService_ListEdges_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetEdgeByID",
|
||||
Handler: _ClusterService_GetEdgeByID_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetEdgesCount",
|
||||
Handler: _ClusterService_GetEdgesCount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListServices",
|
||||
Handler: _ClusterService_ListServices_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetServiceByID",
|
||||
Handler: _ClusterService_GetServiceByID_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetServicesCount",
|
||||
Handler: _ClusterService_GetServicesCount_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
327
api/controlplane/frontlas/v1/controlplane_http.pb.go
Normal file
327
api/controlplane/frontlas/v1/controlplane_http.pb.go
Normal file
@@ -0,0 +1,327 @@
|
||||
// Code generated by protoc-gen-go-http. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-http v2.6.1
|
||||
// - protoc v3.14.0
|
||||
// source: controlplane.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
http "github.com/go-kratos/kratos/v2/transport/http"
|
||||
binding "github.com/go-kratos/kratos/v2/transport/http/binding"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the kratos package it is being compiled against.
|
||||
var _ = new(context.Context)
|
||||
var _ = binding.EncodeURL
|
||||
|
||||
const _ = http.SupportPackageIsVersion1
|
||||
|
||||
const OperationClusterServiceGetEdgeByID = "/controlplane.ClusterService/GetEdgeByID"
|
||||
const OperationClusterServiceGetEdgesCount = "/controlplane.ClusterService/GetEdgesCount"
|
||||
const OperationClusterServiceGetFrontierByEdge = "/controlplane.ClusterService/GetFrontierByEdge"
|
||||
const OperationClusterServiceGetServiceByID = "/controlplane.ClusterService/GetServiceByID"
|
||||
const OperationClusterServiceGetServicesCount = "/controlplane.ClusterService/GetServicesCount"
|
||||
const OperationClusterServiceListEdges = "/controlplane.ClusterService/ListEdges"
|
||||
const OperationClusterServiceListFrontiers = "/controlplane.ClusterService/ListFrontiers"
|
||||
const OperationClusterServiceListServices = "/controlplane.ClusterService/ListServices"
|
||||
|
||||
type ClusterServiceHTTPServer interface {
|
||||
GetEdgeByID(context.Context, *GetEdgeByIDRequest) (*GetEdgeByIDResponse, error)
|
||||
GetEdgesCount(context.Context, *GetEdgesCountRequest) (*GetEdgesCountResponse, error)
|
||||
GetFrontierByEdge(context.Context, *GetFrontierByEdgeIDRequest) (*GetFrontierByEdgeIDResponse, error)
|
||||
GetServiceByID(context.Context, *GetServiceByIDRequest) (*GetServiceByIDResponse, error)
|
||||
GetServicesCount(context.Context, *GetServicesCountRequest) (*GetServicesCountResponse, error)
|
||||
ListEdges(context.Context, *ListEdgesRequest) (*ListEdgesResponse, error)
|
||||
ListFrontiers(context.Context, *ListFrontiersRequest) (*ListFrontiersResponse, error)
|
||||
ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error)
|
||||
}
|
||||
|
||||
func RegisterClusterServiceHTTPServer(s *http.Server, srv ClusterServiceHTTPServer) {
|
||||
r := s.Route("/")
|
||||
r.GET("/cluster/v1/frontier", _ClusterService_GetFrontierByEdge0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/frontiers", _ClusterService_ListFrontiers0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/edges", _ClusterService_ListEdges0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/edge", _ClusterService_GetEdgeByID0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/edges/count", _ClusterService_GetEdgesCount0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/services", _ClusterService_ListServices0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/service", _ClusterService_GetServiceByID0_HTTP_Handler(srv))
|
||||
r.GET("/cluster/v1/services/count", _ClusterService_GetServicesCount0_HTTP_Handler(srv))
|
||||
}
|
||||
|
||||
func _ClusterService_GetFrontierByEdge0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in GetFrontierByEdgeIDRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceGetFrontierByEdge)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.GetFrontierByEdge(ctx, req.(*GetFrontierByEdgeIDRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*GetFrontierByEdgeIDResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_ListFrontiers0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in ListFrontiersRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceListFrontiers)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.ListFrontiers(ctx, req.(*ListFrontiersRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*ListFrontiersResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_ListEdges0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in ListEdgesRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceListEdges)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.ListEdges(ctx, req.(*ListEdgesRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*ListEdgesResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_GetEdgeByID0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in GetEdgeByIDRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceGetEdgeByID)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.GetEdgeByID(ctx, req.(*GetEdgeByIDRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*GetEdgeByIDResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_GetEdgesCount0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in GetEdgesCountRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceGetEdgesCount)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.GetEdgesCount(ctx, req.(*GetEdgesCountRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*GetEdgesCountResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_ListServices0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in ListServicesRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceListServices)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.ListServices(ctx, req.(*ListServicesRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*ListServicesResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_GetServiceByID0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in GetServiceByIDRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceGetServiceByID)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.GetServiceByID(ctx, req.(*GetServiceByIDRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*GetServiceByIDResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
func _ClusterService_GetServicesCount0_HTTP_Handler(srv ClusterServiceHTTPServer) func(ctx http.Context) error {
|
||||
return func(ctx http.Context) error {
|
||||
var in GetServicesCountRequest
|
||||
if err := ctx.BindQuery(&in); err != nil {
|
||||
return err
|
||||
}
|
||||
http.SetOperation(ctx, OperationClusterServiceGetServicesCount)
|
||||
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.GetServicesCount(ctx, req.(*GetServicesCountRequest))
|
||||
})
|
||||
out, err := h(ctx, &in)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
reply := out.(*GetServicesCountResponse)
|
||||
return ctx.Result(200, reply)
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterServiceHTTPClient interface {
|
||||
GetEdgeByID(ctx context.Context, req *GetEdgeByIDRequest, opts ...http.CallOption) (rsp *GetEdgeByIDResponse, err error)
|
||||
GetEdgesCount(ctx context.Context, req *GetEdgesCountRequest, opts ...http.CallOption) (rsp *GetEdgesCountResponse, err error)
|
||||
GetFrontierByEdge(ctx context.Context, req *GetFrontierByEdgeIDRequest, opts ...http.CallOption) (rsp *GetFrontierByEdgeIDResponse, err error)
|
||||
GetServiceByID(ctx context.Context, req *GetServiceByIDRequest, opts ...http.CallOption) (rsp *GetServiceByIDResponse, err error)
|
||||
GetServicesCount(ctx context.Context, req *GetServicesCountRequest, opts ...http.CallOption) (rsp *GetServicesCountResponse, err error)
|
||||
ListEdges(ctx context.Context, req *ListEdgesRequest, opts ...http.CallOption) (rsp *ListEdgesResponse, err error)
|
||||
ListFrontiers(ctx context.Context, req *ListFrontiersRequest, opts ...http.CallOption) (rsp *ListFrontiersResponse, err error)
|
||||
ListServices(ctx context.Context, req *ListServicesRequest, opts ...http.CallOption) (rsp *ListServicesResponse, err error)
|
||||
}
|
||||
|
||||
type ClusterServiceHTTPClientImpl struct {
|
||||
cc *http.Client
|
||||
}
|
||||
|
||||
func NewClusterServiceHTTPClient(client *http.Client) ClusterServiceHTTPClient {
|
||||
return &ClusterServiceHTTPClientImpl{client}
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) GetEdgeByID(ctx context.Context, in *GetEdgeByIDRequest, opts ...http.CallOption) (*GetEdgeByIDResponse, error) {
|
||||
var out GetEdgeByIDResponse
|
||||
pattern := "/cluster/v1/edge"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceGetEdgeByID))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) GetEdgesCount(ctx context.Context, in *GetEdgesCountRequest, opts ...http.CallOption) (*GetEdgesCountResponse, error) {
|
||||
var out GetEdgesCountResponse
|
||||
pattern := "/cluster/v1/edges/count"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceGetEdgesCount))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) GetFrontierByEdge(ctx context.Context, in *GetFrontierByEdgeIDRequest, opts ...http.CallOption) (*GetFrontierByEdgeIDResponse, error) {
|
||||
var out GetFrontierByEdgeIDResponse
|
||||
pattern := "/cluster/v1/frontier"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceGetFrontierByEdge))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) GetServiceByID(ctx context.Context, in *GetServiceByIDRequest, opts ...http.CallOption) (*GetServiceByIDResponse, error) {
|
||||
var out GetServiceByIDResponse
|
||||
pattern := "/cluster/v1/service"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceGetServiceByID))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) GetServicesCount(ctx context.Context, in *GetServicesCountRequest, opts ...http.CallOption) (*GetServicesCountResponse, error) {
|
||||
var out GetServicesCountResponse
|
||||
pattern := "/cluster/v1/services/count"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceGetServicesCount))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) ListEdges(ctx context.Context, in *ListEdgesRequest, opts ...http.CallOption) (*ListEdgesResponse, error) {
|
||||
var out ListEdgesResponse
|
||||
pattern := "/cluster/v1/edges"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceListEdges))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) ListFrontiers(ctx context.Context, in *ListFrontiersRequest, opts ...http.CallOption) (*ListFrontiersResponse, error) {
|
||||
var out ListFrontiersResponse
|
||||
pattern := "/cluster/v1/frontiers"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceListFrontiers))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
||||
|
||||
func (c *ClusterServiceHTTPClientImpl) ListServices(ctx context.Context, in *ListServicesRequest, opts ...http.CallOption) (*ListServicesResponse, error) {
|
||||
var out ListServicesResponse
|
||||
pattern := "/cluster/v1/services"
|
||||
path := binding.EncodeURL(pattern, in, true)
|
||||
opts = append(opts, http.Operation(OperationClusterServiceListServices))
|
||||
opts = append(opts, http.PathTemplate(pattern))
|
||||
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, err
|
||||
}
|
Reference in New Issue
Block a user