bookstore

package
v0.0.0-...-e7b3836 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package bookstore is a generated protocol buffer package.

It is generated from these files:

protos/bookstore.proto

It has these top-level messages:

Shelf
Book
Author
ListShelvesResponse
CreateShelfRequest
GetShelfRequest
DeleteShelfRequest
ListBooksRequest
CreateBookRequest
GetBookRequest
UpdateBookRequest
DeleteBookRequest
GetAuthorRequest

Index

Constants

This section is empty.

Variables

View Source
var Author_Gender_name = map[int32]string{
	0: "UNKNOWN",
	1: "MALE",
	2: "FEMALE",
}
View Source
var Author_Gender_value = map[string]int32{
	"UNKNOWN": 0,
	"MALE":    1,
	"FEMALE":  2,
}

Functions

func RegisterBookstoreServer

func RegisterBookstoreServer(s *grpc.Server, srv BookstoreServer)

Types

type Author

type Author struct {
	// A unique author id.
	Id        int64         `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	Gender    Author_Gender `protobuf:"varint,2,opt,name=gender,enum=bookstore.Author_Gender" json:"gender,omitempty"`
	FirstName string        `protobuf:"bytes,3,opt,name=first_name,json=firstName" json:"first_name,omitempty"`
	LastName  string        `protobuf:"bytes,4,opt,name=last_name,json=lname" json:"last_name,omitempty"`
}

An author resource.

func (*Author) Descriptor

func (*Author) Descriptor() ([]byte, []int)

func (*Author) GetFirstName

func (m *Author) GetFirstName() string

func (*Author) GetGender

func (m *Author) GetGender() Author_Gender

func (*Author) GetId

func (m *Author) GetId() int64

func (*Author) GetLastName

func (m *Author) GetLastName() string

func (*Author) ProtoMessage

func (*Author) ProtoMessage()

func (*Author) Reset

func (m *Author) Reset()

func (*Author) String

func (m *Author) String() string

type Author_Gender

type Author_Gender int32
const (
	Author_UNKNOWN Author_Gender = 0
	Author_MALE    Author_Gender = 1
	Author_FEMALE  Author_Gender = 2
)

func (Author_Gender) EnumDescriptor

func (Author_Gender) EnumDescriptor() ([]byte, []int)

func (Author_Gender) String

func (x Author_Gender) String() string

type Book

type Book struct {
	// A unique book id.
	Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	// An author of the book.
	Author string `protobuf:"bytes,2,opt,name=author" json:"author,omitempty"`
	// A book title.
	Title string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"`
	// Quotes from the book.
	Quotes []string `protobuf:"bytes,4,rep,name=quotes" json:"quotes,omitempty"`
}

A book resource.

func (*Book) Descriptor

func (*Book) Descriptor() ([]byte, []int)

func (*Book) GetAuthor

func (m *Book) GetAuthor() string

func (*Book) GetId

func (m *Book) GetId() int64

func (*Book) GetQuotes

func (m *Book) GetQuotes() []string

func (*Book) GetTitle

func (m *Book) GetTitle() string

func (*Book) ProtoMessage

func (*Book) ProtoMessage()

func (*Book) Reset

func (m *Book) Reset()

func (*Book) String

func (m *Book) String() string

type BookstoreClient

type BookstoreClient interface {
	// Returns a list of all shelves in the bookstore.
	ListShelves(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*ListShelvesResponse, error)
	// Creates a new shelf in the bookstore.
	CreateShelf(ctx context.Context, in *CreateShelfRequest, opts ...grpc.CallOption) (*Shelf, error)
	// Creates multiple shelves with one streaming call
	BulkCreateShelf(ctx context.Context, opts ...grpc.CallOption) (Bookstore_BulkCreateShelfClient, error)
	// Returns a specific bookstore shelf.
	GetShelf(ctx context.Context, in *GetShelfRequest, opts ...grpc.CallOption) (*Shelf, error)
	// Deletes a shelf, including all books that are stored on the shelf.
	DeleteShelf(ctx context.Context, in *DeleteShelfRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
	// Returns a list of books on a shelf.
	ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (Bookstore_ListBooksClient, error)
	// Creates a new book.
	CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error)
	// Returns a specific book.
	GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error)
	// Deletes a book from a shelf.
	DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
	UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error)
	BookstoreOptions(ctx context.Context, in *GetShelfRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
	// Returns a specific author.
	GetAuthor(ctx context.Context, in *GetAuthorRequest, opts ...grpc.CallOption) (*Author, error)
}

func NewBookstoreClient

func NewBookstoreClient(cc *grpc.ClientConn) BookstoreClient

type BookstoreServer

type BookstoreServer interface {
	// Returns a list of all shelves in the bookstore.
	ListShelves(context.Context, *google_protobuf1.Empty) (*ListShelvesResponse, error)
	// Creates a new shelf in the bookstore.
	CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, error)
	// Creates multiple shelves with one streaming call
	BulkCreateShelf(Bookstore_BulkCreateShelfServer) error
	// Returns a specific bookstore shelf.
	GetShelf(context.Context, *GetShelfRequest) (*Shelf, error)
	// Deletes a shelf, including all books that are stored on the shelf.
	DeleteShelf(context.Context, *DeleteShelfRequest) (*google_protobuf1.Empty, error)
	// Returns a list of books on a shelf.
	ListBooks(*ListBooksRequest, Bookstore_ListBooksServer) error
	// Creates a new book.
	CreateBook(context.Context, *CreateBookRequest) (*Book, error)
	// Returns a specific book.
	GetBook(context.Context, *GetBookRequest) (*Book, error)
	// Deletes a book from a shelf.
	DeleteBook(context.Context, *DeleteBookRequest) (*google_protobuf1.Empty, error)
	UpdateBook(context.Context, *UpdateBookRequest) (*Book, error)
	BookstoreOptions(context.Context, *GetShelfRequest) (*google_protobuf1.Empty, error)
	// Returns a specific author.
	GetAuthor(context.Context, *GetAuthorRequest) (*Author, error)
}

type Bookstore_BulkCreateShelfClient

type Bookstore_BulkCreateShelfClient interface {
	Send(*CreateShelfRequest) error
	Recv() (*Shelf, error)
	grpc.ClientStream
}

type Bookstore_BulkCreateShelfServer

type Bookstore_BulkCreateShelfServer interface {
	Send(*Shelf) error
	Recv() (*CreateShelfRequest, error)
	grpc.ServerStream
}

type Bookstore_ListBooksClient

type Bookstore_ListBooksClient interface {
	Recv() (*Book, error)
	grpc.ClientStream
}

type Bookstore_ListBooksServer

type Bookstore_ListBooksServer interface {
	Send(*Book) error
	grpc.ServerStream
}

type CreateBookRequest

type CreateBookRequest struct {
	// The ID of the shelf on which to create a book.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
	// A book resource to create on the shelf.
	Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"`
}

Request message for CreateBook method.

func (*CreateBookRequest) Descriptor

func (*CreateBookRequest) Descriptor() ([]byte, []int)

func (*CreateBookRequest) GetBook

func (m *CreateBookRequest) GetBook() *Book

func (*CreateBookRequest) GetShelf

func (m *CreateBookRequest) GetShelf() int64

func (*CreateBookRequest) ProtoMessage

func (*CreateBookRequest) ProtoMessage()

func (*CreateBookRequest) Reset

func (m *CreateBookRequest) Reset()

func (*CreateBookRequest) String

func (m *CreateBookRequest) String() string

type CreateShelfRequest

type CreateShelfRequest struct {
	// The shelf resource to create.
	Shelf *Shelf `protobuf:"bytes,1,opt,name=shelf" json:"shelf,omitempty"`
}

Request message for CreateShelf method.

func (*CreateShelfRequest) Descriptor

func (*CreateShelfRequest) Descriptor() ([]byte, []int)

func (*CreateShelfRequest) GetShelf

func (m *CreateShelfRequest) GetShelf() *Shelf

func (*CreateShelfRequest) ProtoMessage

func (*CreateShelfRequest) ProtoMessage()

func (*CreateShelfRequest) Reset

func (m *CreateShelfRequest) Reset()

func (*CreateShelfRequest) String

func (m *CreateShelfRequest) String() string

type DeleteBookRequest

type DeleteBookRequest struct {
	// The ID of the shelf from which to delete a book.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
	// The ID of the book to delete.
	Book int64 `protobuf:"varint,2,opt,name=book" json:"book,omitempty"`
}

Request message for DeleteBook method.

func (*DeleteBookRequest) Descriptor

func (*DeleteBookRequest) Descriptor() ([]byte, []int)

func (*DeleteBookRequest) GetBook

func (m *DeleteBookRequest) GetBook() int64

func (*DeleteBookRequest) GetShelf

func (m *DeleteBookRequest) GetShelf() int64

func (*DeleteBookRequest) ProtoMessage

func (*DeleteBookRequest) ProtoMessage()

func (*DeleteBookRequest) Reset

func (m *DeleteBookRequest) Reset()

func (*DeleteBookRequest) String

func (m *DeleteBookRequest) String() string

type DeleteShelfRequest

type DeleteShelfRequest struct {
	// The ID of the shelf to delete.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
}

Request message for DeleteShelf method.

func (*DeleteShelfRequest) Descriptor

func (*DeleteShelfRequest) Descriptor() ([]byte, []int)

func (*DeleteShelfRequest) GetShelf

func (m *DeleteShelfRequest) GetShelf() int64

func (*DeleteShelfRequest) ProtoMessage

func (*DeleteShelfRequest) ProtoMessage()

func (*DeleteShelfRequest) Reset

func (m *DeleteShelfRequest) Reset()

func (*DeleteShelfRequest) String

func (m *DeleteShelfRequest) String() string

type GetAuthorRequest

type GetAuthorRequest struct {
	// The ID of the author resource to retrieve.
	Author int64 `protobuf:"varint,1,opt,name=author" json:"author,omitempty"`
}

Request message for GetAuthor method.

func (*GetAuthorRequest) Descriptor

func (*GetAuthorRequest) Descriptor() ([]byte, []int)

func (*GetAuthorRequest) GetAuthor

func (m *GetAuthorRequest) GetAuthor() int64

func (*GetAuthorRequest) ProtoMessage

func (*GetAuthorRequest) ProtoMessage()

func (*GetAuthorRequest) Reset

func (m *GetAuthorRequest) Reset()

func (*GetAuthorRequest) String

func (m *GetAuthorRequest) String() string

type GetBookRequest

type GetBookRequest struct {
	// The ID of the shelf from which to retrieve a book.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
	// The ID of the book to retrieve.
	Book int64 `protobuf:"varint,2,opt,name=book" json:"book,omitempty"`
}

Request message for GetBook method.

func (*GetBookRequest) Descriptor

func (*GetBookRequest) Descriptor() ([]byte, []int)

func (*GetBookRequest) GetBook

func (m *GetBookRequest) GetBook() int64

func (*GetBookRequest) GetShelf

func (m *GetBookRequest) GetShelf() int64

func (*GetBookRequest) ProtoMessage

func (*GetBookRequest) ProtoMessage()

func (*GetBookRequest) Reset

func (m *GetBookRequest) Reset()

func (*GetBookRequest) String

func (m *GetBookRequest) String() string

type GetShelfRequest

type GetShelfRequest struct {
	// The ID of the shelf resource to retrieve.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
}

Request message for GetShelf method.

func (*GetShelfRequest) Descriptor

func (*GetShelfRequest) Descriptor() ([]byte, []int)

func (*GetShelfRequest) GetShelf

func (m *GetShelfRequest) GetShelf() int64

func (*GetShelfRequest) ProtoMessage

func (*GetShelfRequest) ProtoMessage()

func (*GetShelfRequest) Reset

func (m *GetShelfRequest) Reset()

func (*GetShelfRequest) String

func (m *GetShelfRequest) String() string

type ListBooksRequest

type ListBooksRequest struct {
	// ID of the shelf which books to list.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
}

Request message for ListBooks method.

func (*ListBooksRequest) Descriptor

func (*ListBooksRequest) Descriptor() ([]byte, []int)

func (*ListBooksRequest) GetShelf

func (m *ListBooksRequest) GetShelf() int64

func (*ListBooksRequest) ProtoMessage

func (*ListBooksRequest) ProtoMessage()

func (*ListBooksRequest) Reset

func (m *ListBooksRequest) Reset()

func (*ListBooksRequest) String

func (m *ListBooksRequest) String() string

type ListShelvesResponse

type ListShelvesResponse struct {
	// Shelves in the bookstore.
	Shelves []*Shelf `protobuf:"bytes,1,rep,name=shelves" json:"shelves,omitempty"`
}

Response to ListShelves call.

func (*ListShelvesResponse) Descriptor

func (*ListShelvesResponse) Descriptor() ([]byte, []int)

func (*ListShelvesResponse) GetShelves

func (m *ListShelvesResponse) GetShelves() []*Shelf

func (*ListShelvesResponse) ProtoMessage

func (*ListShelvesResponse) ProtoMessage()

func (*ListShelvesResponse) Reset

func (m *ListShelvesResponse) Reset()

func (*ListShelvesResponse) String

func (m *ListShelvesResponse) String() string

type Shelf

type Shelf struct {
	// A unique shelf id.
	Id int64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	// A theme of the shelf (fiction, poetry, etc).
	Theme string `protobuf:"bytes,2,opt,name=theme" json:"theme,omitempty"`
}

A shelf resource.

func (*Shelf) Descriptor

func (*Shelf) Descriptor() ([]byte, []int)

func (*Shelf) GetId

func (m *Shelf) GetId() int64

func (*Shelf) GetTheme

func (m *Shelf) GetTheme() string

func (*Shelf) ProtoMessage

func (*Shelf) ProtoMessage()

func (*Shelf) Reset

func (m *Shelf) Reset()

func (*Shelf) String

func (m *Shelf) String() string

type UpdateBookRequest

type UpdateBookRequest struct {
	// The ID of the shelf from which to retrieve a book.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf" json:"shelf,omitempty"`
	// A book resource to update on the shelf.
	Book *Book `protobuf:"bytes,2,opt,name=book" json:"book,omitempty"`
}

Request message for UpdateBook method

func (*UpdateBookRequest) Descriptor

func (*UpdateBookRequest) Descriptor() ([]byte, []int)

func (*UpdateBookRequest) GetBook

func (m *UpdateBookRequest) GetBook() *Book

func (*UpdateBookRequest) GetShelf

func (m *UpdateBookRequest) GetShelf() int64

func (*UpdateBookRequest) ProtoMessage

func (*UpdateBookRequest) ProtoMessage()

func (*UpdateBookRequest) Reset

func (m *UpdateBookRequest) Reset()

func (*UpdateBookRequest) String

func (m *UpdateBookRequest) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL