api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Booker_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.Booker",
	HandlerType: (*BookerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetBooks",
			Handler:    _Booker_GetBooks_Handler,
		},
		{
			MethodName: "GetAuthor",
			Handler:    _Booker_GetAuthor_Handler,
		},
		{
			MethodName: "addBook",
			Handler:    _Booker_AddBook_Handler,
		},
		{
			MethodName: "addAuthor",
			Handler:    _Booker_AddAuthor_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "books.proto",
}

Booker_ServiceDesc is the grpc.ServiceDesc for Booker 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_books_proto protoreflect.FileDescriptor

Functions

func RegisterBookerServer

func RegisterBookerServer(s grpc.ServiceRegistrar, srv BookerServer)

Types

type AddBook

type AddBook struct {
	Title       string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	AuthorId    int64  `protobuf:"varint,3,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddBook) Descriptor deprecated

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

Deprecated: Use AddBook.ProtoReflect.Descriptor instead.

func (*AddBook) GetAuthorId

func (x *AddBook) GetAuthorId() int64

func (*AddBook) GetDescription

func (x *AddBook) GetDescription() string

func (*AddBook) GetTitle

func (x *AddBook) GetTitle() string

func (*AddBook) ProtoMessage

func (*AddBook) ProtoMessage()

func (*AddBook) ProtoReflect

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

func (*AddBook) Reset

func (x *AddBook) Reset()

func (*AddBook) String

func (x *AddBook) String() string

type Author

type Author struct {
	FirstName  string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	SecondName string `protobuf:"bytes,2,opt,name=second_name,json=secondName,proto3" json:"second_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Author) Descriptor deprecated

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

Deprecated: Use Author.ProtoReflect.Descriptor instead.

func (*Author) GetFirstName

func (x *Author) GetFirstName() string

func (*Author) GetSecondName

func (x *Author) GetSecondName() string

func (*Author) ProtoMessage

func (*Author) ProtoMessage()

func (*Author) ProtoReflect

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

func (*Author) Reset

func (x *Author) Reset()

func (*Author) String

func (x *Author) String() string

type Book

type Book struct {
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

func (*Book) Descriptor deprecated

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

Deprecated: Use Book.ProtoReflect.Descriptor instead.

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 BookerClient

type BookerClient interface {
	GetBooks(ctx context.Context, in *Author, opts ...grpc.CallOption) (*Books, error)
	GetAuthor(ctx context.Context, in *Book, opts ...grpc.CallOption) (*Author, error)
	AddBook(ctx context.Context, in *AddBook, opts ...grpc.CallOption) (*ResponceID, error)
	AddAuthor(ctx context.Context, in *Author, opts ...grpc.CallOption) (*ResponceID, error)
}

BookerClient is the client API for Booker 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 NewBookerClient

func NewBookerClient(cc grpc.ClientConnInterface) BookerClient

type BookerServer

type BookerServer interface {
	GetBooks(context.Context, *Author) (*Books, error)
	GetAuthor(context.Context, *Book) (*Author, error)
	AddBook(context.Context, *AddBook) (*ResponceID, error)
	AddAuthor(context.Context, *Author) (*ResponceID, error)
	// contains filtered or unexported methods
}

BookerServer is the server API for Booker service. All implementations must embed UnimplementedBookerServer for forward compatibility

type Books

type Books struct {
	Title []string `protobuf:"bytes,1,rep,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

func (*Books) Descriptor deprecated

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

Deprecated: Use Books.ProtoReflect.Descriptor instead.

func (*Books) GetTitle

func (x *Books) GetTitle() []string

func (*Books) ProtoMessage

func (*Books) ProtoMessage()

func (*Books) ProtoReflect

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

func (*Books) Reset

func (x *Books) Reset()

func (*Books) String

func (x *Books) String() string

type ResponceID

type ResponceID struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponceID) Descriptor deprecated

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

Deprecated: Use ResponceID.ProtoReflect.Descriptor instead.

func (*ResponceID) GetValue

func (x *ResponceID) GetValue() string

func (*ResponceID) ProtoMessage

func (*ResponceID) ProtoMessage()

func (*ResponceID) ProtoReflect

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

func (*ResponceID) Reset

func (x *ResponceID) Reset()

func (*ResponceID) String

func (x *ResponceID) String() string

type UnimplementedBookerServer

type UnimplementedBookerServer struct {
}

UnimplementedBookerServer must be embedded to have forward compatible implementations.

func (UnimplementedBookerServer) AddAuthor

func (UnimplementedBookerServer) AddBook

func (UnimplementedBookerServer) GetAuthor

func (UnimplementedBookerServer) GetBooks

type UnsafeBookerServer

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

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

Jump to

Keyboard shortcuts

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