var File_google_example_library_v1_library_proto protoreflect.FileDescriptor
func RegisterLibraryServiceServer(s *grpc.Server, srv LibraryServiceServer)
A single book in the library.
type Book struct { // The resource name of the book. // Book names have the form `shelves/{shelf_id}/books/{book_id}`. // The name is ignored when creating a book. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The name of the book author. Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` // The title of the book. Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` // Value indicating whether the book has been read. Read bool `protobuf:"varint,4,opt,name=read,proto3" json:"read,omitempty"` // contains filtered or unexported fields }
func (*Book) Descriptor() ([]byte, []int)
Deprecated: Use Book.ProtoReflect.Descriptor instead.
func (x *Book) GetAuthor() string
func (x *Book) GetName() string
func (x *Book) GetRead() bool
func (x *Book) GetTitle() string
func (*Book) ProtoMessage()
func (x *Book) ProtoReflect() protoreflect.Message
func (x *Book) Reset()
func (x *Book) String() string
Request message for LibraryService.CreateBook.
type CreateBookRequest struct { // The name of the shelf in which the book is created. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // The book to create. Book *Book `protobuf:"bytes,2,opt,name=book,proto3" json:"book,omitempty"` // contains filtered or unexported fields }
func (*CreateBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateBookRequest.ProtoReflect.Descriptor instead.
func (x *CreateBookRequest) GetBook() *Book
func (x *CreateBookRequest) GetParent() string
func (*CreateBookRequest) ProtoMessage()
func (x *CreateBookRequest) ProtoReflect() protoreflect.Message
func (x *CreateBookRequest) Reset()
func (x *CreateBookRequest) String() string
Request message for LibraryService.CreateShelf.
type CreateShelfRequest struct { // The shelf to create. Shelf *Shelf `protobuf:"bytes,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // contains filtered or unexported fields }
func (*CreateShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateShelfRequest.ProtoReflect.Descriptor instead.
func (x *CreateShelfRequest) GetShelf() *Shelf
func (*CreateShelfRequest) ProtoMessage()
func (x *CreateShelfRequest) ProtoReflect() protoreflect.Message
func (x *CreateShelfRequest) Reset()
func (x *CreateShelfRequest) String() string
Request message for LibraryService.DeleteBook.
type DeleteBookRequest struct { // The name of the book to delete. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*DeleteBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteBookRequest.ProtoReflect.Descriptor instead.
func (x *DeleteBookRequest) GetName() string
func (*DeleteBookRequest) ProtoMessage()
func (x *DeleteBookRequest) ProtoReflect() protoreflect.Message
func (x *DeleteBookRequest) Reset()
func (x *DeleteBookRequest) String() string
Request message for LibraryService.DeleteShelf.
type DeleteShelfRequest struct { // The name of the shelf to delete. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*DeleteShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteShelfRequest.ProtoReflect.Descriptor instead.
func (x *DeleteShelfRequest) GetName() string
func (*DeleteShelfRequest) ProtoMessage()
func (x *DeleteShelfRequest) ProtoReflect() protoreflect.Message
func (x *DeleteShelfRequest) Reset()
func (x *DeleteShelfRequest) String() string
Request message for LibraryService.GetBook.
type GetBookRequest struct { // The name of the book to retrieve. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GetBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBookRequest.ProtoReflect.Descriptor instead.
func (x *GetBookRequest) GetName() string
func (*GetBookRequest) ProtoMessage()
func (x *GetBookRequest) ProtoReflect() protoreflect.Message
func (x *GetBookRequest) Reset()
func (x *GetBookRequest) String() string
Request message for LibraryService.GetShelf.
type GetShelfRequest struct { // The name of the shelf to retrieve. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GetShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetShelfRequest.ProtoReflect.Descriptor instead.
func (x *GetShelfRequest) GetName() string
func (*GetShelfRequest) ProtoMessage()
func (x *GetShelfRequest) ProtoReflect() protoreflect.Message
func (x *GetShelfRequest) Reset()
func (x *GetShelfRequest) String() string
LibraryServiceClient is the client API for LibraryService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type LibraryServiceClient interface { // Creates a shelf, and returns the new Shelf. CreateShelf(ctx context.Context, in *CreateShelfRequest, opts ...grpc.CallOption) (*Shelf, error) // Gets a shelf. Returns NOT_FOUND if the shelf does not exist. GetShelf(ctx context.Context, in *GetShelfRequest, opts ...grpc.CallOption) (*Shelf, error) // Lists shelves. The order is unspecified but deterministic. Newly created // shelves will not necessarily be added to the end of this list. ListShelves(ctx context.Context, in *ListShelvesRequest, opts ...grpc.CallOption) (*ListShelvesResponse, error) // Deletes a shelf. Returns NOT_FOUND if the shelf does not exist. DeleteShelf(ctx context.Context, in *DeleteShelfRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Merges two shelves by adding all books from the shelf named // `other_shelf_name` to shelf `name`, and deletes // `other_shelf_name`. Returns the updated shelf. // The book ids of the moved books may not be the same as the original books. // // Returns NOT_FOUND if either shelf does not exist. // This call is a no-op if the specified shelves are the same. MergeShelves(ctx context.Context, in *MergeShelvesRequest, opts ...grpc.CallOption) (*Shelf, error) // Creates a book, and returns the new Book. CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error) // Gets a book. Returns NOT_FOUND if the book does not exist. GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error) // Lists books in a shelf. The order is unspecified but deterministic. Newly // created books will not necessarily be added to the end of this list. // Returns NOT_FOUND if the shelf does not exist. ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error) // Deletes a book. Returns NOT_FOUND if the book does not exist. DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) // Updates a book. Returns INVALID_ARGUMENT if the name of the book // is non-empty and does not equal the existing name. UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error) // Moves a book to another shelf, and returns the new book. The book // id of the new book may not be the same as the original book. MoveBook(ctx context.Context, in *MoveBookRequest, opts ...grpc.CallOption) (*Book, error) }
func NewLibraryServiceClient(cc grpc.ClientConnInterface) LibraryServiceClient
LibraryServiceServer is the server API for LibraryService service.
type LibraryServiceServer interface { // Creates a shelf, and returns the new Shelf. CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error) // Gets a shelf. Returns NOT_FOUND if the shelf does not exist. GetShelf(context.Context, *GetShelfRequest) (*Shelf, error) // Lists shelves. The order is unspecified but deterministic. Newly created // shelves will not necessarily be added to the end of this list. ListShelves(context.Context, *ListShelvesRequest) (*ListShelvesResponse, error) // Deletes a shelf. Returns NOT_FOUND if the shelf does not exist. DeleteShelf(context.Context, *DeleteShelfRequest) (*emptypb.Empty, error) // Merges two shelves by adding all books from the shelf named // `other_shelf_name` to shelf `name`, and deletes // `other_shelf_name`. Returns the updated shelf. // The book ids of the moved books may not be the same as the original books. // // Returns NOT_FOUND if either shelf does not exist. // This call is a no-op if the specified shelves are the same. MergeShelves(context.Context, *MergeShelvesRequest) (*Shelf, error) // Creates a book, and returns the new Book. CreateBook(context.Context, *CreateBookRequest) (*Book, error) // Gets a book. Returns NOT_FOUND if the book does not exist. GetBook(context.Context, *GetBookRequest) (*Book, error) // Lists books in a shelf. The order is unspecified but deterministic. Newly // created books will not necessarily be added to the end of this list. // Returns NOT_FOUND if the shelf does not exist. ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error) // Deletes a book. Returns NOT_FOUND if the book does not exist. DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error) // Updates a book. Returns INVALID_ARGUMENT if the name of the book // is non-empty and does not equal the existing name. UpdateBook(context.Context, *UpdateBookRequest) (*Book, error) // Moves a book to another shelf, and returns the new book. The book // id of the new book may not be the same as the original book. MoveBook(context.Context, *MoveBookRequest) (*Book, error) }
Request message for LibraryService.ListBooks.
type ListBooksRequest struct { // The name of the shelf whose books we'd like to list. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // Requested page size. Server may return fewer books than requested. // If unspecified, server will pick an appropriate default. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // A token identifying a page of results the server should return. // Typically, this is the value of // [ListBooksResponse.next_page_token][google.example.library.v1.ListBooksResponse.next_page_token]. // returned from the previous call to `ListBooks` method. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // contains filtered or unexported fields }
func (*ListBooksRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListBooksRequest.ProtoReflect.Descriptor instead.
func (x *ListBooksRequest) GetPageSize() int32
func (x *ListBooksRequest) GetPageToken() string
func (x *ListBooksRequest) GetParent() string
func (*ListBooksRequest) ProtoMessage()
func (x *ListBooksRequest) ProtoReflect() protoreflect.Message
func (x *ListBooksRequest) Reset()
func (x *ListBooksRequest) String() string
Response message for LibraryService.ListBooks.
type ListBooksResponse struct { // The list of books. Books []*Book `protobuf:"bytes,1,rep,name=books,proto3" json:"books,omitempty"` // A token to retrieve next page of results. // Pass this value in the // [ListBooksRequest.page_token][google.example.library.v1.ListBooksRequest.page_token] // field in the subsequent call to `ListBooks` method to retrieve the next // page of results. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
func (*ListBooksResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListBooksResponse.ProtoReflect.Descriptor instead.
func (x *ListBooksResponse) GetBooks() []*Book
func (x *ListBooksResponse) GetNextPageToken() string
func (*ListBooksResponse) ProtoMessage()
func (x *ListBooksResponse) ProtoReflect() protoreflect.Message
func (x *ListBooksResponse) Reset()
func (x *ListBooksResponse) String() string
Request message for LibraryService.ListShelves.
type ListShelvesRequest struct { // Requested page size. Server may return fewer shelves than requested. // If unspecified, server will pick an appropriate default. PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // A token identifying a page of results the server should return. // Typically, this is the value of // [ListShelvesResponse.next_page_token][google.example.library.v1.ListShelvesResponse.next_page_token] // returned from the previous call to `ListShelves` method. PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // contains filtered or unexported fields }
func (*ListShelvesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListShelvesRequest.ProtoReflect.Descriptor instead.
func (x *ListShelvesRequest) GetPageSize() int32
func (x *ListShelvesRequest) GetPageToken() string
func (*ListShelvesRequest) ProtoMessage()
func (x *ListShelvesRequest) ProtoReflect() protoreflect.Message
func (x *ListShelvesRequest) Reset()
func (x *ListShelvesRequest) String() string
Response message for LibraryService.ListShelves.
type ListShelvesResponse struct { // The list of shelves. Shelves []*Shelf `protobuf:"bytes,1,rep,name=shelves,proto3" json:"shelves,omitempty"` // A token to retrieve next page of results. // Pass this value in the // [ListShelvesRequest.page_token][google.example.library.v1.ListShelvesRequest.page_token] // field in the subsequent call to `ListShelves` method to retrieve the next // page of results. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
func (*ListShelvesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListShelvesResponse.ProtoReflect.Descriptor instead.
func (x *ListShelvesResponse) GetNextPageToken() string
func (x *ListShelvesResponse) GetShelves() []*Shelf
func (*ListShelvesResponse) ProtoMessage()
func (x *ListShelvesResponse) ProtoReflect() protoreflect.Message
func (x *ListShelvesResponse) Reset()
func (x *ListShelvesResponse) String() string
Describes the shelf being removed (other_shelf_name) and updated (name) in this merge.
type MergeShelvesRequest struct { // The name of the shelf we're adding books to. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The name of the shelf we're removing books from and deleting. OtherShelf string `protobuf:"bytes,2,opt,name=other_shelf,json=otherShelf,proto3" json:"other_shelf,omitempty"` // contains filtered or unexported fields }
func (*MergeShelvesRequest) Descriptor() ([]byte, []int)
Deprecated: Use MergeShelvesRequest.ProtoReflect.Descriptor instead.
func (x *MergeShelvesRequest) GetName() string
func (x *MergeShelvesRequest) GetOtherShelf() string
func (*MergeShelvesRequest) ProtoMessage()
func (x *MergeShelvesRequest) ProtoReflect() protoreflect.Message
func (x *MergeShelvesRequest) Reset()
func (x *MergeShelvesRequest) String() string
Describes what book to move (name) and what shelf we're moving it to (other_shelf_name).
type MoveBookRequest struct { // The name of the book to move. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The name of the destination shelf. OtherShelfName string `protobuf:"bytes,2,opt,name=other_shelf_name,json=otherShelfName,proto3" json:"other_shelf_name,omitempty"` // contains filtered or unexported fields }
func (*MoveBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use MoveBookRequest.ProtoReflect.Descriptor instead.
func (x *MoveBookRequest) GetName() string
func (x *MoveBookRequest) GetOtherShelfName() string
func (*MoveBookRequest) ProtoMessage()
func (x *MoveBookRequest) ProtoReflect() protoreflect.Message
func (x *MoveBookRequest) Reset()
func (x *MoveBookRequest) String() string
A Shelf contains a collection of books with a theme.
type Shelf struct { // The resource name of the shelf. // Shelf names have the form `shelves/{shelf_id}`. // The name is ignored when creating a shelf. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The theme of the shelf Theme string `protobuf:"bytes,2,opt,name=theme,proto3" json:"theme,omitempty"` // contains filtered or unexported fields }
func (*Shelf) Descriptor() ([]byte, []int)
Deprecated: Use Shelf.ProtoReflect.Descriptor instead.
func (x *Shelf) GetName() string
func (x *Shelf) GetTheme() string
func (*Shelf) ProtoMessage()
func (x *Shelf) ProtoReflect() protoreflect.Message
func (x *Shelf) Reset()
func (x *Shelf) String() string
UnimplementedLibraryServiceServer can be embedded to have forward compatible implementations.
type UnimplementedLibraryServiceServer struct { }
func (*UnimplementedLibraryServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error)
func (*UnimplementedLibraryServiceServer) CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error)
func (*UnimplementedLibraryServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error)
func (*UnimplementedLibraryServiceServer) DeleteShelf(context.Context, *DeleteShelfRequest) (*emptypb.Empty, error)
func (*UnimplementedLibraryServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
func (*UnimplementedLibraryServiceServer) GetShelf(context.Context, *GetShelfRequest) (*Shelf, error)
func (*UnimplementedLibraryServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
func (*UnimplementedLibraryServiceServer) ListShelves(context.Context, *ListShelvesRequest) (*ListShelvesResponse, error)
func (*UnimplementedLibraryServiceServer) MergeShelves(context.Context, *MergeShelvesRequest) (*Shelf, error)
func (*UnimplementedLibraryServiceServer) MoveBook(context.Context, *MoveBookRequest) (*Book, error)
func (*UnimplementedLibraryServiceServer) UpdateBook(context.Context, *UpdateBookRequest) (*Book, error)
Request message for LibraryService.UpdateBook.
type UpdateBookRequest struct { // The name of the book to update. Book *Book `protobuf:"bytes,1,opt,name=book,proto3" json:"book,omitempty"` // Required. Mask of fields to update. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*UpdateBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateBookRequest.ProtoReflect.Descriptor instead.
func (x *UpdateBookRequest) GetBook() *Book
func (x *UpdateBookRequest) GetUpdateMask() *fieldmaskpb.FieldMask
func (*UpdateBookRequest) ProtoMessage()
func (x *UpdateBookRequest) ProtoReflect() protoreflect.Message
func (x *UpdateBookRequest) Reset()
func (x *UpdateBookRequest) String() string