Documentation ¶
Overview ¶
Package example is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterLibraryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLibraryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LibraryServiceClient) error
- func RegisterLibraryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLibraryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LibraryServiceServer) error
- func RegisterLibraryServiceServer(s grpc.ServiceRegistrar, srv LibraryServiceServer)
- type Book
- func (*Book) Descriptor() ([]byte, []int)deprecated
- func (x *Book) GetAuthor() string
- func (x *Book) GetCreateTime() *timestamppb.Timestamp
- func (x *Book) GetName() string
- func (x *Book) GetRead() bool
- func (x *Book) GetTitle() string
- func (x *Book) GetUpdateTime() *timestamppb.Timestamp
- func (*Book) ProtoMessage()
- func (x *Book) ProtoReflect() protoreflect.Message
- func (x *Book) Reset()
- func (x *Book) String() string
- type CreateBookRequest
- func (*CreateBookRequest) Descriptor() ([]byte, []int)deprecated
- 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
- 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
- type DeleteShelfRequest
- func (*DeleteShelfRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteShelfRequest) GetName() string
- func (*DeleteShelfRequest) ProtoMessage()
- func (x *DeleteShelfRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteShelfRequest) Reset()
- func (x *DeleteShelfRequest) String() string
- type GetBookRequest
- type GetShelfRequest
- type LibraryServiceClient
- type LibraryServiceServer
- type ListBooksRequest
- func (*ListBooksRequest) Descriptor() ([]byte, []int)deprecated
- 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
- type ListBooksResponse
- func (*ListBooksResponse) Descriptor() ([]byte, []int)deprecated
- 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
- type ListShelvesRequest
- func (*ListShelvesRequest) Descriptor() ([]byte, []int)deprecated
- 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
- type ListShelvesResponse
- func (*ListShelvesResponse) Descriptor() ([]byte, []int)deprecated
- 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
- type MergeShelvesRequest
- func (*MergeShelvesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *MergeShelvesRequest) GetName() string
- func (x *MergeShelvesRequest) GetOtherShelfName() string
- func (*MergeShelvesRequest) ProtoMessage()
- func (x *MergeShelvesRequest) ProtoReflect() protoreflect.Message
- func (x *MergeShelvesRequest) Reset()
- func (x *MergeShelvesRequest) String() string
- type MoveBookRequest
- func (*MoveBookRequest) Descriptor() ([]byte, []int)deprecated
- 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
- type Shelf
- func (*Shelf) Descriptor() ([]byte, []int)deprecated
- func (x *Shelf) GetCreateTime() *timestamppb.Timestamp
- func (x *Shelf) GetName() string
- func (x *Shelf) GetTheme() string
- func (x *Shelf) GetUpdateTime() *timestamppb.Timestamp
- func (*Shelf) ProtoMessage()
- func (x *Shelf) ProtoReflect() protoreflect.Message
- func (x *Shelf) Reset()
- func (x *Shelf) String() string
- type UnimplementedLibraryServiceServer
- 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)
- type UnsafeLibraryServiceServer
- type UpdateBookRequest
- func (*UpdateBookRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateBookRequest) GetBook() *Book
- func (x *UpdateBookRequest) GetName() string
- func (*UpdateBookRequest) ProtoMessage()
- func (x *UpdateBookRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateBookRequest) Reset()
- func (x *UpdateBookRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var File_example_proto protoreflect.FileDescriptor
Functions ¶
func RegisterLibraryServiceHandler ¶
func RegisterLibraryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLibraryServiceHandler registers the http handlers for service LibraryService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLibraryServiceHandlerClient ¶
func RegisterLibraryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LibraryServiceClient) error
RegisterLibraryServiceHandlerClient registers the http handlers for service LibraryService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LibraryServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LibraryServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LibraryServiceClient" to call the correct interceptors.
func RegisterLibraryServiceHandlerFromEndpoint ¶
func RegisterLibraryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLibraryServiceHandlerFromEndpoint is same as RegisterLibraryServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLibraryServiceHandlerServer ¶
func RegisterLibraryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LibraryServiceServer) error
RegisterLibraryServiceHandlerServer registers the http handlers for service LibraryService to "mux". UnaryRPC :call LibraryServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLibraryServiceHandlerFromEndpoint instead.
func RegisterLibraryServiceServer ¶
func RegisterLibraryServiceServer(s grpc.ServiceRegistrar, srv LibraryServiceServer)
Types ¶
type Book ¶
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"` // Creation timestamp. CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // Last update timestamp. UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` // contains filtered or unexported fields }
A single book in the library.
func (*Book) Descriptor
deprecated
func (*Book) GetCreateTime ¶
func (x *Book) GetCreateTime() *timestamppb.Timestamp
func (*Book) GetUpdateTime ¶
func (x *Book) GetUpdateTime() *timestamppb.Timestamp
func (*Book) ProtoMessage ¶
func (*Book) ProtoMessage()
func (*Book) ProtoReflect ¶
func (x *Book) ProtoReflect() protoreflect.Message
type CreateBookRequest ¶
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 }
Request message for LibraryService.CreateBook.
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) GetParent ¶
func (x *CreateBookRequest) GetParent() string
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 to create. Shelf *Shelf `protobuf:"bytes,1,opt,name=shelf,proto3" json:"shelf,omitempty"` // contains filtered or unexported fields }
Request message for LibraryService.CreateShelf.
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 name of the book to delete. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
Request message for LibraryService.DeleteBook.
func (*DeleteBookRequest) Descriptor
deprecated
func (*DeleteBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteBookRequest.ProtoReflect.Descriptor instead.
func (*DeleteBookRequest) GetName ¶
func (x *DeleteBookRequest) GetName() string
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 name of the shelf to delete. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
Request message for LibraryService.DeleteShelf.
func (*DeleteShelfRequest) Descriptor
deprecated
func (*DeleteShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteShelfRequest.ProtoReflect.Descriptor instead.
func (*DeleteShelfRequest) GetName ¶
func (x *DeleteShelfRequest) GetName() string
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 name of the book to retrieve. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
Request message for LibraryService.GetBook.
func (*GetBookRequest) Descriptor
deprecated
func (*GetBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBookRequest.ProtoReflect.Descriptor instead.
func (*GetBookRequest) GetName ¶
func (x *GetBookRequest) GetName() 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 GetShelfRequest ¶
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 }
Request message for LibraryService.GetShelf.
func (*GetShelfRequest) Descriptor
deprecated
func (*GetShelfRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetShelfRequest.ProtoReflect.Descriptor instead.
func (*GetShelfRequest) GetName ¶
func (x *GetShelfRequest) GetName() string
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 LibraryServiceClient ¶
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) }
LibraryServiceClient is the client API for LibraryService 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 NewLibraryServiceClient ¶
func NewLibraryServiceClient(cc grpc.ClientConnInterface) LibraryServiceClient
type LibraryServiceServer ¶
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) }
LibraryServiceServer is the server API for LibraryService service. All implementations should embed UnimplementedLibraryServiceServer for forward compatibility
type ListBooksRequest ¶
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 }
Request message for LibraryService.ListBooks.
func (*ListBooksRequest) Descriptor
deprecated
func (*ListBooksRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListBooksRequest.ProtoReflect.Descriptor instead.
func (*ListBooksRequest) GetPageSize ¶
func (x *ListBooksRequest) GetPageSize() int32
func (*ListBooksRequest) GetPageToken ¶
func (x *ListBooksRequest) GetPageToken() string
func (*ListBooksRequest) GetParent ¶
func (x *ListBooksRequest) GetParent() string
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 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 }
Response message for LibraryService.ListBooks.
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) GetNextPageToken ¶
func (x *ListBooksResponse) GetNextPageToken() string
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 ListShelvesRequest ¶
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 }
Request message for LibraryService.ListShelves.
func (*ListShelvesRequest) Descriptor
deprecated
func (*ListShelvesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListShelvesRequest.ProtoReflect.Descriptor instead.
func (*ListShelvesRequest) GetPageSize ¶
func (x *ListShelvesRequest) GetPageSize() int32
func (*ListShelvesRequest) GetPageToken ¶
func (x *ListShelvesRequest) GetPageToken() string
func (*ListShelvesRequest) ProtoMessage ¶
func (*ListShelvesRequest) ProtoMessage()
func (*ListShelvesRequest) ProtoReflect ¶
func (x *ListShelvesRequest) ProtoReflect() protoreflect.Message
func (*ListShelvesRequest) Reset ¶
func (x *ListShelvesRequest) Reset()
func (*ListShelvesRequest) String ¶
func (x *ListShelvesRequest) String() string
type ListShelvesResponse ¶
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 }
Response message for LibraryService.ListShelves.
func (*ListShelvesResponse) Descriptor
deprecated
func (*ListShelvesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListShelvesResponse.ProtoReflect.Descriptor instead.
func (*ListShelvesResponse) GetNextPageToken ¶
func (x *ListShelvesResponse) GetNextPageToken() string
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 MergeShelvesRequest ¶
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. OtherShelfName string `protobuf:"bytes,2,opt,name=other_shelf_name,json=otherShelfName,proto3" json:"other_shelf_name,omitempty"` // contains filtered or unexported fields }
Describes the shelf being removed (other_shelf_name) and updated (name) in this merge.
func (*MergeShelvesRequest) Descriptor
deprecated
func (*MergeShelvesRequest) Descriptor() ([]byte, []int)
Deprecated: Use MergeShelvesRequest.ProtoReflect.Descriptor instead.
func (*MergeShelvesRequest) GetName ¶
func (x *MergeShelvesRequest) GetName() string
func (*MergeShelvesRequest) GetOtherShelfName ¶
func (x *MergeShelvesRequest) GetOtherShelfName() string
func (*MergeShelvesRequest) ProtoMessage ¶
func (*MergeShelvesRequest) ProtoMessage()
func (*MergeShelvesRequest) ProtoReflect ¶
func (x *MergeShelvesRequest) ProtoReflect() protoreflect.Message
func (*MergeShelvesRequest) Reset ¶
func (x *MergeShelvesRequest) Reset()
func (*MergeShelvesRequest) String ¶
func (x *MergeShelvesRequest) String() string
type MoveBookRequest ¶
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 }
Describes what book to move (name) and what shelf we're moving it to (other_shelf_name).
func (*MoveBookRequest) Descriptor
deprecated
func (*MoveBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use MoveBookRequest.ProtoReflect.Descriptor instead.
func (*MoveBookRequest) GetName ¶
func (x *MoveBookRequest) GetName() string
func (*MoveBookRequest) GetOtherShelfName ¶
func (x *MoveBookRequest) GetOtherShelfName() string
func (*MoveBookRequest) ProtoMessage ¶
func (*MoveBookRequest) ProtoMessage()
func (*MoveBookRequest) ProtoReflect ¶
func (x *MoveBookRequest) ProtoReflect() protoreflect.Message
func (*MoveBookRequest) Reset ¶
func (x *MoveBookRequest) Reset()
func (*MoveBookRequest) String ¶
func (x *MoveBookRequest) String() string
type Shelf ¶
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"` // Creation timestamp. CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // Last update timestamp. UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` // contains filtered or unexported fields }
A Shelf contains a collection of books with a theme.
func (*Shelf) Descriptor
deprecated
func (*Shelf) GetCreateTime ¶
func (x *Shelf) GetCreateTime() *timestamppb.Timestamp
func (*Shelf) GetUpdateTime ¶
func (x *Shelf) GetUpdateTime() *timestamppb.Timestamp
func (*Shelf) ProtoMessage ¶
func (*Shelf) ProtoMessage()
func (*Shelf) ProtoReflect ¶
func (x *Shelf) ProtoReflect() protoreflect.Message
type UnimplementedLibraryServiceServer ¶
type UnimplementedLibraryServiceServer struct { }
UnimplementedLibraryServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedLibraryServiceServer) CreateBook ¶
func (UnimplementedLibraryServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error)
func (UnimplementedLibraryServiceServer) CreateShelf ¶
func (UnimplementedLibraryServiceServer) CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error)
func (UnimplementedLibraryServiceServer) DeleteBook ¶
func (UnimplementedLibraryServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error)
func (UnimplementedLibraryServiceServer) DeleteShelf ¶
func (UnimplementedLibraryServiceServer) DeleteShelf(context.Context, *DeleteShelfRequest) (*emptypb.Empty, error)
func (UnimplementedLibraryServiceServer) GetBook ¶
func (UnimplementedLibraryServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
func (UnimplementedLibraryServiceServer) GetShelf ¶
func (UnimplementedLibraryServiceServer) GetShelf(context.Context, *GetShelfRequest) (*Shelf, error)
func (UnimplementedLibraryServiceServer) ListBooks ¶
func (UnimplementedLibraryServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
func (UnimplementedLibraryServiceServer) ListShelves ¶
func (UnimplementedLibraryServiceServer) ListShelves(context.Context, *ListShelvesRequest) (*ListShelvesResponse, error)
func (UnimplementedLibraryServiceServer) MergeShelves ¶
func (UnimplementedLibraryServiceServer) MergeShelves(context.Context, *MergeShelvesRequest) (*Shelf, error)
func (UnimplementedLibraryServiceServer) MoveBook ¶
func (UnimplementedLibraryServiceServer) MoveBook(context.Context, *MoveBookRequest) (*Book, error)
func (UnimplementedLibraryServiceServer) UpdateBook ¶
func (UnimplementedLibraryServiceServer) UpdateBook(context.Context, *UpdateBookRequest) (*Book, error)
type UnsafeLibraryServiceServer ¶
type UnsafeLibraryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeLibraryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LibraryServiceServer will result in compilation errors.
type UpdateBookRequest ¶
type UpdateBookRequest struct { // The name of the book to update. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The book to update with. The name must match or be empty. Book *Book `protobuf:"bytes,2,opt,name=book,proto3" json:"book,omitempty"` // contains filtered or unexported fields }
Request message for LibraryService.UpdateBook.
func (*UpdateBookRequest) Descriptor
deprecated
func (*UpdateBookRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateBookRequest.ProtoReflect.Descriptor instead.
func (*UpdateBookRequest) GetBook ¶
func (x *UpdateBookRequest) GetBook() *Book
func (*UpdateBookRequest) GetName ¶
func (x *UpdateBookRequest) GetName() string
func (*UpdateBookRequest) ProtoMessage ¶
func (*UpdateBookRequest) ProtoMessage()
func (*UpdateBookRequest) ProtoReflect ¶
func (x *UpdateBookRequest) ProtoReflect() protoreflect.Message
func (*UpdateBookRequest) Reset ¶
func (x *UpdateBookRequest) Reset()
func (*UpdateBookRequest) String ¶
func (x *UpdateBookRequest) String() string