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: postman.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 (
Postman_DeliverNotification_FullMethodName = "/proto.Postman/DeliverNotification"
@ -85,7 +85,7 @@ func (c *postmanClient) DeliverEmailBatch(ctx context.Context, in *DeliverEmailB
// PostmanServer is the server API for Postman service.
// All implementations must embed UnimplementedPostmanServer
// for forward compatibility
// for forward compatibility.
type PostmanServer interface {
DeliverNotification(context.Context, *DeliverNotificationRequest) (*DeliverResponse, error)
DeliverNotificationBatch(context.Context, *DeliverNotificationBatchRequest) (*DeliverResponse, error)
@ -94,9 +94,12 @@ type PostmanServer interface {
mustEmbedUnimplementedPostmanServer()
}
// UnimplementedPostmanServer must be embedded to have forward compatible implementations.
type UnimplementedPostmanServer struct {
}
// UnimplementedPostmanServer 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 UnimplementedPostmanServer struct{}
func (UnimplementedPostmanServer) DeliverNotification(context.Context, *DeliverNotificationRequest) (*DeliverResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeliverNotification not implemented")
@ -111,6 +114,7 @@ func (UnimplementedPostmanServer) DeliverEmailBatch(context.Context, *DeliverEma
return nil, status.Errorf(codes.Unimplemented, "method DeliverEmailBatch not implemented")
}
func (UnimplementedPostmanServer) mustEmbedUnimplementedPostmanServer() {}
func (UnimplementedPostmanServer) testEmbeddedByValue() {}
// UnsafePostmanServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PostmanServer will
@ -120,6 +124,13 @@ type UnsafePostmanServer interface {
}
func RegisterPostmanServer(s grpc.ServiceRegistrar, srv PostmanServer) {
// If the following call pancis, it indicates UnimplementedPostmanServer 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(&Postman_ServiceDesc, srv)
}