Able to get user by using name

This commit is contained in:
2024-11-03 01:40:36 +08:00
parent ea150608b4
commit 194d270904
15 changed files with 979 additions and 465 deletions

View File

@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc-gen-go-grpc v1.2.0
// - protoc v5.28.2
// source: database.proto
@@ -15,12 +15,8 @@ import (
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
DatabaseService_AllocDatabase_FullMethodName = "/proto.DatabaseService/AllocDatabase"
)
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// DatabaseServiceClient is the client API for DatabaseService service.
//
@@ -38,9 +34,8 @@ func NewDatabaseServiceClient(cc grpc.ClientConnInterface) DatabaseServiceClient
}
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, DatabaseService_AllocDatabase_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, "/proto.DatabaseService/AllocDatabase", in, out, opts...)
if err != nil {
return nil, err
}
@@ -49,24 +44,20 @@ func (c *databaseServiceClient) AllocDatabase(ctx context.Context, in *AllocData
// DatabaseServiceServer is the server API for DatabaseService service.
// All implementations must embed UnimplementedDatabaseServiceServer
// for forward compatibility.
// for forward compatibility
type DatabaseServiceServer interface {
AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error)
mustEmbedUnimplementedDatabaseServiceServer()
}
// 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 UnimplementedDatabaseServiceServer struct{}
// UnimplementedDatabaseServiceServer must be embedded to have forward compatible implementations.
type UnimplementedDatabaseServiceServer struct {
}
func (UnimplementedDatabaseServiceServer) AllocDatabase(context.Context, *AllocDatabaseRequest) (*AllocDatabaseResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AllocDatabase not implemented")
}
func (UnimplementedDatabaseServiceServer) mustEmbedUnimplementedDatabaseServiceServer() {}
func (UnimplementedDatabaseServiceServer) testEmbeddedByValue() {}
// 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
@@ -76,13 +67,6 @@ type UnsafeDatabaseServiceServer interface {
}
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(&DatabaseService_ServiceDesc, srv)
}
@@ -96,7 +80,7 @@ func _DatabaseService_AllocDatabase_Handler(srv interface{}, ctx context.Context
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DatabaseService_AllocDatabase_FullMethodName,
FullMethod: "/proto.DatabaseService/AllocDatabase",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DatabaseServiceServer).AllocDatabase(ctx, req.(*AllocDatabaseRequest))