Documentation
¶
Index ¶
- func GenerateETag(msg proto.Message) (string, error)
- func StartServer(targetPort int)
- func UnmarshalIntoBook(authorsSerialized, isbnSerialized string, b *bpb.Book) error
- func ValidateETag(providedETag, currentETag string) bool
- type BookstoreServer
- func (s BookstoreServer) ApplyBook(_ context.Context, r *bpb.ApplyBookRequest) (*bpb.Book, error)
- func (s BookstoreServer) ApplyPublisher(_ context.Context, r *bpb.ApplyPublisherRequest) (*bpb.Publisher, error)
- func (s BookstoreServer) ArchiveBook(ctx context.Context, r *bpb.ArchiveBookRequest) (*api.Operation, error)
- func (s BookstoreServer) CreateBook(_ context.Context, r *bpb.CreateBookRequest) (*bpb.Book, error)
- func (s BookstoreServer) CreateItem(_ context.Context, r *bpb.CreateItemRequest) (*bpb.Item, error)
- func (s BookstoreServer) CreatePublisher(ctx context.Context, r *bpb.CreatePublisherRequest) (*bpb.Publisher, error)
- func (s BookstoreServer) CreateStore(_ context.Context, r *bpb.CreateStoreRequest) (*bpb.Store, error)
- func (s BookstoreServer) DeleteBook(_ context.Context, r *bpb.DeleteBookRequest) (*emptypb.Empty, error)
- func (s BookstoreServer) DeleteItem(_ context.Context, r *bpb.DeleteItemRequest) (*emptypb.Empty, error)
- func (s BookstoreServer) DeletePublisher(_ context.Context, r *bpb.DeletePublisherRequest) (*emptypb.Empty, error)
- func (s BookstoreServer) DeleteStore(_ context.Context, r *bpb.DeleteStoreRequest) (*emptypb.Empty, error)
- func (s BookstoreServer) GetBook(_ context.Context, r *bpb.GetBookRequest) (*bpb.Book, error)
- func (s BookstoreServer) GetItem(_ context.Context, r *bpb.GetItemRequest) (*bpb.Item, error)
- func (s BookstoreServer) GetOperation(ctx context.Context, r *lrpb.GetOperationRequest) (*lrpb.Operation, error)
- func (s BookstoreServer) GetPublisher(ctx context.Context, r *bpb.GetPublisherRequest) (*bpb.Publisher, error)
- func (s BookstoreServer) GetStore(_ context.Context, r *bpb.GetStoreRequest) (*bpb.Store, error)
- func (s BookstoreServer) ListBooks(_ context.Context, r *bpb.ListBooksRequest) (*bpb.ListBooksResponse, error)
- func (s BookstoreServer) ListPublishers(_ context.Context, r *bpb.ListPublishersRequest) (*bpb.ListPublishersResponse, error)
- func (s BookstoreServer) MoveItem(ctx context.Context, r *bpb.MoveItemRequest) (*api.Operation, error)
- func (s BookstoreServer) UpdateBook(ctx context.Context, r *bpb.UpdateBookRequest) (*bpb.Book, error)
- func (s BookstoreServer) UpdateItem(ctx context.Context, r *bpb.UpdateItemRequest) (*bpb.Item, error)
- func (s BookstoreServer) UpdatePublisher(ctx context.Context, r *bpb.UpdatePublisherRequest) (*bpb.Publisher, error)
- func (s BookstoreServer) UpdateStore(ctx context.Context, r *bpb.UpdateStoreRequest) (*bpb.Store, error)
- type SerializableBook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateETag ¶
GenerateETag generates an ETag for a protobuf message based on its content
func StartServer ¶
func StartServer(targetPort int)
func UnmarshalIntoBook ¶
func ValidateETag ¶
ValidateETag compares the provided ETag with the current resource ETag
Types ¶
type BookstoreServer ¶
type BookstoreServer struct {
bpb.UnimplementedBookstoreServer
lrpb.UnimplementedOperationsServer
// contains filtered or unexported fields
}
func NewBookstoreServer ¶
func NewBookstoreServer(db *sql.DB) *BookstoreServer
func (BookstoreServer) ApplyBook ¶
func (s BookstoreServer) ApplyBook(_ context.Context, r *bpb.ApplyBookRequest) (*bpb.Book, error)
func (BookstoreServer) ApplyPublisher ¶
func (s BookstoreServer) ApplyPublisher(_ context.Context, r *bpb.ApplyPublisherRequest) (*bpb.Publisher, error)
func (BookstoreServer) ArchiveBook ¶
func (s BookstoreServer) ArchiveBook(ctx context.Context, r *bpb.ArchiveBookRequest) (*api.Operation, error)
func (BookstoreServer) CreateBook ¶
func (s BookstoreServer) CreateBook(_ context.Context, r *bpb.CreateBookRequest) (*bpb.Book, error)
func (BookstoreServer) CreateItem ¶
func (s BookstoreServer) CreateItem(_ context.Context, r *bpb.CreateItemRequest) (*bpb.Item, error)
func (BookstoreServer) CreatePublisher ¶
func (s BookstoreServer) CreatePublisher(ctx context.Context, r *bpb.CreatePublisherRequest) (*bpb.Publisher, error)
func (BookstoreServer) CreateStore ¶
func (s BookstoreServer) CreateStore(_ context.Context, r *bpb.CreateStoreRequest) (*bpb.Store, error)
func (BookstoreServer) DeleteBook ¶
func (s BookstoreServer) DeleteBook(_ context.Context, r *bpb.DeleteBookRequest) (*emptypb.Empty, error)
func (BookstoreServer) DeleteItem ¶
func (s BookstoreServer) DeleteItem(_ context.Context, r *bpb.DeleteItemRequest) (*emptypb.Empty, error)
func (BookstoreServer) DeletePublisher ¶
func (s BookstoreServer) DeletePublisher(_ context.Context, r *bpb.DeletePublisherRequest) (*emptypb.Empty, error)
func (BookstoreServer) DeleteStore ¶
func (s BookstoreServer) DeleteStore(_ context.Context, r *bpb.DeleteStoreRequest) (*emptypb.Empty, error)
func (BookstoreServer) GetBook ¶
func (s BookstoreServer) GetBook(_ context.Context, r *bpb.GetBookRequest) (*bpb.Book, error)
func (BookstoreServer) GetItem ¶
func (s BookstoreServer) GetItem(_ context.Context, r *bpb.GetItemRequest) (*bpb.Item, error)
func (BookstoreServer) GetOperation ¶
func (s BookstoreServer) GetOperation(ctx context.Context, r *lrpb.GetOperationRequest) (*lrpb.Operation, error)
func (BookstoreServer) GetPublisher ¶
func (s BookstoreServer) GetPublisher(ctx context.Context, r *bpb.GetPublisherRequest) (*bpb.Publisher, error)
func (BookstoreServer) GetStore ¶
func (s BookstoreServer) GetStore(_ context.Context, r *bpb.GetStoreRequest) (*bpb.Store, error)
func (BookstoreServer) ListBooks ¶
func (s BookstoreServer) ListBooks(_ context.Context, r *bpb.ListBooksRequest) (*bpb.ListBooksResponse, error)
func (BookstoreServer) ListPublishers ¶
func (s BookstoreServer) ListPublishers(_ context.Context, r *bpb.ListPublishersRequest) (*bpb.ListPublishersResponse, error)
func (BookstoreServer) MoveItem ¶
func (s BookstoreServer) MoveItem(ctx context.Context, r *bpb.MoveItemRequest) (*api.Operation, error)
func (BookstoreServer) UpdateBook ¶
func (s BookstoreServer) UpdateBook(ctx context.Context, r *bpb.UpdateBookRequest) (*bpb.Book, error)
func (BookstoreServer) UpdateItem ¶
func (s BookstoreServer) UpdateItem(ctx context.Context, r *bpb.UpdateItemRequest) (*bpb.Item, error)
func (BookstoreServer) UpdatePublisher ¶
func (s BookstoreServer) UpdatePublisher(ctx context.Context, r *bpb.UpdatePublisherRequest) (*bpb.Publisher, error)
func (BookstoreServer) UpdateStore ¶
func (s BookstoreServer) UpdateStore(ctx context.Context, r *bpb.UpdateStoreRequest) (*bpb.Store, error)
type SerializableBook ¶
func NewSerializableBook ¶
func NewSerializableBook(b *bpb.Book) (*SerializableBook, error)
Click to show internal directories.
Click to hide internal directories.