api_pb

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package api_pb is a generated protocol buffer package.

It is generated from these files:

library.proto

It has these top-level messages:

Book
ListBooksRequest
ListBooksResponse
GetBookRequest
CreateBookRequest
UpdateBookRequest
DeleteBookRequest

Package api_pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLibraryServiceHandler

func RegisterLibraryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterLibraryServiceHandler registers the http handlers for service LibraryService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterLibraryServiceHandlerClient

func RegisterLibraryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LibraryServiceClient) error

RegisterLibraryServiceHandler registers the http handlers for service LibraryService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LibraryServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LibraryServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LibraryServiceClient" to call the correct interceptors.

func RegisterLibraryServiceHandlerFromEndpoint

func RegisterLibraryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterLibraryServiceHandlerFromEndpoint is same as RegisterLibraryServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterLibraryServiceServer

func RegisterLibraryServiceServer(s *grpc.Server, srv LibraryServiceServer)

Types

type Book

type Book struct {
	BookId string `protobuf:"bytes,1,opt,name=book_id,json=bookId" json:"book_id,omitempty"`
}

func (*Book) Descriptor

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

func (*Book) GetBookId

func (m *Book) GetBookId() string

func (*Book) ProtoMessage

func (*Book) ProtoMessage()

func (*Book) Reset

func (m *Book) Reset()

func (*Book) String

func (m *Book) String() string

type CreateBookRequest

type CreateBookRequest struct {
	Book *Book `protobuf:"bytes,1,opt,name=book" json:"book,omitempty"`
}

func (*CreateBookRequest) Descriptor

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

func (*CreateBookRequest) GetBook

func (m *CreateBookRequest) GetBook() *Book

func (*CreateBookRequest) ProtoMessage

func (*CreateBookRequest) ProtoMessage()

func (*CreateBookRequest) Reset

func (m *CreateBookRequest) Reset()

func (*CreateBookRequest) String

func (m *CreateBookRequest) String() string

type DeleteBookRequest

type DeleteBookRequest struct {
	BookId string `protobuf:"bytes,1,opt,name=book_id,json=bookId" json:"book_id,omitempty"`
}

func (*DeleteBookRequest) Descriptor

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

func (*DeleteBookRequest) GetBookId

func (m *DeleteBookRequest) GetBookId() string

func (*DeleteBookRequest) ProtoMessage

func (*DeleteBookRequest) ProtoMessage()

func (*DeleteBookRequest) Reset

func (m *DeleteBookRequest) Reset()

func (*DeleteBookRequest) String

func (m *DeleteBookRequest) String() string

type GetBookRequest

type GetBookRequest struct {
	BookId string `protobuf:"bytes,1,opt,name=book_id,json=bookId" json:"book_id,omitempty"`
}

func (*GetBookRequest) Descriptor

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

func (*GetBookRequest) GetBookId

func (m *GetBookRequest) GetBookId() string

func (*GetBookRequest) ProtoMessage

func (*GetBookRequest) ProtoMessage()

func (*GetBookRequest) Reset

func (m *GetBookRequest) Reset()

func (*GetBookRequest) String

func (m *GetBookRequest) String() string

type LibraryServiceClient

type LibraryServiceClient interface {
	ListBooks(ctx context.Context, in *ListBooksRequest, opts ...grpc.CallOption) (*ListBooksResponse, error)
	GetBook(ctx context.Context, in *GetBookRequest, opts ...grpc.CallOption) (*Book, error)
	CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error)
	UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error)
	DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
}

func NewLibraryServiceClient

func NewLibraryServiceClient(cc *grpc.ClientConn) LibraryServiceClient

type ListBooksRequest

type ListBooksRequest struct {
}

func (*ListBooksRequest) Descriptor

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

func (*ListBooksRequest) ProtoMessage

func (*ListBooksRequest) ProtoMessage()

func (*ListBooksRequest) Reset

func (m *ListBooksRequest) Reset()

func (*ListBooksRequest) String

func (m *ListBooksRequest) String() string

type ListBooksResponse

type ListBooksResponse struct {
	Books []*Book `protobuf:"bytes,1,rep,name=books" json:"books,omitempty"`
}

func (*ListBooksResponse) Descriptor

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

func (*ListBooksResponse) GetBooks

func (m *ListBooksResponse) GetBooks() []*Book

func (*ListBooksResponse) ProtoMessage

func (*ListBooksResponse) ProtoMessage()

func (*ListBooksResponse) Reset

func (m *ListBooksResponse) Reset()

func (*ListBooksResponse) String

func (m *ListBooksResponse) String() string

type UpdateBookRequest

type UpdateBookRequest struct {
	Book *Book `protobuf:"bytes,1,opt,name=book" json:"book,omitempty"`
}

func (*UpdateBookRequest) Descriptor

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

func (*UpdateBookRequest) GetBook

func (m *UpdateBookRequest) GetBook() *Book

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