Documentation ¶
Index ¶
- Variables
- func RegisterBookServiceServer(s grpc.ServiceRegistrar, srv BookServiceServer)
- type Book
- func (*Book) Descriptor() ([]byte, []int)deprecated
- func (x *Book) GetCreateTime() *timestamppb.Timestamp
- func (x *Book) GetDisplayName() string
- func (x *Book) GetName() string
- func (x *Book) GetUid() 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 BookServiceClient
- type BookServiceServer
- type CreateBookRequest
- func (*CreateBookRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateBookRequest) GetBook() *Book
- func (x *CreateBookRequest) GetParent() string
- func (x *CreateBookRequest) GetUid() string
- func (*CreateBookRequest) ProtoMessage()
- func (x *CreateBookRequest) ProtoReflect() protoreflect.Message
- func (x *CreateBookRequest) Reset()
- func (x *CreateBookRequest) String() string
- type DeleteBookRequest
- type GetBookRequest
- type ListBooksRequest
- func (*ListBooksRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListBooksRequest) GetFilter() string
- func (x *ListBooksRequest) GetOrderBy() string
- 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 UnimplementedBookServiceServer
- func (UnimplementedBookServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error)
- func (UnimplementedBookServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error)
- func (UnimplementedBookServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
- func (UnimplementedBookServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
- func (UnimplementedBookServiceServer) UpdateBook(context.Context, *UpdateBookRequest) (*Book, error)
- type UnsafeBookServiceServer
- type UpdateBookRequest
- func (*UpdateBookRequest) Descriptor() ([]byte, []int)deprecated
- 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
Constants ¶
This section is empty.
Variables ¶
var BookService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "acme.book.v1.BookService", HandlerType: (*BookServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListBooks", Handler: _BookService_ListBooks_Handler, }, { MethodName: "GetBook", Handler: _BookService_GetBook_Handler, }, { MethodName: "CreateBook", Handler: _BookService_CreateBook_Handler, }, { MethodName: "UpdateBook", Handler: _BookService_UpdateBook_Handler, }, { MethodName: "DeleteBook", Handler: _BookService_DeleteBook_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "acme/book/v1/service.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_acme_book_v1_request_response_proto protoreflect.FileDescriptor
var File_acme_book_v1_resource_proto protoreflect.FileDescriptor
var File_acme_book_v1_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBookServiceServer ¶
func RegisterBookServiceServer(s grpc.ServiceRegistrar, srv BookServiceServer)
Types ¶
type Book ¶
type Book struct { // The mult-segment resource name. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The unique book id. Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // Indicates when the book was created. CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // Indicates when the book was last updated. UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` // The display name for the book. DisplayName string `protobuf:"bytes,5,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // contains filtered or unexported fields }
The default Book resource representation.
func (*Book) Descriptor
deprecated
func (*Book) GetCreateTime ¶
func (x *Book) GetCreateTime() *timestamppb.Timestamp
func (*Book) GetDisplayName ¶
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 BookServiceClient ¶
type BookServiceClient interface { // ListBooks retrieves a list of books from the server. ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error) // GetBook retrieves a single book from the server. GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error) // CreateBook creates a new book resource on the server. CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error) // UpdateBook updates the book resource on the server. UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error) // DeleteBook deletes the book resource from the server. DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*emptypb.Empty, 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 { // ListBooks retrieves a list of books from the server. ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error) // GetBook retrieves a single book from the server. GetBook(context.Context, *GetBookRequest) (*Book, error) // CreateBook creates a new book resource on the server. CreateBook(context.Context, *CreateBookRequest) (*Book, error) // UpdateBook updates the book resource on the server. UpdateBook(context.Context, *UpdateBookRequest) (*Book, error) // DeleteBook deletes the book resource from the server. DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error) }
BookServiceServer is the server API for BookService service. All implementations should embed UnimplementedBookServiceServer for forward compatibility
type CreateBookRequest ¶
type CreateBookRequest struct { // The parent resource name where the book is to be created, for example, "shelves/shelf1", or empty. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // The unique id to use for this book, or empty. Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // The book resource to create. Book *Book `protobuf:"bytes,3,opt,name=book,proto3" json:"book,omitempty"` // contains filtered or unexported fields }
The standard Create request definition.
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) GetUid ¶
func (x *CreateBookRequest) GetUid() 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 DeleteBookRequest ¶
type DeleteBookRequest struct { // The multi-segment resource name of the book to be deleted, for example, "shelves/shelf1/books/book2". Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
The standard Delete request definition.
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 GetBookRequest ¶
type GetBookRequest struct { // The multi-segment resource name of the requested book, for example, "shelves/shelf1/books/book2". Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
The standard Get request definition.
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 ListBooksRequest ¶
type ListBooksRequest struct { // The parent resource name, for example, "shelves/shelf1", or empty. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` // The maximum number of items to return. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // The next_page_token value returned from a previous List request, if any. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // The sort order for the items to return, or empty. See https://google.aip.dev/132#ordering. OrderBy string `protobuf:"bytes,4,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` // The filter for the items to return, or empty. See https://google.aip.dev/132#filtering. Filter string `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` // contains filtered or unexported fields }
The standard List request definition.
func (*ListBooksRequest) Descriptor
deprecated
func (*ListBooksRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListBooksRequest.ProtoReflect.Descriptor instead.
func (*ListBooksRequest) GetFilter ¶
func (x *ListBooksRequest) GetFilter() string
func (*ListBooksRequest) GetOrderBy ¶
func (x *ListBooksRequest) GetOrderBy() string
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 retrieved list of books. Books []*Book `protobuf:"bytes,1,rep,name=books,proto3" json:"books,omitempty"` // Token to retrieve the next page of results, or empty if there are no more results in the list. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
The standard List response definition.
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 UnimplementedBookServiceServer ¶
type UnimplementedBookServiceServer struct { }
UnimplementedBookServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedBookServiceServer) CreateBook ¶
func (UnimplementedBookServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error)
func (UnimplementedBookServiceServer) DeleteBook ¶
func (UnimplementedBookServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*emptypb.Empty, error)
func (UnimplementedBookServiceServer) GetBook ¶
func (UnimplementedBookServiceServer) GetBook(context.Context, *GetBookRequest) (*Book, error)
func (UnimplementedBookServiceServer) ListBooks ¶
func (UnimplementedBookServiceServer) ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, error)
func (UnimplementedBookServiceServer) UpdateBook ¶
func (UnimplementedBookServiceServer) UpdateBook(context.Context, *UpdateBookRequest) (*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.
type UpdateBookRequest ¶
type UpdateBookRequest struct { // The book resource which replaces the resource on the server. Book *Book `protobuf:"bytes,1,opt,name=book,proto3" json:"book,omitempty"` // The update mask applied to the resource. See https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
The standard Update request definition.
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) GetUpdateMask ¶
func (x *UpdateBookRequest) GetUpdateMask() *fieldmaskpb.FieldMask
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