Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BookService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "books.BookService", HandlerType: (*BookServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetBook", Handler: _BookService_GetBook_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/books.proto", }
BookService_ServiceDesc is the grpc.ServiceDesc for BookService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_books_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBookServiceServer ¶
func RegisterBookServiceServer(s grpc.ServiceRegistrar, srv BookServiceServer)
Types ¶
type Book ¶
type Book struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Authors []string `protobuf:"bytes,3,rep,name=authors,proto3" json:"authors,omitempty"` // contains filtered or unexported fields }
func (*Book) Descriptor
deprecated
func (*Book) GetAuthors ¶
func (*Book) ProtoMessage ¶
func (*Book) ProtoMessage()
func (*Book) ProtoReflect ¶
func (x *Book) ProtoReflect() protoreflect.Message
type BookServiceClient ¶
type BookServiceClient interface {
GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error)
}
BookServiceClient is the client API for BookService 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.
func NewBookServiceClient ¶
func NewBookServiceClient(cc grpc.ClientConnInterface) BookServiceClient
type BookServiceServer ¶
type BookServiceServer interface { GetBook(context.Context, *GetBookRequest) (*Book, error) // contains filtered or unexported methods }
BookServiceServer is the server API for BookService service. All implementations must embed UnimplementedBookServiceServer for forward compatibility
type GetBookRequest ¶
type GetBookRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetBookRequest) Descriptor
deprecated
func (*GetBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBookRequest.ProtoReflect.Descriptor instead.
func (*GetBookRequest) GetId ¶
func (x *GetBookRequest) GetId() string
func (*GetBookRequest) ProtoMessage ¶
func (*GetBookRequest) ProtoMessage()
func (*GetBookRequest) ProtoReflect ¶
func (x *GetBookRequest) ProtoReflect() protoreflect.Message
func (*GetBookRequest) Reset ¶
func (x *GetBookRequest) Reset()
func (*GetBookRequest) String ¶
func (x *GetBookRequest) String() string
type UnimplementedBookServiceServer ¶
type UnimplementedBookServiceServer struct { }
UnimplementedBookServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedBookServiceServer) GetBook ¶
func (UnimplementedBookServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
type UnsafeBookServiceServer ¶
type UnsafeBookServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBookServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BookServiceServer will result in compilation errors.