rpc

package
v0.0.0-...-744c0fc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bookstore_Reset_FullMethodName       = "/examples.bookstore.v1.Bookstore/Reset"
	Bookstore_ListShelves_FullMethodName = "/examples.bookstore.v1.Bookstore/ListShelves"
	Bookstore_CreateShelf_FullMethodName = "/examples.bookstore.v1.Bookstore/CreateShelf"
	Bookstore_GetShelf_FullMethodName    = "/examples.bookstore.v1.Bookstore/GetShelf"
	Bookstore_DeleteShelf_FullMethodName = "/examples.bookstore.v1.Bookstore/DeleteShelf"
	Bookstore_ListBooks_FullMethodName   = "/examples.bookstore.v1.Bookstore/ListBooks"
	Bookstore_CreateBook_FullMethodName  = "/examples.bookstore.v1.Bookstore/CreateBook"
	Bookstore_GetBook_FullMethodName     = "/examples.bookstore.v1.Bookstore/GetBook"
	Bookstore_DeleteBook_FullMethodName  = "/examples.bookstore.v1.Bookstore/DeleteBook"
)

Variables

View Source
var Bookstore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "examples.bookstore.v1.Bookstore",
	HandlerType: (*BookstoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Reset",
			Handler:    _Bookstore_Reset_Handler,
		},
		{
			MethodName: "ListShelves",
			Handler:    _Bookstore_ListShelves_Handler,
		},
		{
			MethodName: "CreateShelf",
			Handler:    _Bookstore_CreateShelf_Handler,
		},
		{
			MethodName: "GetShelf",
			Handler:    _Bookstore_GetShelf_Handler,
		},
		{
			MethodName: "DeleteShelf",
			Handler:    _Bookstore_DeleteShelf_Handler,
		},
		{
			MethodName: "ListBooks",
			Handler:    _Bookstore_ListBooks_Handler,
		},
		{
			MethodName: "CreateBook",
			Handler:    _Bookstore_CreateBook_Handler,
		},
		{
			MethodName: "GetBook",
			Handler:    _Bookstore_GetBook_Handler,
		},
		{
			MethodName: "DeleteBook",
			Handler:    _Bookstore_DeleteBook_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "examples/bookstore/v1/bookstore.proto",
}

Bookstore_ServiceDesc is the grpc.ServiceDesc for Bookstore service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_examples_bookstore_v1_bookstore_proto protoreflect.FileDescriptor

Functions

func RegisterBookstoreServer

func RegisterBookstoreServer(s grpc.ServiceRegistrar, srv BookstoreServer)

Types

type Book

type Book struct {

	// A unique book id.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// An author of the book.
	Author string `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"`
	// A book title.
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

A book resource.

func (*Book) Descriptor deprecated

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

Deprecated: Use Book.ProtoReflect.Descriptor instead.

func (*Book) GetAuthor

func (x *Book) GetAuthor() string

func (*Book) GetId

func (x *Book) GetId() int64

func (*Book) GetTitle

func (x *Book) GetTitle() string

func (*Book) ProtoMessage

func (*Book) ProtoMessage()

func (*Book) ProtoReflect

func (x *Book) ProtoReflect() protoreflect.Message

func (*Book) Reset

func (x *Book) Reset()

func (*Book) String

func (x *Book) String() string

type BookstoreClient

type BookstoreClient interface {
	// Resets the bookstore server (testing only).
	Reset(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Returns a list of all shelves in the bookstore.
	ListShelves(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListShelvesResponse, error)
	// Creates a new shelf in the bookstore.
	CreateShelf(ctx context.Context, in *CreateShelfRequest, opts ...grpc.CallOption) (*Shelf, 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) (*emptypb.Empty, error)
	// Returns a list of books on a shelf.
	ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, 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) (*emptypb.Empty, error)
}

BookstoreClient is the client API for Bookstore 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 NewBookstoreClient

func NewBookstoreClient(cc grpc.ClientConnInterface) BookstoreClient

type BookstoreServer

type BookstoreServer interface {
	// Resets the bookstore server (testing only).
	Reset(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// Returns a list of all shelves in the bookstore.
	ListShelves(context.Context, *emptypb.Empty) (*ListShelvesResponse, error)
	// Creates a new shelf in the bookstore.
	CreateShelf(context.Context, *CreateShelfRequest) (*Shelf, 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) (*emptypb.Empty, error)
	// Returns a list of books on a shelf.
	ListBooks(context.Context, *ListBooksRequest) (*ListBooksResponse, 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) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

BookstoreServer is the server API for Bookstore service. All implementations must embed UnimplementedBookstoreServer for forward compatibility

type CreateBookRequest

type CreateBookRequest struct {

	// The ID of the shelf on which to create a book.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"`
	// A book resource to create on the shelf.
	Book *Book `protobuf:"bytes,2,opt,name=book,proto3" json:"book,omitempty"`
	// contains filtered or unexported fields
}

Request message for CreateBook method.

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) GetShelf

func (x *CreateBookRequest) GetShelf() int64

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 CreateShelfRequest

type CreateShelfRequest struct {

	// The shelf resource to create.
	Shelf *Shelf `protobuf:"bytes,1,opt,name=shelf,proto3" json:"shelf,omitempty"`
	// contains filtered or unexported fields
}

Request message for CreateShelf method.

func (*CreateShelfRequest) Descriptor deprecated

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

Deprecated: Use CreateShelfRequest.ProtoReflect.Descriptor instead.

func (*CreateShelfRequest) GetShelf

func (x *CreateShelfRequest) GetShelf() *Shelf

func (*CreateShelfRequest) ProtoMessage

func (*CreateShelfRequest) ProtoMessage()

func (*CreateShelfRequest) ProtoReflect

func (x *CreateShelfRequest) ProtoReflect() protoreflect.Message

func (*CreateShelfRequest) Reset

func (x *CreateShelfRequest) Reset()

func (*CreateShelfRequest) String

func (x *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,proto3" json:"shelf,omitempty"`
	// The ID of the book to delete.
	Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"`
	// contains filtered or unexported fields
}

Request message for DeleteBook method.

func (*DeleteBookRequest) Descriptor deprecated

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

Deprecated: Use DeleteBookRequest.ProtoReflect.Descriptor instead.

func (*DeleteBookRequest) GetBook

func (x *DeleteBookRequest) GetBook() int64

func (*DeleteBookRequest) GetShelf

func (x *DeleteBookRequest) GetShelf() int64

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 DeleteShelfRequest

type DeleteShelfRequest struct {

	// The ID of the shelf to delete.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"`
	// contains filtered or unexported fields
}

Request message for DeleteShelf method.

func (*DeleteShelfRequest) Descriptor deprecated

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

Deprecated: Use DeleteShelfRequest.ProtoReflect.Descriptor instead.

func (*DeleteShelfRequest) GetShelf

func (x *DeleteShelfRequest) GetShelf() int64

func (*DeleteShelfRequest) ProtoMessage

func (*DeleteShelfRequest) ProtoMessage()

func (*DeleteShelfRequest) ProtoReflect

func (x *DeleteShelfRequest) ProtoReflect() protoreflect.Message

func (*DeleteShelfRequest) Reset

func (x *DeleteShelfRequest) Reset()

func (*DeleteShelfRequest) String

func (x *DeleteShelfRequest) 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,proto3" json:"shelf,omitempty"`
	// The ID of the book to retrieve.
	Book int64 `protobuf:"varint,2,opt,name=book,proto3" json:"book,omitempty"`
	// contains filtered or unexported fields
}

Request message for GetBook method.

func (*GetBookRequest) Descriptor deprecated

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

Deprecated: Use GetBookRequest.ProtoReflect.Descriptor instead.

func (*GetBookRequest) GetBook

func (x *GetBookRequest) GetBook() int64

func (*GetBookRequest) GetShelf

func (x *GetBookRequest) GetShelf() int64

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 GetShelfRequest

type GetShelfRequest struct {

	// The ID of the shelf resource to retrieve.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"`
	// contains filtered or unexported fields
}

Request message for GetShelf method.

func (*GetShelfRequest) Descriptor deprecated

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

Deprecated: Use GetShelfRequest.ProtoReflect.Descriptor instead.

func (*GetShelfRequest) GetShelf

func (x *GetShelfRequest) GetShelf() int64

func (*GetShelfRequest) ProtoMessage

func (*GetShelfRequest) ProtoMessage()

func (*GetShelfRequest) ProtoReflect

func (x *GetShelfRequest) ProtoReflect() protoreflect.Message

func (*GetShelfRequest) Reset

func (x *GetShelfRequest) Reset()

func (*GetShelfRequest) String

func (x *GetShelfRequest) String() string

type ListBooksRequest

type ListBooksRequest struct {

	// ID of the shelf which books to list.
	Shelf int64 `protobuf:"varint,1,opt,name=shelf,proto3" json:"shelf,omitempty"`
	// contains filtered or unexported fields
}

Request message for ListBooks method.

func (*ListBooksRequest) Descriptor deprecated

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

Deprecated: Use ListBooksRequest.ProtoReflect.Descriptor instead.

func (*ListBooksRequest) GetShelf

func (x *ListBooksRequest) GetShelf() int64

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 books on the shelf.
	Books []*Book `protobuf:"bytes,1,rep,name=books,proto3" json:"books,omitempty"`
	// contains filtered or unexported fields
}

Response message to ListBooks method.

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) 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 ListShelvesResponse

type ListShelvesResponse struct {

	// Shelves in the bookstore.
	Shelves []*Shelf `protobuf:"bytes,1,rep,name=shelves,proto3" json:"shelves,omitempty"`
	// contains filtered or unexported fields
}

Response to ListShelves call.

func (*ListShelvesResponse) Descriptor deprecated

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

Deprecated: Use ListShelvesResponse.ProtoReflect.Descriptor instead.

func (*ListShelvesResponse) GetShelves

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

func (*ListShelvesResponse) ProtoMessage

func (*ListShelvesResponse) ProtoMessage()

func (*ListShelvesResponse) ProtoReflect

func (x *ListShelvesResponse) ProtoReflect() protoreflect.Message

func (*ListShelvesResponse) Reset

func (x *ListShelvesResponse) Reset()

func (*ListShelvesResponse) String

func (x *ListShelvesResponse) String() string

type Shelf

type Shelf struct {

	// A unique shelf id.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// A theme of the shelf (fiction, poetry, etc).
	Theme string `protobuf:"bytes,2,opt,name=theme,proto3" json:"theme,omitempty"`
	// contains filtered or unexported fields
}

A shelf resource.

func (*Shelf) Descriptor deprecated

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

Deprecated: Use Shelf.ProtoReflect.Descriptor instead.

func (*Shelf) GetId

func (x *Shelf) GetId() int64

func (*Shelf) GetTheme

func (x *Shelf) GetTheme() string

func (*Shelf) ProtoMessage

func (*Shelf) ProtoMessage()

func (*Shelf) ProtoReflect

func (x *Shelf) ProtoReflect() protoreflect.Message

func (*Shelf) Reset

func (x *Shelf) Reset()

func (*Shelf) String

func (x *Shelf) String() string

type UnimplementedBookstoreServer

type UnimplementedBookstoreServer struct {
}

UnimplementedBookstoreServer must be embedded to have forward compatible implementations.

func (UnimplementedBookstoreServer) CreateBook

func (UnimplementedBookstoreServer) CreateShelf

func (UnimplementedBookstoreServer) DeleteBook

func (UnimplementedBookstoreServer) DeleteShelf

func (UnimplementedBookstoreServer) GetBook

func (UnimplementedBookstoreServer) GetShelf

func (UnimplementedBookstoreServer) ListBooks

func (UnimplementedBookstoreServer) ListShelves

func (UnimplementedBookstoreServer) Reset

type UnsafeBookstoreServer

type UnsafeBookstoreServer interface {
	// contains filtered or unexported methods
}

UnsafeBookstoreServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BookstoreServer will result in compilation errors.

Jump to

Keyboard shortcuts

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