List related relatives

This commit is contained in:
2024-08-01 14:05:23 +08:00
parent 4cea915abf
commit 8cf0feb09a
9 changed files with 170 additions and 82 deletions

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.27.1
// source: services.proto
@ -15,8 +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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ServiceDirectory_GetService_FullMethodName = "/proto.ServiceDirectory/GetService"
@ -85,7 +85,7 @@ func (c *serviceDirectoryClient) RemoveService(ctx context.Context, in *RemoveSe
// ServiceDirectoryServer is the server API for ServiceDirectory service.
// All implementations must embed UnimplementedServiceDirectoryServer
// for forward compatibility
// for forward compatibility.
type ServiceDirectoryServer interface {
GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error)
ListService(context.Context, *ListServiceRequest) (*ListServiceResponse, error)
@ -94,9 +94,12 @@ type ServiceDirectoryServer interface {
mustEmbedUnimplementedServiceDirectoryServer()
}
// UnimplementedServiceDirectoryServer must be embedded to have forward compatible implementations.
type UnimplementedServiceDirectoryServer struct {
}
// UnimplementedServiceDirectoryServer 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{}
func (UnimplementedServiceDirectoryServer) GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented")
@ -111,6 +114,7 @@ func (UnimplementedServiceDirectoryServer) RemoveService(context.Context, *Remov
return nil, status.Errorf(codes.Unimplemented, "method RemoveService not implemented")
}
func (UnimplementedServiceDirectoryServer) mustEmbedUnimplementedServiceDirectoryServer() {}
func (UnimplementedServiceDirectoryServer) 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
@ -120,6 +124,13 @@ type UnsafeServiceDirectoryServer interface {
}
func RegisterServiceDirectoryServer(s grpc.ServiceRegistrar, srv ServiceDirectoryServer) {
// If the following call pancis, it indicates UnimplementedServiceDirectoryServer 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)
}