Documentation ¶
Index ¶
- Variables
- func RegisterShopServiceServer(s grpc.ServiceRegistrar, srv ShopServiceServer)
- type CreateItemRequest
- func (*CreateItemRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateItemRequest) GetName() string
- func (x *CreateItemRequest) GetPrice() float32
- func (*CreateItemRequest) ProtoMessage()
- func (x *CreateItemRequest) ProtoReflect() protoreflect.Message
- func (x *CreateItemRequest) Reset()
- func (x *CreateItemRequest) String() string
- type Item
- type ItemRequestId
- type ItemsList
- type ShopServiceClient
- type ShopServiceServer
- type UnimplementedShopServiceServer
- func (UnimplementedShopServiceServer) Create(context.Context, *CreateItemRequest) (*Item, error)
- func (UnimplementedShopServiceServer) Get(context.Context, *ItemRequestId) (*Item, error)
- func (UnimplementedShopServiceServer) GetAll(context.Context, *empty.Empty) (*ItemsList, error)
- func (UnimplementedShopServiceServer) Remove(context.Context, *ItemRequestId) (*empty.Empty, error)
- func (UnimplementedShopServiceServer) Update(context.Context, *Item) (*Item, error)
- type UnsafeShopServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_shop_proto protoreflect.FileDescriptor
var ShopService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "shop.v1.ShopService", HandlerType: (*ShopServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAll", Handler: _ShopService_GetAll_Handler, }, { MethodName: "Get", Handler: _ShopService_Get_Handler, }, { MethodName: "Create", Handler: _ShopService_Create_Handler, }, { MethodName: "Update", Handler: _ShopService_Update_Handler, }, { MethodName: "Remove", Handler: _ShopService_Remove_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "shop.proto", }
ShopService_ServiceDesc is the grpc.ServiceDesc for ShopService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterShopServiceServer ¶
func RegisterShopServiceServer(s grpc.ServiceRegistrar, srv ShopServiceServer)
Types ¶
type CreateItemRequest ¶
type CreateItemRequest struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
func (*CreateItemRequest) Descriptor
deprecated
func (*CreateItemRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateItemRequest.ProtoReflect.Descriptor instead.
func (*CreateItemRequest) GetName ¶
func (x *CreateItemRequest) GetName() string
func (*CreateItemRequest) GetPrice ¶
func (x *CreateItemRequest) GetPrice() float32
func (*CreateItemRequest) ProtoMessage ¶
func (*CreateItemRequest) ProtoMessage()
func (*CreateItemRequest) ProtoReflect ¶
func (x *CreateItemRequest) ProtoReflect() protoreflect.Message
func (*CreateItemRequest) Reset ¶
func (x *CreateItemRequest) Reset()
func (*CreateItemRequest) String ¶
func (x *CreateItemRequest) String() string
type Item ¶
type Item struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
func (*Item) Descriptor
deprecated
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type ItemRequestId ¶
type ItemRequestId struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ItemRequestId) Descriptor
deprecated
func (*ItemRequestId) Descriptor() ([]byte, []int)
Deprecated: Use ItemRequestId.ProtoReflect.Descriptor instead.
func (*ItemRequestId) GetId ¶
func (x *ItemRequestId) GetId() string
func (*ItemRequestId) ProtoMessage ¶
func (*ItemRequestId) ProtoMessage()
func (*ItemRequestId) ProtoReflect ¶
func (x *ItemRequestId) ProtoReflect() protoreflect.Message
func (*ItemRequestId) Reset ¶
func (x *ItemRequestId) Reset()
func (*ItemRequestId) String ¶
func (x *ItemRequestId) String() string
type ItemsList ¶
type ItemsList struct { Items []*Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*ItemsList) Descriptor
deprecated
func (*ItemsList) ProtoMessage ¶
func (*ItemsList) ProtoMessage()
func (*ItemsList) ProtoReflect ¶
func (x *ItemsList) ProtoReflect() protoreflect.Message
type ShopServiceClient ¶
type ShopServiceClient interface { GetAll(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ItemsList, error) Get(ctx context.Context, in *ItemRequestId, opts ...grpc.CallOption) (*Item, error) Create(ctx context.Context, in *CreateItemRequest, opts ...grpc.CallOption) (*Item, error) Update(ctx context.Context, in *Item, opts ...grpc.CallOption) (*Item, error) Remove(ctx context.Context, in *ItemRequestId, opts ...grpc.CallOption) (*empty.Empty, error) }
ShopServiceClient is the client API for ShopService 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 NewShopServiceClient ¶
func NewShopServiceClient(cc grpc.ClientConnInterface) ShopServiceClient
type ShopServiceServer ¶
type ShopServiceServer interface { GetAll(context.Context, *empty.Empty) (*ItemsList, error) Get(context.Context, *ItemRequestId) (*Item, error) Create(context.Context, *CreateItemRequest) (*Item, error) Update(context.Context, *Item) (*Item, error) Remove(context.Context, *ItemRequestId) (*empty.Empty, error) // contains filtered or unexported methods }
ShopServiceServer is the server API for ShopService service. All implementations must embed UnimplementedShopServiceServer for forward compatibility
type UnimplementedShopServiceServer ¶
type UnimplementedShopServiceServer struct { }
UnimplementedShopServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedShopServiceServer) Create ¶
func (UnimplementedShopServiceServer) Create(context.Context, *CreateItemRequest) (*Item, error)
func (UnimplementedShopServiceServer) Get ¶
func (UnimplementedShopServiceServer) Get(context.Context, *ItemRequestId) (*Item, error)
func (UnimplementedShopServiceServer) Remove ¶
func (UnimplementedShopServiceServer) Remove(context.Context, *ItemRequestId) (*empty.Empty, error)
type UnsafeShopServiceServer ¶
type UnsafeShopServiceServer interface {
// contains filtered or unexported methods
}
UnsafeShopServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ShopServiceServer will result in compilation errors.