Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterBookstoreServiceServer(s grpc.ServiceRegistrar, srv BookstoreServiceServer)
- type Book
- type BookstoreServiceClient
- type BookstoreServiceServer
- type CreateBookRequest
- func (*CreateBookRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateBookRequest) GetBook() *Book
- func (x *CreateBookRequest) GetShelf() int64
- func (*CreateBookRequest) ProtoMessage()
- func (x *CreateBookRequest) ProtoReflect() protoreflect.Message
- func (x *CreateBookRequest) Reset()
- func (x *CreateBookRequest) String() string
- type CreateShelfRequest
- func (*CreateShelfRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateShelfRequest) GetShelf() *Shelf
- func (*CreateShelfRequest) ProtoMessage()
- func (x *CreateShelfRequest) ProtoReflect() protoreflect.Message
- func (x *CreateShelfRequest) Reset()
- func (x *CreateShelfRequest) String() string
- type DeleteBookRequest
- func (*DeleteBookRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteBookRequest) GetBook() int64
- func (x *DeleteBookRequest) GetShelf() int64
- func (*DeleteBookRequest) ProtoMessage()
- func (x *DeleteBookRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteBookRequest) Reset()
- func (x *DeleteBookRequest) String() string
- type DeleteShelfRequest
- func (*DeleteShelfRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteShelfRequest) GetShelf() int64
- func (*DeleteShelfRequest) ProtoMessage()
- func (x *DeleteShelfRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteShelfRequest) Reset()
- func (x *DeleteShelfRequest) String() string
- type GetBookRequest
- func (*GetBookRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetBookRequest) GetBook() int64
- func (x *GetBookRequest) GetShelf() int64
- func (*GetBookRequest) ProtoMessage()
- func (x *GetBookRequest) ProtoReflect() protoreflect.Message
- func (x *GetBookRequest) Reset()
- func (x *GetBookRequest) String() string
- type GetShelfRequest
- type ListBooksRequest
- type ListBooksResponse
- type ListShelvesResponse
- func (*ListShelvesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListShelvesResponse) GetShelves() []*Shelf
- func (*ListShelvesResponse) ProtoMessage()
- func (x *ListShelvesResponse) ProtoReflect() protoreflect.Message
- func (x *ListShelvesResponse) Reset()
- func (x *ListShelvesResponse) String() string
- type Shelf
- type UnimplementedBookstoreServiceServer
- func (UnimplementedBookstoreServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error)
- func (UnimplementedBookstoreServiceServer) CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error)
- func (UnimplementedBookstoreServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error)
- func (UnimplementedBookstoreServiceServer) DeleteShelf(context.Context, *DeleteShelfRequest) (*emptypb.Empty, error)
- func (UnimplementedBookstoreServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
- func (UnimplementedBookstoreServiceServer) GetShelf(context.Context, *GetShelfRequest) (*Shelf, error)
- func (UnimplementedBookstoreServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
- func (UnimplementedBookstoreServiceServer) ListShelves(context.Context, *emptypb.Empty) (*ListShelvesResponse, error)
- type UnsafeBookstoreServiceServer
Constants ¶
const ( BookstoreService_ListShelves_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/ListShelves" BookstoreService_CreateShelf_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/CreateShelf" BookstoreService_GetShelf_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/GetShelf" BookstoreService_DeleteShelf_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/DeleteShelf" BookstoreService_ListBooks_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/ListBooks" BookstoreService_CreateBook_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/CreateBook" BookstoreService_GetBook_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/GetBook" BookstoreService_DeleteBook_FullMethodName = "/qclaogui.bookstore.v1alpha1.BookstoreService/DeleteBook" )
Variables ¶
var BookstoreService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "qclaogui.bookstore.v1alpha1.BookstoreService", HandlerType: (*BookstoreServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListShelves", Handler: _BookstoreService_ListShelves_Handler, }, { MethodName: "CreateShelf", Handler: _BookstoreService_CreateShelf_Handler, }, { MethodName: "GetShelf", Handler: _BookstoreService_GetShelf_Handler, }, { MethodName: "DeleteShelf", Handler: _BookstoreService_DeleteShelf_Handler, }, { MethodName: "ListBooks", Handler: _BookstoreService_ListBooks_Handler, }, { MethodName: "CreateBook", Handler: _BookstoreService_CreateBook_Handler, }, { MethodName: "GetBook", Handler: _BookstoreService_GetBook_Handler, }, { MethodName: "DeleteBook", Handler: _BookstoreService_DeleteBook_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "qclaogui/bookstore/v1alpha1/bookstore.proto", }
BookstoreService_ServiceDesc is the grpc.ServiceDesc for BookstoreService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_qclaogui_bookstore_v1alpha1_bookstore_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBookstoreServiceServer ¶
func RegisterBookstoreServiceServer(s grpc.ServiceRegistrar, srv BookstoreServiceServer)
Types ¶
type Book ¶
type Book struct { // A unique book id. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // An author of the book. Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` // A book title. Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // contains filtered or unexported fields }
A book resource.
func (*Book) Descriptor
deprecated
func (*Book) ProtoMessage ¶
func (*Book) ProtoMessage()
func (*Book) ProtoReflect ¶
func (x *Book) ProtoReflect() protoreflect.Message
type BookstoreServiceClient ¶
type BookstoreServiceClient interface { // Returns a list of all shelves in the bookstore. ListShelves(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListShelvesResponse, error) // Creates a new shelf in the bookstore. CreateShelf(ctx context.Context, in *CreateShelfRequest, opts ...grpc.CallOption) (*Shelf, error) // Returns a specific bookstore shelf. GetShelf(ctx context.Context, in *GetShelfRequest, opts ...grpc.CallOption) (*Shelf, error) // Deletes a shelf, including all books that are stored on the shelf. DeleteShelf(ctx context.Context, in *DeleteShelfRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Returns a list of books on a shelf. ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error) // Creates a new book. CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error) // Returns a specific book. GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error) // Deletes a book from a shelf. DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
BookstoreServiceClient is the client API for BookstoreService 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 NewBookstoreServiceClient ¶
func NewBookstoreServiceClient(cc grpc.ClientConnInterface) BookstoreServiceClient
type BookstoreServiceServer ¶
type BookstoreServiceServer interface { // Returns a list of all shelves in the bookstore. ListShelves(context.Context, *emptypb.Empty) (*ListShelvesResponse, error) // Creates a new shelf in the bookstore. CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error) // Returns a specific bookstore shelf. GetShelf(context.Context, *GetShelfRequest) (*Shelf, error) // Deletes a shelf, including all books that are stored on the shelf. DeleteShelf(context.Context, *DeleteShelfRequest) (*emptypb.Empty, error) // Returns a list of books on a shelf. ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error) // Creates a new book. CreateBook(context.Context, *CreateBookRequest) (*Book, error) // Returns a specific book. GetBook(context.Context, *GetBookRequest) (*Book, error) // Deletes a book from a shelf. DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error) }
BookstoreServiceServer is the server API for BookstoreService service. All implementations should embed UnimplementedBookstoreServiceServer for forward compatibility
type CreateBookRequest ¶
type CreateBookRequest struct { // The ID of the shelf on which to create a book. Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // A book resource to create on the shelf. Book *Book `protobuf:"bytes,2,opt,name=book,proto3" json:"book,omitempty"` // contains filtered or unexported fields }
Request message for CreateBook method.
func (*CreateBookRequest) Descriptor
deprecated
func (*CreateBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateBookRequest.ProtoReflect.Descriptor instead.
func (*CreateBookRequest) GetBook ¶
func (x *CreateBookRequest) GetBook() *Book
func (*CreateBookRequest) GetShelf ¶
func (x *CreateBookRequest) GetShelf() int64
func (*CreateBookRequest) ProtoMessage ¶
func (*CreateBookRequest) ProtoMessage()
func (*CreateBookRequest) ProtoReflect ¶
func (x *CreateBookRequest) ProtoReflect() protoreflect.Message
func (*CreateBookRequest) Reset ¶
func (x *CreateBookRequest) Reset()
func (*CreateBookRequest) String ¶
func (x *CreateBookRequest) String() string
type CreateShelfRequest ¶
type CreateShelfRequest struct { // The shelf resource to create. Shelf *Shelf `protobuf:"bytes,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // contains filtered or unexported fields }
Request message for CreateShelf method.
func (*CreateShelfRequest) Descriptor
deprecated
func (*CreateShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateShelfRequest.ProtoReflect.Descriptor instead.
func (*CreateShelfRequest) GetShelf ¶
func (x *CreateShelfRequest) GetShelf() *Shelf
func (*CreateShelfRequest) ProtoMessage ¶
func (*CreateShelfRequest) ProtoMessage()
func (*CreateShelfRequest) ProtoReflect ¶
func (x *CreateShelfRequest) ProtoReflect() protoreflect.Message
func (*CreateShelfRequest) Reset ¶
func (x *CreateShelfRequest) Reset()
func (*CreateShelfRequest) String ¶
func (x *CreateShelfRequest) String() string
type DeleteBookRequest ¶
type DeleteBookRequest struct { // The ID of the shelf from which to delete a book. Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // The ID of the book to delete. Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"` // contains filtered or unexported fields }
Request message for DeleteBook method.
func (*DeleteBookRequest) Descriptor
deprecated
func (*DeleteBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteBookRequest.ProtoReflect.Descriptor instead.
func (*DeleteBookRequest) GetBook ¶
func (x *DeleteBookRequest) GetBook() int64
func (*DeleteBookRequest) GetShelf ¶
func (x *DeleteBookRequest) GetShelf() int64
func (*DeleteBookRequest) ProtoMessage ¶
func (*DeleteBookRequest) ProtoMessage()
func (*DeleteBookRequest) ProtoReflect ¶
func (x *DeleteBookRequest) ProtoReflect() protoreflect.Message
func (*DeleteBookRequest) Reset ¶
func (x *DeleteBookRequest) Reset()
func (*DeleteBookRequest) String ¶
func (x *DeleteBookRequest) String() string
type DeleteShelfRequest ¶
type DeleteShelfRequest struct { // The ID of the shelf to delete. Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // contains filtered or unexported fields }
Request message for DeleteShelf method.
func (*DeleteShelfRequest) Descriptor
deprecated
func (*DeleteShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteShelfRequest.ProtoReflect.Descriptor instead.
func (*DeleteShelfRequest) GetShelf ¶
func (x *DeleteShelfRequest) GetShelf() int64
func (*DeleteShelfRequest) ProtoMessage ¶
func (*DeleteShelfRequest) ProtoMessage()
func (*DeleteShelfRequest) ProtoReflect ¶
func (x *DeleteShelfRequest) ProtoReflect() protoreflect.Message
func (*DeleteShelfRequest) Reset ¶
func (x *DeleteShelfRequest) Reset()
func (*DeleteShelfRequest) String ¶
func (x *DeleteShelfRequest) String() string
type GetBookRequest ¶
type GetBookRequest struct { // The ID of the shelf from which to retrieve a book. Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // The ID of the book to retrieve. Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"` // contains filtered or unexported fields }
Request message for GetBook method.
func (*GetBookRequest) Descriptor
deprecated
func (*GetBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBookRequest.ProtoReflect.Descriptor instead.
func (*GetBookRequest) GetBook ¶
func (x *GetBookRequest) GetBook() int64
func (*GetBookRequest) GetShelf ¶
func (x *GetBookRequest) GetShelf() int64
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 GetShelfRequest ¶
type GetShelfRequest struct { // The ID of the shelf resource to retrieve. Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // contains filtered or unexported fields }
Request message for GetShelf method.
func (*GetShelfRequest) Descriptor
deprecated
func (*GetShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetShelfRequest.ProtoReflect.Descriptor instead.
func (*GetShelfRequest) GetShelf ¶
func (x *GetShelfRequest) GetShelf() int64
func (*GetShelfRequest) ProtoMessage ¶
func (*GetShelfRequest) ProtoMessage()
func (*GetShelfRequest) ProtoReflect ¶
func (x *GetShelfRequest) ProtoReflect() protoreflect.Message
func (*GetShelfRequest) Reset ¶
func (x *GetShelfRequest) Reset()
func (*GetShelfRequest) String ¶
func (x *GetShelfRequest) String() string
type ListBooksRequest ¶
type ListBooksRequest struct { // ID of the shelf which books to list. Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // contains filtered or unexported fields }
Request message for ListBooks method.
func (*ListBooksRequest) Descriptor
deprecated
func (*ListBooksRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListBooksRequest.ProtoReflect.Descriptor instead.
func (*ListBooksRequest) GetShelf ¶
func (x *ListBooksRequest) GetShelf() int64
func (*ListBooksRequest) ProtoMessage ¶
func (*ListBooksRequest) ProtoMessage()
func (*ListBooksRequest) ProtoReflect ¶
func (x *ListBooksRequest) ProtoReflect() protoreflect.Message
func (*ListBooksRequest) Reset ¶
func (x *ListBooksRequest) Reset()
func (*ListBooksRequest) String ¶
func (x *ListBooksRequest) String() string
type ListBooksResponse ¶
type ListBooksResponse struct { // The books on the shelf. Books []*Book `protobuf:"bytes,1,rep,name=books,proto3" json:"books,omitempty"` // contains filtered or unexported fields }
Response message to ListBooks method.
func (*ListBooksResponse) Descriptor
deprecated
func (*ListBooksResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListBooksResponse.ProtoReflect.Descriptor instead.
func (*ListBooksResponse) GetBooks ¶
func (x *ListBooksResponse) GetBooks() []*Book
func (*ListBooksResponse) ProtoMessage ¶
func (*ListBooksResponse) ProtoMessage()
func (*ListBooksResponse) ProtoReflect ¶
func (x *ListBooksResponse) ProtoReflect() protoreflect.Message
func (*ListBooksResponse) Reset ¶
func (x *ListBooksResponse) Reset()
func (*ListBooksResponse) String ¶
func (x *ListBooksResponse) String() string
type ListShelvesResponse ¶
type ListShelvesResponse struct { // Shelves in the bookstore. Shelves []*Shelf `protobuf:"bytes,1,rep,name=shelves,proto3" json:"shelves,omitempty"` // contains filtered or unexported fields }
Response to ListShelves call.
func (*ListShelvesResponse) Descriptor
deprecated
func (*ListShelvesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListShelvesResponse.ProtoReflect.Descriptor instead.
func (*ListShelvesResponse) GetShelves ¶
func (x *ListShelvesResponse) GetShelves() []*Shelf
func (*ListShelvesResponse) ProtoMessage ¶
func (*ListShelvesResponse) ProtoMessage()
func (*ListShelvesResponse) ProtoReflect ¶
func (x *ListShelvesResponse) ProtoReflect() protoreflect.Message
func (*ListShelvesResponse) Reset ¶
func (x *ListShelvesResponse) Reset()
func (*ListShelvesResponse) String ¶
func (x *ListShelvesResponse) String() string
type Shelf ¶
type Shelf struct { // A unique shelf id. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // A theme of the shelf (fiction, poetry, etc). Theme string `protobuf:"bytes,2,opt,name=theme,proto3" json:"theme,omitempty"` // contains filtered or unexported fields }
A shelf resource.
func (*Shelf) Descriptor
deprecated
func (*Shelf) ProtoMessage ¶
func (*Shelf) ProtoMessage()
func (*Shelf) ProtoReflect ¶
func (x *Shelf) ProtoReflect() protoreflect.Message
type UnimplementedBookstoreServiceServer ¶
type UnimplementedBookstoreServiceServer struct { }
UnimplementedBookstoreServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedBookstoreServiceServer) CreateBook ¶
func (UnimplementedBookstoreServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error)
func (UnimplementedBookstoreServiceServer) CreateShelf ¶
func (UnimplementedBookstoreServiceServer) CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error)
func (UnimplementedBookstoreServiceServer) DeleteBook ¶
func (UnimplementedBookstoreServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error)
func (UnimplementedBookstoreServiceServer) DeleteShelf ¶
func (UnimplementedBookstoreServiceServer) DeleteShelf(context.Context, *DeleteShelfRequest) (*emptypb.Empty, error)
func (UnimplementedBookstoreServiceServer) GetBook ¶
func (UnimplementedBookstoreServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
func (UnimplementedBookstoreServiceServer) GetShelf ¶
func (UnimplementedBookstoreServiceServer) GetShelf(context.Context, *GetShelfRequest) (*Shelf, error)
func (UnimplementedBookstoreServiceServer) ListBooks ¶
func (UnimplementedBookstoreServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
func (UnimplementedBookstoreServiceServer) ListShelves ¶
func (UnimplementedBookstoreServiceServer) ListShelves(context.Context, *emptypb.Empty) (*ListShelvesResponse, error)
type UnsafeBookstoreServiceServer ¶
type UnsafeBookstoreServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBookstoreServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BookstoreServiceServer will result in compilation errors.