🚚 Rename protobuf
This commit is contained in:
@ -657,28 +657,28 @@ var file_auth_proto_rawDesc = []byte{
|
||||
0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x73, 0x65,
|
||||
0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xb5, 0x02, 0x0a, 0x04,
|
||||
0x41, 0x75, 0x74, 0x68, 0x12, 0x36, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69,
|
||||
0x63, 0x61, 0x74, 0x65, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74,
|
||||
0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x11,
|
||||
0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65,
|
||||
0x64, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50,
|
||||
0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x15, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65,
|
||||
0x55, 0x73, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12,
|
||||
0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65,
|
||||
0x72, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65,
|
||||
0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10,
|
||||
0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xbc, 0x02, 0x0a, 0x0b,
|
||||
0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x0c, 0x41,
|
||||
0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x12, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6c,
|
||||
0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x11, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x50, 0x65, 0x72,
|
||||
0x6d, 0x47, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50,
|
||||
0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a,
|
||||
0x15, 0x45, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x47,
|
||||
0x72, 0x61, 0x6e, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
|
||||
0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63,
|
||||
0x6b, 0x55, 0x73, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52,
|
||||
0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65,
|
||||
0x12, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
|
||||
0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
|
||||
0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -710,14 +710,14 @@ var file_auth_proto_depIdxs = []int32{
|
||||
0, // 0: proto.AuthInfo.info:type_name -> proto.UserInfo
|
||||
1, // 1: proto.AuthReply.info:type_name -> proto.AuthInfo
|
||||
0, // 2: proto.ListUserRelativeResponse.data:type_name -> proto.UserInfo
|
||||
2, // 3: proto.Auth.Authenticate:input_type -> proto.AuthRequest
|
||||
4, // 4: proto.Auth.EnsurePermGranted:input_type -> proto.CheckPermRequest
|
||||
6, // 5: proto.Auth.EnsureUserPermGranted:input_type -> proto.CheckUserPermRequest
|
||||
8, // 6: proto.Auth.ListUserRelative:input_type -> proto.ListUserRelativeRequest
|
||||
3, // 7: proto.Auth.Authenticate:output_type -> proto.AuthReply
|
||||
5, // 8: proto.Auth.EnsurePermGranted:output_type -> proto.CheckPermResponse
|
||||
7, // 9: proto.Auth.EnsureUserPermGranted:output_type -> proto.CheckUserPermResponse
|
||||
9, // 10: proto.Auth.ListUserRelative:output_type -> proto.ListUserRelativeResponse
|
||||
2, // 3: proto.AuthService.Authenticate:input_type -> proto.AuthRequest
|
||||
4, // 4: proto.AuthService.EnsurePermGranted:input_type -> proto.CheckPermRequest
|
||||
6, // 5: proto.AuthService.EnsureUserPermGranted:input_type -> proto.CheckUserPermRequest
|
||||
8, // 6: proto.AuthService.ListUserRelative:input_type -> proto.ListUserRelativeRequest
|
||||
3, // 7: proto.AuthService.Authenticate:output_type -> proto.AuthReply
|
||||
5, // 8: proto.AuthService.EnsurePermGranted:output_type -> proto.CheckPermResponse
|
||||
7, // 9: proto.AuthService.EnsureUserPermGranted:output_type -> proto.CheckUserPermResponse
|
||||
9, // 10: proto.AuthService.ListUserRelative:output_type -> proto.ListUserRelativeResponse
|
||||
7, // [7:11] is the sub-list for method output_type
|
||||
3, // [3:7] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service Auth {
|
||||
service AuthService {
|
||||
rpc Authenticate(AuthRequest) returns (AuthReply) {}
|
||||
rpc EnsurePermGranted(CheckPermRequest) returns (CheckPermResponse) {}
|
||||
rpc EnsureUserPermGranted(CheckUserPermRequest) returns (CheckUserPermResponse) {}
|
||||
|
@ -19,215 +19,215 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Auth_Authenticate_FullMethodName = "/proto.Auth/Authenticate"
|
||||
Auth_EnsurePermGranted_FullMethodName = "/proto.Auth/EnsurePermGranted"
|
||||
Auth_EnsureUserPermGranted_FullMethodName = "/proto.Auth/EnsureUserPermGranted"
|
||||
Auth_ListUserRelative_FullMethodName = "/proto.Auth/ListUserRelative"
|
||||
AuthService_Authenticate_FullMethodName = "/proto.AuthService/Authenticate"
|
||||
AuthService_EnsurePermGranted_FullMethodName = "/proto.AuthService/EnsurePermGranted"
|
||||
AuthService_EnsureUserPermGranted_FullMethodName = "/proto.AuthService/EnsureUserPermGranted"
|
||||
AuthService_ListUserRelative_FullMethodName = "/proto.AuthService/ListUserRelative"
|
||||
)
|
||||
|
||||
// AuthClient is the client API for Auth service.
|
||||
// AuthServiceClient is the client API for AuthService 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.
|
||||
type AuthClient interface {
|
||||
type AuthServiceClient interface {
|
||||
Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthReply, error)
|
||||
EnsurePermGranted(ctx context.Context, in *CheckPermRequest, opts ...grpc.CallOption) (*CheckPermResponse, error)
|
||||
EnsureUserPermGranted(ctx context.Context, in *CheckUserPermRequest, opts ...grpc.CallOption) (*CheckUserPermResponse, error)
|
||||
ListUserRelative(ctx context.Context, in *ListUserRelativeRequest, opts ...grpc.CallOption) (*ListUserRelativeResponse, error)
|
||||
}
|
||||
|
||||
type authClient struct {
|
||||
type authServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthClient(cc grpc.ClientConnInterface) AuthClient {
|
||||
return &authClient{cc}
|
||||
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||||
return &authServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authClient) Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthReply, error) {
|
||||
func (c *authServiceClient) Authenticate(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AuthReply)
|
||||
err := c.cc.Invoke(ctx, Auth_Authenticate_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, AuthService_Authenticate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authClient) EnsurePermGranted(ctx context.Context, in *CheckPermRequest, opts ...grpc.CallOption) (*CheckPermResponse, error) {
|
||||
func (c *authServiceClient) EnsurePermGranted(ctx context.Context, in *CheckPermRequest, opts ...grpc.CallOption) (*CheckPermResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CheckPermResponse)
|
||||
err := c.cc.Invoke(ctx, Auth_EnsurePermGranted_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, AuthService_EnsurePermGranted_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authClient) EnsureUserPermGranted(ctx context.Context, in *CheckUserPermRequest, opts ...grpc.CallOption) (*CheckUserPermResponse, error) {
|
||||
func (c *authServiceClient) EnsureUserPermGranted(ctx context.Context, in *CheckUserPermRequest, opts ...grpc.CallOption) (*CheckUserPermResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CheckUserPermResponse)
|
||||
err := c.cc.Invoke(ctx, Auth_EnsureUserPermGranted_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, AuthService_EnsureUserPermGranted_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authClient) ListUserRelative(ctx context.Context, in *ListUserRelativeRequest, opts ...grpc.CallOption) (*ListUserRelativeResponse, error) {
|
||||
func (c *authServiceClient) ListUserRelative(ctx context.Context, in *ListUserRelativeRequest, opts ...grpc.CallOption) (*ListUserRelativeResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListUserRelativeResponse)
|
||||
err := c.cc.Invoke(ctx, Auth_ListUserRelative_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, AuthService_ListUserRelative_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthServer is the server API for Auth service.
|
||||
// All implementations must embed UnimplementedAuthServer
|
||||
// AuthServiceServer is the server API for AuthService service.
|
||||
// All implementations must embed UnimplementedAuthServiceServer
|
||||
// for forward compatibility.
|
||||
type AuthServer interface {
|
||||
type AuthServiceServer interface {
|
||||
Authenticate(context.Context, *AuthRequest) (*AuthReply, error)
|
||||
EnsurePermGranted(context.Context, *CheckPermRequest) (*CheckPermResponse, error)
|
||||
EnsureUserPermGranted(context.Context, *CheckUserPermRequest) (*CheckUserPermResponse, error)
|
||||
ListUserRelative(context.Context, *ListUserRelativeRequest) (*ListUserRelativeResponse, error)
|
||||
mustEmbedUnimplementedAuthServer()
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuthServer must be embedded to have
|
||||
// UnimplementedAuthServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAuthServer struct{}
|
||||
type UnimplementedAuthServiceServer struct{}
|
||||
|
||||
func (UnimplementedAuthServer) Authenticate(context.Context, *AuthRequest) (*AuthReply, error) {
|
||||
func (UnimplementedAuthServiceServer) Authenticate(context.Context, *AuthRequest) (*AuthReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServer) EnsurePermGranted(context.Context, *CheckPermRequest) (*CheckPermResponse, error) {
|
||||
func (UnimplementedAuthServiceServer) EnsurePermGranted(context.Context, *CheckPermRequest) (*CheckPermResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EnsurePermGranted not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServer) EnsureUserPermGranted(context.Context, *CheckUserPermRequest) (*CheckUserPermResponse, error) {
|
||||
func (UnimplementedAuthServiceServer) EnsureUserPermGranted(context.Context, *CheckUserPermRequest) (*CheckUserPermResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EnsureUserPermGranted not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServer) ListUserRelative(context.Context, *ListUserRelativeRequest) (*ListUserRelativeResponse, error) {
|
||||
func (UnimplementedAuthServiceServer) ListUserRelative(context.Context, *ListUserRelativeRequest) (*ListUserRelativeResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListUserRelative not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServer) mustEmbedUnimplementedAuthServer() {}
|
||||
func (UnimplementedAuthServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAuthServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthServer will
|
||||
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuthServer interface {
|
||||
mustEmbedUnimplementedAuthServer()
|
||||
type UnsafeAuthServiceServer interface {
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer) {
|
||||
// If the following call pancis, it indicates UnimplementedAuthServer was
|
||||
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedAuthServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Auth_ServiceDesc, srv)
|
||||
s.RegisterService(&AuthService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Auth_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _AuthService_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AuthRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServer).Authenticate(ctx, in)
|
||||
return srv.(AuthServiceServer).Authenticate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Auth_Authenticate_FullMethodName,
|
||||
FullMethod: AuthService_Authenticate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServer).Authenticate(ctx, req.(*AuthRequest))
|
||||
return srv.(AuthServiceServer).Authenticate(ctx, req.(*AuthRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Auth_EnsurePermGranted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _AuthService_EnsurePermGranted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckPermRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServer).EnsurePermGranted(ctx, in)
|
||||
return srv.(AuthServiceServer).EnsurePermGranted(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Auth_EnsurePermGranted_FullMethodName,
|
||||
FullMethod: AuthService_EnsurePermGranted_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServer).EnsurePermGranted(ctx, req.(*CheckPermRequest))
|
||||
return srv.(AuthServiceServer).EnsurePermGranted(ctx, req.(*CheckPermRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Auth_EnsureUserPermGranted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _AuthService_EnsureUserPermGranted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckUserPermRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServer).EnsureUserPermGranted(ctx, in)
|
||||
return srv.(AuthServiceServer).EnsureUserPermGranted(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Auth_EnsureUserPermGranted_FullMethodName,
|
||||
FullMethod: AuthService_EnsureUserPermGranted_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServer).EnsureUserPermGranted(ctx, req.(*CheckUserPermRequest))
|
||||
return srv.(AuthServiceServer).EnsureUserPermGranted(ctx, req.(*CheckUserPermRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Auth_ListUserRelative_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _AuthService_ListUserRelative_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListUserRelativeRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServer).ListUserRelative(ctx, in)
|
||||
return srv.(AuthServiceServer).ListUserRelative(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Auth_ListUserRelative_FullMethodName,
|
||||
FullMethod: AuthService_ListUserRelative_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServer).ListUserRelative(ctx, req.(*ListUserRelativeRequest))
|
||||
return srv.(AuthServiceServer).ListUserRelative(ctx, req.(*ListUserRelativeRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Auth_ServiceDesc is the grpc.ServiceDesc for Auth service.
|
||||
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Auth_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.Auth",
|
||||
HandlerType: (*AuthServer)(nil),
|
||||
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.AuthService",
|
||||
HandlerType: (*AuthServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Authenticate",
|
||||
Handler: _Auth_Authenticate_Handler,
|
||||
Handler: _AuthService_Authenticate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EnsurePermGranted",
|
||||
Handler: _Auth_EnsurePermGranted_Handler,
|
||||
Handler: _AuthService_EnsurePermGranted_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EnsureUserPermGranted",
|
||||
Handler: _Auth_EnsureUserPermGranted_Handler,
|
||||
Handler: _AuthService_EnsureUserPermGranted_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListUserRelative",
|
||||
Handler: _Auth_ListUserRelative_Handler,
|
||||
Handler: _AuthService_ListUserRelative_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -390,27 +390,27 @@ var file_command_proto_rawDesc = []byte{
|
||||
0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d,
|
||||
0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x48,
|
||||
0x00, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a,
|
||||
0x08, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0xa8, 0x02, 0x0a, 0x11, 0x43, 0x6f,
|
||||
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12,
|
||||
0x3d, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d,
|
||||
0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c,
|
||||
0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12,
|
||||
0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c,
|
||||
0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
|
||||
0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b,
|
||||
0x53, 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x41, 0x72, 0x67, 0x75, 0x6d,
|
||||
0x65, 0x6e, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
|
||||
0x61, 0x6e, 0x64, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x11, 0x53,
|
||||
0x65, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
|
||||
0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
|
||||
0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x00,
|
||||
0x28, 0x01, 0x30, 0x01, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x08, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0xa6, 0x02, 0x0a, 0x0f, 0x43, 0x6f,
|
||||
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x3d, 0x0a,
|
||||
0x0a, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x1a,
|
||||
0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
|
||||
0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0d,
|
||||
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1b, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x6f,
|
||||
0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0b, 0x53, 0x65,
|
||||
0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
|
||||
0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
|
||||
0x64, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x11, 0x53, 0x65, 0x6e,
|
||||
0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x16,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x41, 0x72,
|
||||
0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
|
||||
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x00, 0x28, 0x01,
|
||||
0x30, 0x01, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -435,14 +435,14 @@ var file_command_proto_goTypes = []any{
|
||||
(*CommandReturn)(nil), // 5: proto.CommandReturn
|
||||
}
|
||||
var file_command_proto_depIdxs = []int32{
|
||||
0, // 0: proto.CommandController.AddCommand:input_type -> proto.CommandInfo
|
||||
1, // 1: proto.CommandController.RemoveCommand:input_type -> proto.CommandLookupRequest
|
||||
4, // 2: proto.CommandController.SendCommand:input_type -> proto.CommandArgument
|
||||
4, // 3: proto.CommandController.SendStreamCommand:input_type -> proto.CommandArgument
|
||||
2, // 4: proto.CommandController.AddCommand:output_type -> proto.AddCommandResponse
|
||||
3, // 5: proto.CommandController.RemoveCommand:output_type -> proto.RemoveCommandResponse
|
||||
5, // 6: proto.CommandController.SendCommand:output_type -> proto.CommandReturn
|
||||
5, // 7: proto.CommandController.SendStreamCommand:output_type -> proto.CommandReturn
|
||||
0, // 0: proto.CommandProvider.AddCommand:input_type -> proto.CommandInfo
|
||||
1, // 1: proto.CommandProvider.RemoveCommand:input_type -> proto.CommandLookupRequest
|
||||
4, // 2: proto.CommandProvider.SendCommand:input_type -> proto.CommandArgument
|
||||
4, // 3: proto.CommandProvider.SendStreamCommand:input_type -> proto.CommandArgument
|
||||
2, // 4: proto.CommandProvider.AddCommand:output_type -> proto.AddCommandResponse
|
||||
3, // 5: proto.CommandProvider.RemoveCommand:output_type -> proto.RemoveCommandResponse
|
||||
5, // 6: proto.CommandProvider.SendCommand:output_type -> proto.CommandReturn
|
||||
5, // 7: proto.CommandProvider.SendStreamCommand:output_type -> proto.CommandReturn
|
||||
4, // [4:8] is the sub-list for method output_type
|
||||
0, // [0:4] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service CommandController {
|
||||
service CommandProvider {
|
||||
rpc AddCommand(CommandInfo) returns (AddCommandResponse) {}
|
||||
rpc RemoveCommand(CommandLookupRequest) returns (RemoveCommandResponse) {}
|
||||
rpc SendCommand(CommandArgument) returns (CommandReturn) {}
|
||||
|
@ -19,63 +19,63 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
CommandController_AddCommand_FullMethodName = "/proto.CommandController/AddCommand"
|
||||
CommandController_RemoveCommand_FullMethodName = "/proto.CommandController/RemoveCommand"
|
||||
CommandController_SendCommand_FullMethodName = "/proto.CommandController/SendCommand"
|
||||
CommandController_SendStreamCommand_FullMethodName = "/proto.CommandController/SendStreamCommand"
|
||||
CommandProvider_AddCommand_FullMethodName = "/proto.CommandProvider/AddCommand"
|
||||
CommandProvider_RemoveCommand_FullMethodName = "/proto.CommandProvider/RemoveCommand"
|
||||
CommandProvider_SendCommand_FullMethodName = "/proto.CommandProvider/SendCommand"
|
||||
CommandProvider_SendStreamCommand_FullMethodName = "/proto.CommandProvider/SendStreamCommand"
|
||||
)
|
||||
|
||||
// CommandControllerClient is the client API for CommandController service.
|
||||
// CommandProviderClient is the client API for CommandProvider 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.
|
||||
type CommandControllerClient interface {
|
||||
type CommandProviderClient interface {
|
||||
AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error)
|
||||
RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error)
|
||||
SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error)
|
||||
SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error)
|
||||
}
|
||||
|
||||
type commandControllerClient struct {
|
||||
type commandProviderClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewCommandControllerClient(cc grpc.ClientConnInterface) CommandControllerClient {
|
||||
return &commandControllerClient{cc}
|
||||
func NewCommandProviderClient(cc grpc.ClientConnInterface) CommandProviderClient {
|
||||
return &commandProviderClient{cc}
|
||||
}
|
||||
|
||||
func (c *commandControllerClient) AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error) {
|
||||
func (c *commandProviderClient) AddCommand(ctx context.Context, in *CommandInfo, opts ...grpc.CallOption) (*AddCommandResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddCommandResponse)
|
||||
err := c.cc.Invoke(ctx, CommandController_AddCommand_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, CommandProvider_AddCommand_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *commandControllerClient) RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error) {
|
||||
func (c *commandProviderClient) RemoveCommand(ctx context.Context, in *CommandLookupRequest, opts ...grpc.CallOption) (*RemoveCommandResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemoveCommandResponse)
|
||||
err := c.cc.Invoke(ctx, CommandController_RemoveCommand_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, CommandProvider_RemoveCommand_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *commandControllerClient) SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error) {
|
||||
func (c *commandProviderClient) SendCommand(ctx context.Context, in *CommandArgument, opts ...grpc.CallOption) (*CommandReturn, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommandReturn)
|
||||
err := c.cc.Invoke(ctx, CommandController_SendCommand_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, CommandProvider_SendCommand_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *commandControllerClient) SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error) {
|
||||
func (c *commandProviderClient) SendStreamCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CommandArgument, CommandReturn], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &CommandController_ServiceDesc.Streams[0], CommandController_SendStreamCommand_FullMethodName, cOpts...)
|
||||
stream, err := c.cc.NewStream(ctx, &CommandProvider_ServiceDesc.Streams[0], CommandProvider_SendStreamCommand_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -84,144 +84,144 @@ func (c *commandControllerClient) SendStreamCommand(ctx context.Context, opts ..
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CommandController_SendStreamCommandClient = grpc.BidiStreamingClient[CommandArgument, CommandReturn]
|
||||
type CommandProvider_SendStreamCommandClient = grpc.BidiStreamingClient[CommandArgument, CommandReturn]
|
||||
|
||||
// CommandControllerServer is the server API for CommandController service.
|
||||
// All implementations must embed UnimplementedCommandControllerServer
|
||||
// CommandProviderServer is the server API for CommandProvider service.
|
||||
// All implementations must embed UnimplementedCommandProviderServer
|
||||
// for forward compatibility.
|
||||
type CommandControllerServer interface {
|
||||
type CommandProviderServer interface {
|
||||
AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error)
|
||||
RemoveCommand(context.Context, *CommandLookupRequest) (*RemoveCommandResponse, error)
|
||||
SendCommand(context.Context, *CommandArgument) (*CommandReturn, error)
|
||||
SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error
|
||||
mustEmbedUnimplementedCommandControllerServer()
|
||||
mustEmbedUnimplementedCommandProviderServer()
|
||||
}
|
||||
|
||||
// UnimplementedCommandControllerServer must be embedded to have
|
||||
// UnimplementedCommandProviderServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCommandControllerServer struct{}
|
||||
type UnimplementedCommandProviderServer struct{}
|
||||
|
||||
func (UnimplementedCommandControllerServer) AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error) {
|
||||
func (UnimplementedCommandProviderServer) AddCommand(context.Context, *CommandInfo) (*AddCommandResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddCommand not implemented")
|
||||
}
|
||||
func (UnimplementedCommandControllerServer) RemoveCommand(context.Context, *CommandLookupRequest) (*RemoveCommandResponse, error) {
|
||||
func (UnimplementedCommandProviderServer) RemoveCommand(context.Context, *CommandLookupRequest) (*RemoveCommandResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RemoveCommand not implemented")
|
||||
}
|
||||
func (UnimplementedCommandControllerServer) SendCommand(context.Context, *CommandArgument) (*CommandReturn, error) {
|
||||
func (UnimplementedCommandProviderServer) SendCommand(context.Context, *CommandArgument) (*CommandReturn, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SendCommand not implemented")
|
||||
}
|
||||
func (UnimplementedCommandControllerServer) SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error {
|
||||
func (UnimplementedCommandProviderServer) SendStreamCommand(grpc.BidiStreamingServer[CommandArgument, CommandReturn]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SendStreamCommand not implemented")
|
||||
}
|
||||
func (UnimplementedCommandControllerServer) mustEmbedUnimplementedCommandControllerServer() {}
|
||||
func (UnimplementedCommandControllerServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedCommandProviderServer) mustEmbedUnimplementedCommandProviderServer() {}
|
||||
func (UnimplementedCommandProviderServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCommandControllerServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CommandControllerServer will
|
||||
// UnsafeCommandProviderServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CommandProviderServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeCommandControllerServer interface {
|
||||
mustEmbedUnimplementedCommandControllerServer()
|
||||
type UnsafeCommandProviderServer interface {
|
||||
mustEmbedUnimplementedCommandProviderServer()
|
||||
}
|
||||
|
||||
func RegisterCommandControllerServer(s grpc.ServiceRegistrar, srv CommandControllerServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCommandControllerServer was
|
||||
func RegisterCommandProviderServer(s grpc.ServiceRegistrar, srv CommandProviderServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCommandProviderServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&CommandController_ServiceDesc, srv)
|
||||
s.RegisterService(&CommandProvider_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _CommandController_AddCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _CommandProvider_AddCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommandInfo)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CommandControllerServer).AddCommand(ctx, in)
|
||||
return srv.(CommandProviderServer).AddCommand(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CommandController_AddCommand_FullMethodName,
|
||||
FullMethod: CommandProvider_AddCommand_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CommandControllerServer).AddCommand(ctx, req.(*CommandInfo))
|
||||
return srv.(CommandProviderServer).AddCommand(ctx, req.(*CommandInfo))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CommandController_RemoveCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _CommandProvider_RemoveCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommandLookupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CommandControllerServer).RemoveCommand(ctx, in)
|
||||
return srv.(CommandProviderServer).RemoveCommand(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CommandController_RemoveCommand_FullMethodName,
|
||||
FullMethod: CommandProvider_RemoveCommand_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CommandControllerServer).RemoveCommand(ctx, req.(*CommandLookupRequest))
|
||||
return srv.(CommandProviderServer).RemoveCommand(ctx, req.(*CommandLookupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CommandController_SendCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _CommandProvider_SendCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CommandArgument)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CommandControllerServer).SendCommand(ctx, in)
|
||||
return srv.(CommandProviderServer).SendCommand(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CommandController_SendCommand_FullMethodName,
|
||||
FullMethod: CommandProvider_SendCommand_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CommandControllerServer).SendCommand(ctx, req.(*CommandArgument))
|
||||
return srv.(CommandProviderServer).SendCommand(ctx, req.(*CommandArgument))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CommandController_SendStreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CommandControllerServer).SendStreamCommand(&grpc.GenericServerStream[CommandArgument, CommandReturn]{ServerStream: stream})
|
||||
func _CommandProvider_SendStreamCommand_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CommandProviderServer).SendStreamCommand(&grpc.GenericServerStream[CommandArgument, CommandReturn]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type CommandController_SendStreamCommandServer = grpc.BidiStreamingServer[CommandArgument, CommandReturn]
|
||||
type CommandProvider_SendStreamCommandServer = grpc.BidiStreamingServer[CommandArgument, CommandReturn]
|
||||
|
||||
// CommandController_ServiceDesc is the grpc.ServiceDesc for CommandController service.
|
||||
// CommandProvider_ServiceDesc is the grpc.ServiceDesc for CommandProvider service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var CommandController_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.CommandController",
|
||||
HandlerType: (*CommandControllerServer)(nil),
|
||||
var CommandProvider_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.CommandProvider",
|
||||
HandlerType: (*CommandProviderServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AddCommand",
|
||||
Handler: _CommandController_AddCommand_Handler,
|
||||
Handler: _CommandProvider_AddCommand_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemoveCommand",
|
||||
Handler: _CommandController_RemoveCommand_Handler,
|
||||
Handler: _CommandProvider_RemoveCommand_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SendCommand",
|
||||
Handler: _CommandController_SendCommand_Handler,
|
||||
Handler: _CommandProvider_SendCommand_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "SendStreamCommand",
|
||||
Handler: _CommandController_SendStreamCommand_Handler,
|
||||
Handler: _CommandProvider_SendStreamCommand_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
|
@ -129,15 +129,15 @@ var file_database_proto_rawDesc = []byte{
|
||||
0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
|
||||
0x69, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
|
||||
0x52, 0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x64,
|
||||
0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x32, 0x62, 0x0a,
|
||||
0x12, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
|
||||
0x6c, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x44, 0x61, 0x74, 0x61,
|
||||
0x62, 0x61, 0x73, 0x65, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x6c,
|
||||
0x6f, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x44,
|
||||
0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x32, 0x5f, 0x0a,
|
||||
0x0f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x12, 0x4c, 0x0a, 0x0d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
|
||||
0x65, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x44,
|
||||
0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x44, 0x61, 0x74, 0x61,
|
||||
0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09,
|
||||
0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -158,8 +158,8 @@ var file_database_proto_goTypes = []any{
|
||||
(*AllocDatabaseResponse)(nil), // 1: proto.AllocDatabaseResponse
|
||||
}
|
||||
var file_database_proto_depIdxs = []int32{
|
||||
0, // 0: proto.DatabaseController.AllocDatabase:input_type -> proto.AllocDatabaseRequest
|
||||
1, // 1: proto.DatabaseController.AllocDatabase:output_type -> proto.AllocDatabaseResponse
|
||||
0, // 0: proto.DatabaseService.AllocDatabase:input_type -> proto.AllocDatabaseRequest
|
||||
1, // 1: proto.DatabaseService.AllocDatabase:output_type -> proto.AllocDatabaseResponse
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service DatabaseController {
|
||||
service DatabaseService {
|
||||
rpc AllocDatabase(AllocDatabaseRequest) returns (AllocDatabaseResponse) {}
|
||||
}
|
||||
|
||||
|
@ -19,101 +19,101 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
DatabaseController_AllocDatabase_FullMethodName = "/proto.DatabaseController/AllocDatabase"
|
||||
DatabaseService_AllocDatabase_FullMethodName = "/proto.DatabaseService/AllocDatabase"
|
||||
)
|
||||
|
||||
// DatabaseControllerClient is the client API for DatabaseController service.
|
||||
// DatabaseServiceClient is the client API for DatabaseService 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.
|
||||
type DatabaseControllerClient interface {
|
||||
type DatabaseServiceClient interface {
|
||||
AllocDatabase(ctx context.Context, in *AllocDatabaseRequest, opts ...grpc.CallOption) (*AllocDatabaseResponse, error)
|
||||
}
|
||||
|
||||
type databaseControllerClient struct {
|
||||
type databaseServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDatabaseControllerClient(cc grpc.ClientConnInterface) DatabaseControllerClient {
|
||||
return &databaseControllerClient{cc}
|
||||
func NewDatabaseServiceClient(cc grpc.ClientConnInterface) DatabaseServiceClient {
|
||||
return &databaseServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *databaseControllerClient) AllocDatabase(ctx context.Context, in *AllocDatabaseRequest, opts ...grpc.CallOption) (*AllocDatabaseResponse, error) {
|
||||
func (c *databaseServiceClient) AllocDatabase(ctx context.Context, in *AllocDatabaseRequest, opts ...grpc.CallOption) (*AllocDatabaseResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AllocDatabaseResponse)
|
||||
err := c.cc.Invoke(ctx, DatabaseController_AllocDatabase_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, DatabaseService_AllocDatabase_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DatabaseControllerServer is the server API for DatabaseController service.
|
||||
// All implementations must embed UnimplementedDatabaseControllerServer
|
||||
// DatabaseServiceServer is the server API for DatabaseService service.
|
||||
// All implementations must embed UnimplementedDatabaseServiceServer
|
||||
// for forward compatibility.
|
||||
type DatabaseControllerServer interface {
|
||||
type DatabaseServiceServer interface {
|
||||
AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error)
|
||||
mustEmbedUnimplementedDatabaseControllerServer()
|
||||
mustEmbedUnimplementedDatabaseServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedDatabaseControllerServer must be embedded to have
|
||||
// UnimplementedDatabaseServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedDatabaseControllerServer struct{}
|
||||
type UnimplementedDatabaseServiceServer struct{}
|
||||
|
||||
func (UnimplementedDatabaseControllerServer) AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error) {
|
||||
func (UnimplementedDatabaseServiceServer) AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AllocDatabase not implemented")
|
||||
}
|
||||
func (UnimplementedDatabaseControllerServer) mustEmbedUnimplementedDatabaseControllerServer() {}
|
||||
func (UnimplementedDatabaseControllerServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedDatabaseServiceServer) mustEmbedUnimplementedDatabaseServiceServer() {}
|
||||
func (UnimplementedDatabaseServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDatabaseControllerServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DatabaseControllerServer will
|
||||
// UnsafeDatabaseServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DatabaseServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDatabaseControllerServer interface {
|
||||
mustEmbedUnimplementedDatabaseControllerServer()
|
||||
type UnsafeDatabaseServiceServer interface {
|
||||
mustEmbedUnimplementedDatabaseServiceServer()
|
||||
}
|
||||
|
||||
func RegisterDatabaseControllerServer(s grpc.ServiceRegistrar, srv DatabaseControllerServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDatabaseControllerServer was
|
||||
func RegisterDatabaseServiceServer(s grpc.ServiceRegistrar, srv DatabaseServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDatabaseServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&DatabaseController_ServiceDesc, srv)
|
||||
s.RegisterService(&DatabaseService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DatabaseController_AllocDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DatabaseService_AllocDatabase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AllocDatabaseRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DatabaseControllerServer).AllocDatabase(ctx, in)
|
||||
return srv.(DatabaseServiceServer).AllocDatabase(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DatabaseController_AllocDatabase_FullMethodName,
|
||||
FullMethod: DatabaseService_AllocDatabase_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DatabaseControllerServer).AllocDatabase(ctx, req.(*AllocDatabaseRequest))
|
||||
return srv.(DatabaseServiceServer).AllocDatabase(ctx, req.(*AllocDatabaseRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// DatabaseController_ServiceDesc is the grpc.ServiceDesc for DatabaseController service.
|
||||
// DatabaseService_ServiceDesc is the grpc.ServiceDesc for DatabaseService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DatabaseController_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.DatabaseController",
|
||||
HandlerType: (*DatabaseControllerServer)(nil),
|
||||
var DatabaseService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.DatabaseService",
|
||||
HandlerType: (*DatabaseServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AllocDatabase",
|
||||
Handler: _DatabaseController_AllocDatabase_Handler,
|
||||
Handler: _DatabaseService_AllocDatabase_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -553,8 +553,8 @@ var file_services_proto_rawDesc = []byte{
|
||||
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61,
|
||||
0x74, 0x61, 0x22, 0x0f, 0x0a, 0x0d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x32, 0xe8, 0x02, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44,
|
||||
0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53,
|
||||
0x6e, 0x73, 0x65, 0x32, 0xe8, 0x02, 0x0a, 0x10, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72,
|
||||
0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47,
|
||||
0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76,
|
||||
@ -608,16 +608,16 @@ var file_services_proto_goTypes = []any{
|
||||
var file_services_proto_depIdxs = []int32{
|
||||
0, // 0: proto.GetServiceResponse.data:type_name -> proto.ServiceInfo
|
||||
0, // 1: proto.ListServiceResponse.data:type_name -> proto.ServiceInfo
|
||||
1, // 2: proto.ServiceDirectory.GetService:input_type -> proto.GetServiceRequest
|
||||
3, // 3: proto.ServiceDirectory.ListService:input_type -> proto.ListServiceRequest
|
||||
0, // 4: proto.ServiceDirectory.AddService:input_type -> proto.ServiceInfo
|
||||
6, // 5: proto.ServiceDirectory.RemoveService:input_type -> proto.RemoveServiceRequest
|
||||
8, // 6: proto.ServiceDirectory.BroadcastEvent:input_type -> proto.EventInfo
|
||||
2, // 7: proto.ServiceDirectory.GetService:output_type -> proto.GetServiceResponse
|
||||
4, // 8: proto.ServiceDirectory.ListService:output_type -> proto.ListServiceResponse
|
||||
5, // 9: proto.ServiceDirectory.AddService:output_type -> proto.AddServiceResponse
|
||||
7, // 10: proto.ServiceDirectory.RemoveService:output_type -> proto.RemoveServiceResponse
|
||||
9, // 11: proto.ServiceDirectory.BroadcastEvent:output_type -> proto.EventResponse
|
||||
1, // 2: proto.DirectoryService.GetService:input_type -> proto.GetServiceRequest
|
||||
3, // 3: proto.DirectoryService.ListService:input_type -> proto.ListServiceRequest
|
||||
0, // 4: proto.DirectoryService.AddService:input_type -> proto.ServiceInfo
|
||||
6, // 5: proto.DirectoryService.RemoveService:input_type -> proto.RemoveServiceRequest
|
||||
8, // 6: proto.DirectoryService.BroadcastEvent:input_type -> proto.EventInfo
|
||||
2, // 7: proto.DirectoryService.GetService:output_type -> proto.GetServiceResponse
|
||||
4, // 8: proto.DirectoryService.ListService:output_type -> proto.ListServiceResponse
|
||||
5, // 9: proto.DirectoryService.AddService:output_type -> proto.AddServiceResponse
|
||||
7, // 10: proto.DirectoryService.RemoveService:output_type -> proto.RemoveServiceResponse
|
||||
9, // 11: proto.DirectoryService.BroadcastEvent:output_type -> proto.EventResponse
|
||||
7, // [7:12] is the sub-list for method output_type
|
||||
2, // [2:7] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service ServiceDirectory {
|
||||
service DirectoryService {
|
||||
rpc GetService(GetServiceRequest) returns (GetServiceResponse) {}
|
||||
rpc ListService(ListServiceRequest) returns (ListServiceResponse) {}
|
||||
rpc AddService(ServiceInfo) returns (AddServiceResponse) {}
|
||||
|
@ -19,17 +19,17 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
ServiceDirectory_GetService_FullMethodName = "/proto.ServiceDirectory/GetService"
|
||||
ServiceDirectory_ListService_FullMethodName = "/proto.ServiceDirectory/ListService"
|
||||
ServiceDirectory_AddService_FullMethodName = "/proto.ServiceDirectory/AddService"
|
||||
ServiceDirectory_RemoveService_FullMethodName = "/proto.ServiceDirectory/RemoveService"
|
||||
ServiceDirectory_BroadcastEvent_FullMethodName = "/proto.ServiceDirectory/BroadcastEvent"
|
||||
DirectoryService_GetService_FullMethodName = "/proto.DirectoryService/GetService"
|
||||
DirectoryService_ListService_FullMethodName = "/proto.DirectoryService/ListService"
|
||||
DirectoryService_AddService_FullMethodName = "/proto.DirectoryService/AddService"
|
||||
DirectoryService_RemoveService_FullMethodName = "/proto.DirectoryService/RemoveService"
|
||||
DirectoryService_BroadcastEvent_FullMethodName = "/proto.DirectoryService/BroadcastEvent"
|
||||
)
|
||||
|
||||
// ServiceDirectoryClient is the client API for ServiceDirectory service.
|
||||
// DirectoryServiceClient is the client API for DirectoryService 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.
|
||||
type ServiceDirectoryClient interface {
|
||||
type DirectoryServiceClient interface {
|
||||
GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error)
|
||||
ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error)
|
||||
AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error)
|
||||
@ -37,235 +37,235 @@ type ServiceDirectoryClient interface {
|
||||
BroadcastEvent(ctx context.Context, in *EventInfo, opts ...grpc.CallOption) (*EventResponse, error)
|
||||
}
|
||||
|
||||
type serviceDirectoryClient struct {
|
||||
type directoryServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewServiceDirectoryClient(cc grpc.ClientConnInterface) ServiceDirectoryClient {
|
||||
return &serviceDirectoryClient{cc}
|
||||
func NewDirectoryServiceClient(cc grpc.ClientConnInterface) DirectoryServiceClient {
|
||||
return &directoryServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *serviceDirectoryClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) {
|
||||
func (c *directoryServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetServiceResponse)
|
||||
err := c.cc.Invoke(ctx, ServiceDirectory_GetService_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, DirectoryService_GetService_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceDirectoryClient) ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error) {
|
||||
func (c *directoryServiceClient) ListService(ctx context.Context, in *ListServiceRequest, opts ...grpc.CallOption) (*ListServiceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListServiceResponse)
|
||||
err := c.cc.Invoke(ctx, ServiceDirectory_ListService_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, DirectoryService_ListService_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceDirectoryClient) AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error) {
|
||||
func (c *directoryServiceClient) AddService(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*AddServiceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddServiceResponse)
|
||||
err := c.cc.Invoke(ctx, ServiceDirectory_AddService_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, DirectoryService_AddService_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceDirectoryClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) {
|
||||
func (c *directoryServiceClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RemoveServiceResponse)
|
||||
err := c.cc.Invoke(ctx, ServiceDirectory_RemoveService_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, DirectoryService_RemoveService_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceDirectoryClient) BroadcastEvent(ctx context.Context, in *EventInfo, opts ...grpc.CallOption) (*EventResponse, error) {
|
||||
func (c *directoryServiceClient) BroadcastEvent(ctx context.Context, in *EventInfo, opts ...grpc.CallOption) (*EventResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(EventResponse)
|
||||
err := c.cc.Invoke(ctx, ServiceDirectory_BroadcastEvent_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, DirectoryService_BroadcastEvent_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceDirectoryServer is the server API for ServiceDirectory service.
|
||||
// All implementations must embed UnimplementedServiceDirectoryServer
|
||||
// DirectoryServiceServer is the server API for DirectoryService service.
|
||||
// All implementations must embed UnimplementedDirectoryServiceServer
|
||||
// for forward compatibility.
|
||||
type ServiceDirectoryServer interface {
|
||||
type DirectoryServiceServer interface {
|
||||
GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error)
|
||||
ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error)
|
||||
AddService(context.Context, *ServiceInfo) (*AddServiceResponse, error)
|
||||
RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error)
|
||||
BroadcastEvent(context.Context, *EventInfo) (*EventResponse, error)
|
||||
mustEmbedUnimplementedServiceDirectoryServer()
|
||||
mustEmbedUnimplementedDirectoryServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedServiceDirectoryServer must be embedded to have
|
||||
// UnimplementedDirectoryServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedServiceDirectoryServer struct{}
|
||||
type UnimplementedDirectoryServiceServer struct{}
|
||||
|
||||
func (UnimplementedServiceDirectoryServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) {
|
||||
func (UnimplementedDirectoryServiceServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented")
|
||||
}
|
||||
func (UnimplementedServiceDirectoryServer) ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error) {
|
||||
func (UnimplementedDirectoryServiceServer) ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListService not implemented")
|
||||
}
|
||||
func (UnimplementedServiceDirectoryServer) AddService(context.Context, *ServiceInfo) (*AddServiceResponse, error) {
|
||||
func (UnimplementedDirectoryServiceServer) AddService(context.Context, *ServiceInfo) (*AddServiceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddService not implemented")
|
||||
}
|
||||
func (UnimplementedServiceDirectoryServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) {
|
||||
func (UnimplementedDirectoryServiceServer) RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented")
|
||||
}
|
||||
func (UnimplementedServiceDirectoryServer) BroadcastEvent(context.Context, *EventInfo) (*EventResponse, error) {
|
||||
func (UnimplementedDirectoryServiceServer) BroadcastEvent(context.Context, *EventInfo) (*EventResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method BroadcastEvent not implemented")
|
||||
}
|
||||
func (UnimplementedServiceDirectoryServer) mustEmbedUnimplementedServiceDirectoryServer() {}
|
||||
func (UnimplementedServiceDirectoryServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedDirectoryServiceServer) mustEmbedUnimplementedDirectoryServiceServer() {}
|
||||
func (UnimplementedDirectoryServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeServiceDirectoryServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ServiceDirectoryServer will
|
||||
// UnsafeDirectoryServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DirectoryServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeServiceDirectoryServer interface {
|
||||
mustEmbedUnimplementedServiceDirectoryServer()
|
||||
type UnsafeDirectoryServiceServer interface {
|
||||
mustEmbedUnimplementedDirectoryServiceServer()
|
||||
}
|
||||
|
||||
func RegisterServiceDirectoryServer(s grpc.ServiceRegistrar, srv ServiceDirectoryServer) {
|
||||
// If the following call pancis, it indicates UnimplementedServiceDirectoryServer was
|
||||
func RegisterDirectoryServiceServer(s grpc.ServiceRegistrar, srv DirectoryServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDirectoryServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&ServiceDirectory_ServiceDesc, srv)
|
||||
s.RegisterService(&DirectoryService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ServiceDirectory_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DirectoryService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetServiceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceDirectoryServer).GetService(ctx, in)
|
||||
return srv.(DirectoryServiceServer).GetService(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServiceDirectory_GetService_FullMethodName,
|
||||
FullMethod: DirectoryService_GetService_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceDirectoryServer).GetService(ctx, req.(*GetServiceRequest))
|
||||
return srv.(DirectoryServiceServer).GetService(ctx, req.(*GetServiceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServiceDirectory_ListService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DirectoryService_ListService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListServiceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceDirectoryServer).ListService(ctx, in)
|
||||
return srv.(DirectoryServiceServer).ListService(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServiceDirectory_ListService_FullMethodName,
|
||||
FullMethod: DirectoryService_ListService_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceDirectoryServer).ListService(ctx, req.(*ListServiceRequest))
|
||||
return srv.(DirectoryServiceServer).ListService(ctx, req.(*ListServiceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServiceDirectory_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DirectoryService_AddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServiceInfo)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceDirectoryServer).AddService(ctx, in)
|
||||
return srv.(DirectoryServiceServer).AddService(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServiceDirectory_AddService_FullMethodName,
|
||||
FullMethod: DirectoryService_AddService_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceDirectoryServer).AddService(ctx, req.(*ServiceInfo))
|
||||
return srv.(DirectoryServiceServer).AddService(ctx, req.(*ServiceInfo))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServiceDirectory_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DirectoryService_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RemoveServiceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceDirectoryServer).RemoveService(ctx, in)
|
||||
return srv.(DirectoryServiceServer).RemoveService(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServiceDirectory_RemoveService_FullMethodName,
|
||||
FullMethod: DirectoryService_RemoveService_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceDirectoryServer).RemoveService(ctx, req.(*RemoveServiceRequest))
|
||||
return srv.(DirectoryServiceServer).RemoveService(ctx, req.(*RemoveServiceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServiceDirectory_BroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DirectoryService_BroadcastEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EventInfo)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceDirectoryServer).BroadcastEvent(ctx, in)
|
||||
return srv.(DirectoryServiceServer).BroadcastEvent(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ServiceDirectory_BroadcastEvent_FullMethodName,
|
||||
FullMethod: DirectoryService_BroadcastEvent_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceDirectoryServer).BroadcastEvent(ctx, req.(*EventInfo))
|
||||
return srv.(DirectoryServiceServer).BroadcastEvent(ctx, req.(*EventInfo))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ServiceDirectory_ServiceDesc is the grpc.ServiceDesc for ServiceDirectory service.
|
||||
// DirectoryService_ServiceDesc is the grpc.ServiceDesc for DirectoryService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ServiceDirectory_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.ServiceDirectory",
|
||||
HandlerType: (*ServiceDirectoryServer)(nil),
|
||||
var DirectoryService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.DirectoryService",
|
||||
HandlerType: (*DirectoryServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetService",
|
||||
Handler: _ServiceDirectory_GetService_Handler,
|
||||
Handler: _DirectoryService_GetService_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListService",
|
||||
Handler: _ServiceDirectory_ListService_Handler,
|
||||
Handler: _DirectoryService_ListService_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddService",
|
||||
Handler: _ServiceDirectory_AddService_Handler,
|
||||
Handler: _DirectoryService_AddService_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RemoveService",
|
||||
Handler: _ServiceDirectory_RemoveService_Handler,
|
||||
Handler: _DirectoryService_RemoveService_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BroadcastEvent",
|
||||
Handler: _ServiceDirectory_BroadcastEvent_Handler,
|
||||
Handler: _DirectoryService_BroadcastEvent_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -440,25 +440,24 @@ var file_stream_proto_rawDesc = []byte{
|
||||
0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61,
|
||||
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79,
|
||||
0x6c, 0x6f, 0x61, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76,
|
||||
0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x80, 0x02, 0x0a, 0x10,
|
||||
0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72,
|
||||
0x12, 0x58, 0x0a, 0x15, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43,
|
||||
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a, 0x50, 0x75,
|
||||
0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x53,
|
||||
0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||
0x4d, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x61, 0x74,
|
||||
0x63, 0x68, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x53,
|
||||
0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74,
|
||||
0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09,
|
||||
0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfd, 0x01, 0x0a, 0x0d,
|
||||
0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a,
|
||||
0x15, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x6e,
|
||||
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x53,
|
||||
0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75,
|
||||
0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65,
|
||||
0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0f,
|
||||
0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12,
|
||||
0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65,
|
||||
0x61, 0x6d, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x53, 0x74, 0x72, 0x65, 0x61,
|
||||
0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e,
|
||||
0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -484,12 +483,12 @@ var file_stream_proto_goTypes = []any{
|
||||
(*StreamEventResponse)(nil), // 6: proto.StreamEventResponse
|
||||
}
|
||||
var file_stream_proto_depIdxs = []int32{
|
||||
0, // 0: proto.StreamController.CountStreamConnection:input_type -> proto.CountConnectionRequest
|
||||
2, // 1: proto.StreamController.PushStream:input_type -> proto.PushStreamRequest
|
||||
3, // 2: proto.StreamController.PushStreamBatch:input_type -> proto.PushStreamBatchRequest
|
||||
1, // 3: proto.StreamController.CountStreamConnection:output_type -> proto.CountConnectionResponse
|
||||
4, // 4: proto.StreamController.PushStream:output_type -> proto.PushStreamResponse
|
||||
4, // 5: proto.StreamController.PushStreamBatch:output_type -> proto.PushStreamResponse
|
||||
0, // 0: proto.StreamService.CountStreamConnection:input_type -> proto.CountConnectionRequest
|
||||
2, // 1: proto.StreamService.PushStream:input_type -> proto.PushStreamRequest
|
||||
3, // 2: proto.StreamService.PushStreamBatch:input_type -> proto.PushStreamBatchRequest
|
||||
1, // 3: proto.StreamService.CountStreamConnection:output_type -> proto.CountConnectionResponse
|
||||
4, // 4: proto.StreamService.PushStream:output_type -> proto.PushStreamResponse
|
||||
4, // 5: proto.StreamService.PushStreamBatch:output_type -> proto.PushStreamResponse
|
||||
3, // [3:6] is the sub-list for method output_type
|
||||
0, // [0:3] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service StreamController {
|
||||
service StreamService {
|
||||
rpc CountStreamConnection(CountConnectionRequest) returns (CountConnectionResponse) {}
|
||||
rpc PushStream(PushStreamRequest) returns (PushStreamResponse) {}
|
||||
rpc PushStreamBatch(PushStreamBatchRequest) returns (PushStreamResponse) {}
|
||||
|
@ -19,177 +19,177 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
StreamController_CountStreamConnection_FullMethodName = "/proto.StreamController/CountStreamConnection"
|
||||
StreamController_PushStream_FullMethodName = "/proto.StreamController/PushStream"
|
||||
StreamController_PushStreamBatch_FullMethodName = "/proto.StreamController/PushStreamBatch"
|
||||
StreamService_CountStreamConnection_FullMethodName = "/proto.StreamService/CountStreamConnection"
|
||||
StreamService_PushStream_FullMethodName = "/proto.StreamService/PushStream"
|
||||
StreamService_PushStreamBatch_FullMethodName = "/proto.StreamService/PushStreamBatch"
|
||||
)
|
||||
|
||||
// StreamControllerClient is the client API for StreamController service.
|
||||
// StreamServiceClient is the client API for StreamService 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.
|
||||
type StreamControllerClient interface {
|
||||
type StreamServiceClient interface {
|
||||
CountStreamConnection(ctx context.Context, in *CountConnectionRequest, opts ...grpc.CallOption) (*CountConnectionResponse, error)
|
||||
PushStream(ctx context.Context, in *PushStreamRequest, opts ...grpc.CallOption) (*PushStreamResponse, error)
|
||||
PushStreamBatch(ctx context.Context, in *PushStreamBatchRequest, opts ...grpc.CallOption) (*PushStreamResponse, error)
|
||||
}
|
||||
|
||||
type streamControllerClient struct {
|
||||
type streamServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewStreamControllerClient(cc grpc.ClientConnInterface) StreamControllerClient {
|
||||
return &streamControllerClient{cc}
|
||||
func NewStreamServiceClient(cc grpc.ClientConnInterface) StreamServiceClient {
|
||||
return &streamServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *streamControllerClient) CountStreamConnection(ctx context.Context, in *CountConnectionRequest, opts ...grpc.CallOption) (*CountConnectionResponse, error) {
|
||||
func (c *streamServiceClient) CountStreamConnection(ctx context.Context, in *CountConnectionRequest, opts ...grpc.CallOption) (*CountConnectionResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CountConnectionResponse)
|
||||
err := c.cc.Invoke(ctx, StreamController_CountStreamConnection_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, StreamService_CountStreamConnection_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamControllerClient) PushStream(ctx context.Context, in *PushStreamRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) {
|
||||
func (c *streamServiceClient) PushStream(ctx context.Context, in *PushStreamRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PushStreamResponse)
|
||||
err := c.cc.Invoke(ctx, StreamController_PushStream_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, StreamService_PushStream_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *streamControllerClient) PushStreamBatch(ctx context.Context, in *PushStreamBatchRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) {
|
||||
func (c *streamServiceClient) PushStreamBatch(ctx context.Context, in *PushStreamBatchRequest, opts ...grpc.CallOption) (*PushStreamResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PushStreamResponse)
|
||||
err := c.cc.Invoke(ctx, StreamController_PushStreamBatch_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, StreamService_PushStreamBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// StreamControllerServer is the server API for StreamController service.
|
||||
// All implementations must embed UnimplementedStreamControllerServer
|
||||
// StreamServiceServer is the server API for StreamService service.
|
||||
// All implementations must embed UnimplementedStreamServiceServer
|
||||
// for forward compatibility.
|
||||
type StreamControllerServer interface {
|
||||
type StreamServiceServer interface {
|
||||
CountStreamConnection(context.Context, *CountConnectionRequest) (*CountConnectionResponse, error)
|
||||
PushStream(context.Context, *PushStreamRequest) (*PushStreamResponse, error)
|
||||
PushStreamBatch(context.Context, *PushStreamBatchRequest) (*PushStreamResponse, error)
|
||||
mustEmbedUnimplementedStreamControllerServer()
|
||||
mustEmbedUnimplementedStreamServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedStreamControllerServer must be embedded to have
|
||||
// UnimplementedStreamServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedStreamControllerServer struct{}
|
||||
type UnimplementedStreamServiceServer struct{}
|
||||
|
||||
func (UnimplementedStreamControllerServer) CountStreamConnection(context.Context, *CountConnectionRequest) (*CountConnectionResponse, error) {
|
||||
func (UnimplementedStreamServiceServer) CountStreamConnection(context.Context, *CountConnectionRequest) (*CountConnectionResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CountStreamConnection not implemented")
|
||||
}
|
||||
func (UnimplementedStreamControllerServer) PushStream(context.Context, *PushStreamRequest) (*PushStreamResponse, error) {
|
||||
func (UnimplementedStreamServiceServer) PushStream(context.Context, *PushStreamRequest) (*PushStreamResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PushStream not implemented")
|
||||
}
|
||||
func (UnimplementedStreamControllerServer) PushStreamBatch(context.Context, *PushStreamBatchRequest) (*PushStreamResponse, error) {
|
||||
func (UnimplementedStreamServiceServer) PushStreamBatch(context.Context, *PushStreamBatchRequest) (*PushStreamResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PushStreamBatch not implemented")
|
||||
}
|
||||
func (UnimplementedStreamControllerServer) mustEmbedUnimplementedStreamControllerServer() {}
|
||||
func (UnimplementedStreamControllerServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedStreamServiceServer) mustEmbedUnimplementedStreamServiceServer() {}
|
||||
func (UnimplementedStreamServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeStreamControllerServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to StreamControllerServer will
|
||||
// UnsafeStreamServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to StreamServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeStreamControllerServer interface {
|
||||
mustEmbedUnimplementedStreamControllerServer()
|
||||
type UnsafeStreamServiceServer interface {
|
||||
mustEmbedUnimplementedStreamServiceServer()
|
||||
}
|
||||
|
||||
func RegisterStreamControllerServer(s grpc.ServiceRegistrar, srv StreamControllerServer) {
|
||||
// If the following call pancis, it indicates UnimplementedStreamControllerServer was
|
||||
func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedStreamServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&StreamController_ServiceDesc, srv)
|
||||
s.RegisterService(&StreamService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _StreamController_CountStreamConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _StreamService_CountStreamConnection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CountConnectionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StreamControllerServer).CountStreamConnection(ctx, in)
|
||||
return srv.(StreamServiceServer).CountStreamConnection(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StreamController_CountStreamConnection_FullMethodName,
|
||||
FullMethod: StreamService_CountStreamConnection_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StreamControllerServer).CountStreamConnection(ctx, req.(*CountConnectionRequest))
|
||||
return srv.(StreamServiceServer).CountStreamConnection(ctx, req.(*CountConnectionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StreamController_PushStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _StreamService_PushStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushStreamRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StreamControllerServer).PushStream(ctx, in)
|
||||
return srv.(StreamServiceServer).PushStream(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StreamController_PushStream_FullMethodName,
|
||||
FullMethod: StreamService_PushStream_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StreamControllerServer).PushStream(ctx, req.(*PushStreamRequest))
|
||||
return srv.(StreamServiceServer).PushStream(ctx, req.(*PushStreamRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _StreamController_PushStreamBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _StreamService_PushStreamBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PushStreamBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(StreamControllerServer).PushStreamBatch(ctx, in)
|
||||
return srv.(StreamServiceServer).PushStreamBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: StreamController_PushStreamBatch_FullMethodName,
|
||||
FullMethod: StreamService_PushStreamBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(StreamControllerServer).PushStreamBatch(ctx, req.(*PushStreamBatchRequest))
|
||||
return srv.(StreamServiceServer).PushStreamBatch(ctx, req.(*PushStreamBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// StreamController_ServiceDesc is the grpc.ServiceDesc for StreamController service.
|
||||
// StreamService_ServiceDesc is the grpc.ServiceDesc for StreamService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var StreamController_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.StreamController",
|
||||
HandlerType: (*StreamControllerServer)(nil),
|
||||
var StreamService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.StreamService",
|
||||
HandlerType: (*StreamServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CountStreamConnection",
|
||||
Handler: _StreamController_CountStreamConnection_Handler,
|
||||
Handler: _StreamService_CountStreamConnection_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushStream",
|
||||
Handler: _StreamController_PushStream_Handler,
|
||||
Handler: _StreamService_PushStream_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PushStreamBatch",
|
||||
Handler: _StreamController_PushStreamBatch_Handler,
|
||||
Handler: _StreamService_PushStreamBatch_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
Reference in New Issue
Block a user