Documentation
¶
Index ¶
- Variables
- func RegisterBookServiceServer(s *grpc.Server, srv BookServiceServer)
- type Book
- func (*Book) Descriptor() ([]byte, []int)
- func (m *Book) GetAuthor() string
- func (m *Book) GetBookType() BookType
- func (m *Book) GetIsbn() int64
- func (m *Book) GetPublicationDate() *timestamp.Timestamp
- func (m *Book) GetPublisher() *Publisher
- func (m *Book) GetPublishingMethod() isBook_PublishingMethod
- func (m *Book) GetSelfPublished() bool
- func (m *Book) GetTitle() string
- func (*Book) ProtoMessage()
- func (m *Book) Reset()
- func (m *Book) String() string
- func (m *Book) XXX_DiscardUnknown()
- func (m *Book) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Book) XXX_Merge(src proto.Message)
- func (*Book) XXX_OneofWrappers() []interface{}
- func (m *Book) XXX_Size() int
- func (m *Book) XXX_Unmarshal(b []byte) error
- type BookServiceClient
- type BookServiceServer
- type BookService_QueryBooksClient
- type BookService_QueryBooksServer
- type BookType
- type Book_Publisher
- type Book_SelfPublished
- type GetBookRequest
- func (*GetBookRequest) Descriptor() ([]byte, []int)
- func (m *GetBookRequest) GetIsbn() int64
- func (*GetBookRequest) ProtoMessage()
- func (m *GetBookRequest) Reset()
- func (m *GetBookRequest) String() string
- func (m *GetBookRequest) XXX_DiscardUnknown()
- func (m *GetBookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetBookRequest) XXX_Merge(src proto.Message)
- func (m *GetBookRequest) XXX_Size() int
- func (m *GetBookRequest) XXX_Unmarshal(b []byte) error
- type Publisher
- func (*Publisher) Descriptor() ([]byte, []int)
- func (m *Publisher) GetName() string
- func (*Publisher) ProtoMessage()
- func (m *Publisher) Reset()
- func (m *Publisher) String() string
- func (m *Publisher) XXX_DiscardUnknown()
- func (m *Publisher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Publisher) XXX_Merge(src proto.Message)
- func (m *Publisher) XXX_Size() int
- func (m *Publisher) XXX_Unmarshal(b []byte) error
- type QueryBooksRequest
- func (*QueryBooksRequest) Descriptor() ([]byte, []int)
- func (m *QueryBooksRequest) GetAuthorPrefix() string
- func (*QueryBooksRequest) ProtoMessage()
- func (m *QueryBooksRequest) Reset()
- func (m *QueryBooksRequest) String() string
- func (m *QueryBooksRequest) XXX_DiscardUnknown()
- func (m *QueryBooksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryBooksRequest) XXX_Merge(src proto.Message)
- func (m *QueryBooksRequest) XXX_Size() int
- func (m *QueryBooksRequest) XXX_Unmarshal(b []byte) error
- type UnimplementedBookServiceServer
Constants ¶
This section is empty.
Variables ¶
var BookType_name = map[int32]string{
0: "HARDCOVER",
1: "PAPERBACK",
2: "AUDIOBOOK",
}
var BookType_value = map[string]int32{
"HARDCOVER": 0,
"PAPERBACK": 1,
"AUDIOBOOK": 2,
}
Functions ¶
func RegisterBookServiceServer ¶
func RegisterBookServiceServer(s *grpc.Server, srv BookServiceServer)
Types ¶
type Book ¶
type Book struct { // Isbn is the ISBN number of the book. Isbn int64 `protobuf:"varint,1,opt,name=isbn,proto3" json:"isbn,omitempty"` // Title is the title of the book. Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` // Author is the author of the book. Author string `protobuf:"bytes,3,opt,name=author,proto3" json:"author,omitempty"` // BookType is the type of the book. BookType BookType `protobuf:"varint,4,opt,name=book_type,json=bookType,proto3,enum=library.BookType" json:"book_type,omitempty"` // PublishingMethod is the publishing method // used for this Book. // // Types that are valid to be assigned to PublishingMethod: // *Book_SelfPublished // *Book_Publisher PublishingMethod isBook_PublishingMethod `protobuf_oneof:"publishing_method"` // PublicationDate is the time of publication of the book. PublicationDate *timestamp.Timestamp `protobuf:"bytes,7,opt,name=publication_date,json=publicationDate,proto3" json:"publication_date,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Book represents a book in the library.
func (*Book) Descriptor ¶
func (*Book) GetBookType ¶
func (*Book) GetPublicationDate ¶
func (*Book) GetPublisher ¶
func (*Book) GetPublishingMethod ¶
func (m *Book) GetPublishingMethod() isBook_PublishingMethod
func (*Book) GetSelfPublished ¶
func (*Book) ProtoMessage ¶
func (*Book) ProtoMessage()
func (*Book) XXX_DiscardUnknown ¶
func (m *Book) XXX_DiscardUnknown()
func (*Book) XXX_OneofWrappers ¶
func (*Book) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Book) XXX_Unmarshal ¶
type BookServiceClient ¶
type BookServiceClient interface { // GetBook returns a Book from the library // that matches the ISBN provided, if found. // Otherwise it returns a NotFound error. GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error) // QueryBooks returns all Books whos author // matches the author prefix provided, as a stream // of Books. QueryBooks(ctx context.Context, in *QueryBooksRequest, opts ...grpc.CallOption) (BookService_QueryBooksClient, error) }
BookServiceClient is the client API for BookService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBookServiceClient ¶
func NewBookServiceClient(cc *grpc.ClientConn) BookServiceClient
type BookServiceServer ¶
type BookServiceServer interface { // GetBook returns a Book from the library // that matches the ISBN provided, if found. // Otherwise it returns a NotFound error. GetBook(context.Context, *GetBookRequest) (*Book, error) // QueryBooks returns all Books whos author // matches the author prefix provided, as a stream // of Books. QueryBooks(*QueryBooksRequest, BookService_QueryBooksServer) error }
BookServiceServer is the server API for BookService service.
type BookService_QueryBooksClient ¶
type BookService_QueryBooksClient interface { Recv() (*Book, error) grpc.ClientStream }
type BookService_QueryBooksServer ¶
type BookService_QueryBooksServer interface { Send(*Book) error grpc.ServerStream }
type BookType ¶
type BookType int32
BookType describes the different types a book in the library can be.
func (BookType) EnumDescriptor ¶
type Book_Publisher ¶
type Book_Publisher struct {
Publisher *Publisher `protobuf:"bytes,6,opt,name=publisher,proto3,oneof"`
}
type Book_SelfPublished ¶
type Book_SelfPublished struct {
SelfPublished bool `protobuf:"varint,5,opt,name=self_published,json=selfPublished,proto3,oneof"`
}
type GetBookRequest ¶
type GetBookRequest struct { // Isbn is the ISBN with which // to match against the ISBN of a book in the library. Isbn int64 `protobuf:"varint,1,opt,name=isbn,proto3" json:"isbn,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
GetBookRequest is the input to the GetBook method.
func (*GetBookRequest) Descriptor ¶
func (*GetBookRequest) Descriptor() ([]byte, []int)
func (*GetBookRequest) GetIsbn ¶
func (m *GetBookRequest) GetIsbn() int64
func (*GetBookRequest) ProtoMessage ¶
func (*GetBookRequest) ProtoMessage()
func (*GetBookRequest) Reset ¶
func (m *GetBookRequest) Reset()
func (*GetBookRequest) String ¶
func (m *GetBookRequest) String() string
func (*GetBookRequest) XXX_DiscardUnknown ¶
func (m *GetBookRequest) XXX_DiscardUnknown()
func (*GetBookRequest) XXX_Marshal ¶
func (m *GetBookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetBookRequest) XXX_Merge ¶
func (m *GetBookRequest) XXX_Merge(src proto.Message)
func (*GetBookRequest) XXX_Size ¶
func (m *GetBookRequest) XXX_Size() int
func (*GetBookRequest) XXX_Unmarshal ¶
func (m *GetBookRequest) XXX_Unmarshal(b []byte) error
type Publisher ¶
type Publisher struct { // Name is the name of the Publisher. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Publisher describes a Book Publisher.
func (*Publisher) Descriptor ¶
func (*Publisher) ProtoMessage ¶
func (*Publisher) ProtoMessage()
func (*Publisher) XXX_DiscardUnknown ¶
func (m *Publisher) XXX_DiscardUnknown()
func (*Publisher) XXX_Marshal ¶
func (*Publisher) XXX_Unmarshal ¶
type QueryBooksRequest ¶
type QueryBooksRequest struct { // AuthorPrefix is the prefix with which // to match against the author of a book in the library. AuthorPrefix string `protobuf:"bytes,1,opt,name=author_prefix,json=authorPrefix,proto3" json:"author_prefix,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
QueryBooksRequest is the input to the QueryBooks method.
func (*QueryBooksRequest) Descriptor ¶
func (*QueryBooksRequest) Descriptor() ([]byte, []int)
func (*QueryBooksRequest) GetAuthorPrefix ¶
func (m *QueryBooksRequest) GetAuthorPrefix() string
func (*QueryBooksRequest) ProtoMessage ¶
func (*QueryBooksRequest) ProtoMessage()
func (*QueryBooksRequest) Reset ¶
func (m *QueryBooksRequest) Reset()
func (*QueryBooksRequest) String ¶
func (m *QueryBooksRequest) String() string
func (*QueryBooksRequest) XXX_DiscardUnknown ¶
func (m *QueryBooksRequest) XXX_DiscardUnknown()
func (*QueryBooksRequest) XXX_Marshal ¶
func (m *QueryBooksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryBooksRequest) XXX_Merge ¶
func (m *QueryBooksRequest) XXX_Merge(src proto.Message)
func (*QueryBooksRequest) XXX_Size ¶
func (m *QueryBooksRequest) XXX_Size() int
func (*QueryBooksRequest) XXX_Unmarshal ¶
func (m *QueryBooksRequest) XXX_Unmarshal(b []byte) error
type UnimplementedBookServiceServer ¶
type UnimplementedBookServiceServer struct { }
UnimplementedBookServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedBookServiceServer) GetBook ¶
func (*UnimplementedBookServiceServer) GetBook(ctx context.Context, req *GetBookRequest) (*Book, error)
func (*UnimplementedBookServiceServer) QueryBooks ¶
func (*UnimplementedBookServiceServer) QueryBooks(req *QueryBooksRequest, srv BookService_QueryBooksServer) error