Documentation ¶
Overview ¶
Package library is a generated protocol buffer package.
Package library exposes a list of books over a gRPC API.
It is generated from these files:
proto/library/book_service.proto
It has these top-level messages:
Publisher Book GetBookRequest QueryBooksRequest Collection BookMessage BookResponse
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() *google_protobuf.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 (*Book) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type BookMessage
- func (*BookMessage) Descriptor() ([]byte, []int)
- func (m *BookMessage) GetContent() isBookMessage_Content
- func (m *BookMessage) GetMessage() string
- func (m *BookMessage) GetName() string
- func (*BookMessage) ProtoMessage()
- func (m *BookMessage) Reset()
- func (m *BookMessage) String() string
- func (*BookMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type BookMessage_Message
- type BookMessage_Name
- type BookResponse
- type BookServiceClient
- type BookServiceServer
- type BookService_BookChatClient
- type BookService_BookChatServer
- type BookService_MakeCollectionClient
- type BookService_MakeCollectionServer
- type BookService_QueryBooksClient
- type BookService_QueryBooksServer
- type BookType
- type Book_Publisher
- type Book_SelfPublished
- type Collection
- type GetBookRequest
- type Publisher
- type QueryBooksRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var BookType_name = map[int32]string{
0: "HARDCOVER",
1: "PAPERBACK",
2: "AUDIOBOOK",
}
View Source
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" json:"isbn,omitempty"` // Title is the title of the book. Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` // Author is the author of the book. Author string `protobuf:"bytes,3,opt,name=author" json:"author,omitempty"` // BookType is the type of the book. BookType BookType `protobuf:"varint,4,opt,name=book_type,json=bookType,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 *google_protobuf.Timestamp `protobuf:"bytes,7,opt,name=publication_date,json=publicationDate" json:"publication_date,omitempty"` }
Book represents a book in the library.
func (*Book) Descriptor ¶
func (*Book) GetBookType ¶
func (*Book) GetPublicationDate ¶
func (m *Book) GetPublicationDate() *google_protobuf.Timestamp
func (*Book) GetPublisher ¶
func (*Book) GetPublishingMethod ¶
func (m *Book) GetPublishingMethod() isBook_PublishingMethod
func (*Book) GetSelfPublished ¶
func (*Book) ProtoMessage ¶
func (*Book) ProtoMessage()
type BookMessage ¶
type BookMessage struct { // Types that are valid to be assigned to Content: // *BookMessage_Name // *BookMessage_Message Content isBookMessage_Content `protobuf_oneof:"content"` }
BookMessage is used to discuss books
func (*BookMessage) Descriptor ¶
func (*BookMessage) Descriptor() ([]byte, []int)
func (*BookMessage) GetContent ¶
func (m *BookMessage) GetContent() isBookMessage_Content
func (*BookMessage) GetMessage ¶
func (m *BookMessage) GetMessage() string
func (*BookMessage) GetName ¶
func (m *BookMessage) GetName() string
func (*BookMessage) ProtoMessage ¶
func (*BookMessage) ProtoMessage()
func (*BookMessage) Reset ¶
func (m *BookMessage) Reset()
func (*BookMessage) String ¶
func (m *BookMessage) String() string
func (*BookMessage) XXX_OneofFuncs ¶
func (*BookMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
type BookMessage_Message ¶
type BookMessage_Message struct {
Message string `protobuf:"bytes,2,opt,name=message,oneof"`
}
type BookMessage_Name ¶
type BookMessage_Name struct {
Name string `protobuf:"bytes,1,opt,name=name,oneof"`
}
type BookResponse ¶
type BookResponse struct { // Message is a message from a user. Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` }
BookResponse is used to discuss books
func (*BookResponse) Descriptor ¶
func (*BookResponse) Descriptor() ([]byte, []int)
func (*BookResponse) GetMessage ¶
func (m *BookResponse) GetMessage() string
func (*BookResponse) ProtoMessage ¶
func (*BookResponse) ProtoMessage()
func (*BookResponse) Reset ¶
func (m *BookResponse) Reset()
func (*BookResponse) String ¶
func (m *BookResponse) String() string
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) // MakeCollection takes a stream of books and returns a Book collection. MakeCollection(ctx context.Context, opts ...grpc.CallOption) (BookService_MakeCollectionClient, error) // BookChat allows discussion about books BookChat(ctx context.Context, opts ...grpc.CallOption) (BookService_BookChatClient, error) }
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 // MakeCollection takes a stream of books and returns a Book collection. MakeCollection(BookService_MakeCollectionServer) error // BookChat allows discussion about books BookChat(BookService_BookChatServer) error }
type BookService_BookChatClient ¶
type BookService_BookChatClient interface { Send(*BookMessage) error Recv() (*BookResponse, error) grpc.ClientStream }
type BookService_BookChatServer ¶
type BookService_BookChatServer interface { Send(*BookResponse) error Recv() (*BookMessage, error) grpc.ServerStream }
type BookService_MakeCollectionClient ¶
type BookService_MakeCollectionClient interface { Send(*Book) error CloseAndRecv() (*Collection, error) grpc.ClientStream }
type BookService_MakeCollectionServer ¶
type BookService_MakeCollectionServer interface { SendAndClose(*Collection) error Recv() (*Book, error) grpc.ServerStream }
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,oneof"`
}
type Book_SelfPublished ¶
type Book_SelfPublished struct {
SelfPublished bool `protobuf:"varint,5,opt,name=self_published,json=selfPublished,oneof"`
}
type Collection ¶
type Collection struct { // Books is a list of books Books []*Book `protobuf:"bytes,1,rep,name=books" json:"books,omitempty"` }
Collection is a collection of books
func (*Collection) Descriptor ¶
func (*Collection) Descriptor() ([]byte, []int)
func (*Collection) GetBooks ¶
func (m *Collection) GetBooks() []*Book
func (*Collection) ProtoMessage ¶
func (*Collection) ProtoMessage()
func (*Collection) Reset ¶
func (m *Collection) Reset()
func (*Collection) String ¶
func (m *Collection) String() string
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" json:"isbn,omitempty"` }
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
type Publisher ¶
type Publisher struct { // Name is the name of the Publisher. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` }
Publisher describes a Book Publisher.
func (*Publisher) Descriptor ¶
func (*Publisher) ProtoMessage ¶
func (*Publisher) ProtoMessage()
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" json:"author_prefix,omitempty"` }
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
Click to show internal directories.
Click to hide internal directories.