Documentation ¶
Index ¶
- Variables
- func RegisterProductsServiceServer(s grpc.ServiceRegistrar, srv ProductsServiceServer)
- type FetchRequest
- type FetchResponse
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetPagingLimit() int32
- func (x *ListRequest) GetPagingOffset() int32
- func (x *ListRequest) GetSortAsc() int32
- func (x *ListRequest) GetSortField() ListRequest_SortingField
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type ListRequest_SortingField
- func (ListRequest_SortingField) Descriptor() protoreflect.EnumDescriptor
- func (x ListRequest_SortingField) Enum() *ListRequest_SortingField
- func (ListRequest_SortingField) EnumDescriptor() ([]byte, []int)deprecated
- func (x ListRequest_SortingField) Number() protoreflect.EnumNumber
- func (x ListRequest_SortingField) String() string
- func (ListRequest_SortingField) Type() protoreflect.EnumType
- type ListResponse
- type ProductItem
- func (*ProductItem) Descriptor() ([]byte, []int)deprecated
- func (x *ProductItem) GetCount() int32
- func (x *ProductItem) GetName() string
- func (x *ProductItem) GetPrice() int32
- func (x *ProductItem) GetTimestamp() *timestamppb.Timestamp
- func (*ProductItem) ProtoMessage()
- func (x *ProductItem) ProtoReflect() protoreflect.Message
- func (x *ProductItem) Reset()
- func (x *ProductItem) String() string
- type ProductsServiceClient
- type ProductsServiceServer
- type UnimplementedProductsServiceServer
- type UnsafeProductsServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( ListRequest_SortingField_name = map[int32]string{ 0: "name", 1: "price", 2: "changes_count", 3: "timestamp", } ListRequest_SortingField_value = map[string]int32{ "name": 0, "price": 1, "changes_count": 2, "timestamp": 3, } )
Enum value maps for ListRequest_SortingField.
var File_proto_products_proto protoreflect.FileDescriptor
var ProductsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "products.ProductsService", HandlerType: (*ProductsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Fetch", Handler: _ProductsService_Fetch_Handler, }, { MethodName: "List", Handler: _ProductsService_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/products.proto", }
ProductsService_ServiceDesc is the grpc.ServiceDesc for ProductsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProductsServiceServer ¶
func RegisterProductsServiceServer(s grpc.ServiceRegistrar, srv ProductsServiceServer)
Types ¶
type FetchRequest ¶
type FetchRequest struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
func (*FetchRequest) Descriptor
deprecated
func (*FetchRequest) Descriptor() ([]byte, []int)
Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.
func (*FetchRequest) GetUrl ¶
func (x *FetchRequest) GetUrl() string
func (*FetchRequest) ProtoMessage ¶
func (*FetchRequest) ProtoMessage()
func (*FetchRequest) ProtoReflect ¶
func (x *FetchRequest) ProtoReflect() protoreflect.Message
func (*FetchRequest) Reset ¶
func (x *FetchRequest) Reset()
func (*FetchRequest) String ¶
func (x *FetchRequest) String() string
type FetchResponse ¶
type FetchResponse struct { Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*FetchResponse) Descriptor
deprecated
func (*FetchResponse) Descriptor() ([]byte, []int)
Deprecated: Use FetchResponse.ProtoReflect.Descriptor instead.
func (*FetchResponse) GetStatus ¶
func (x *FetchResponse) GetStatus() string
func (*FetchResponse) ProtoMessage ¶
func (*FetchResponse) ProtoMessage()
func (*FetchResponse) ProtoReflect ¶
func (x *FetchResponse) ProtoReflect() protoreflect.Message
func (*FetchResponse) Reset ¶
func (x *FetchResponse) Reset()
func (*FetchResponse) String ¶
func (x *FetchResponse) String() string
type ListRequest ¶
type ListRequest struct { SortField ListRequest_SortingField `` /* 128-byte string literal not displayed */ SortAsc int32 `protobuf:"varint,2,opt,name=sort_asc,json=sortAsc,proto3" json:"sort_asc,omitempty"` PagingOffset int32 `protobuf:"varint,3,opt,name=paging_offset,json=pagingOffset,proto3" json:"paging_offset,omitempty"` PagingLimit int32 `protobuf:"varint,4,opt,name=paging_limit,json=pagingLimit,proto3" json:"paging_limit,omitempty"` // contains filtered or unexported fields }
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetPagingLimit ¶
func (x *ListRequest) GetPagingLimit() int32
func (*ListRequest) GetPagingOffset ¶
func (x *ListRequest) GetPagingOffset() int32
func (*ListRequest) GetSortAsc ¶
func (x *ListRequest) GetSortAsc() int32
func (*ListRequest) GetSortField ¶
func (x *ListRequest) GetSortField() ListRequest_SortingField
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListRequest_SortingField ¶
type ListRequest_SortingField int32
const ( ListRequest_name ListRequest_SortingField = 0 ListRequest_price ListRequest_SortingField = 1 ListRequest_changes_count ListRequest_SortingField = 2 ListRequest_timestamp ListRequest_SortingField = 3 )
func (ListRequest_SortingField) Descriptor ¶
func (ListRequest_SortingField) Descriptor() protoreflect.EnumDescriptor
func (ListRequest_SortingField) Enum ¶
func (x ListRequest_SortingField) Enum() *ListRequest_SortingField
func (ListRequest_SortingField) EnumDescriptor
deprecated
func (ListRequest_SortingField) EnumDescriptor() ([]byte, []int)
Deprecated: Use ListRequest_SortingField.Descriptor instead.
func (ListRequest_SortingField) Number ¶
func (x ListRequest_SortingField) Number() protoreflect.EnumNumber
func (ListRequest_SortingField) String ¶
func (x ListRequest_SortingField) String() string
func (ListRequest_SortingField) Type ¶
func (ListRequest_SortingField) Type() protoreflect.EnumType
type ListResponse ¶
type ListResponse struct { Product []*ProductItem `protobuf:"bytes,1,rep,name=product,proto3" json:"product,omitempty"` // contains filtered or unexported fields }
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetProduct ¶
func (x *ListResponse) GetProduct() []*ProductItem
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type ProductItem ¶
type ProductItem struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Price int32 `protobuf:"varint,2,opt,name=price,proto3" json:"price,omitempty"` Count int32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*ProductItem) Descriptor
deprecated
func (*ProductItem) Descriptor() ([]byte, []int)
Deprecated: Use ProductItem.ProtoReflect.Descriptor instead.
func (*ProductItem) GetCount ¶
func (x *ProductItem) GetCount() int32
func (*ProductItem) GetName ¶
func (x *ProductItem) GetName() string
func (*ProductItem) GetPrice ¶
func (x *ProductItem) GetPrice() int32
func (*ProductItem) GetTimestamp ¶
func (x *ProductItem) GetTimestamp() *timestamppb.Timestamp
func (*ProductItem) ProtoMessage ¶
func (*ProductItem) ProtoMessage()
func (*ProductItem) ProtoReflect ¶
func (x *ProductItem) ProtoReflect() protoreflect.Message
func (*ProductItem) Reset ¶
func (x *ProductItem) Reset()
func (*ProductItem) String ¶
func (x *ProductItem) String() string
type ProductsServiceClient ¶
type ProductsServiceClient interface { Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*FetchResponse, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) }
ProductsServiceClient is the client API for ProductsService 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 NewProductsServiceClient ¶
func NewProductsServiceClient(cc grpc.ClientConnInterface) ProductsServiceClient
type ProductsServiceServer ¶
type ProductsServiceServer interface { Fetch(context.Context, *FetchRequest) (*FetchResponse, error) List(context.Context, *ListRequest) (*ListResponse, error) }
ProductsServiceServer is the server API for ProductsService service. All implementations should embed UnimplementedProductsServiceServer for forward compatibility
type UnimplementedProductsServiceServer ¶
type UnimplementedProductsServiceServer struct { }
UnimplementedProductsServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedProductsServiceServer) Fetch ¶
func (UnimplementedProductsServiceServer) Fetch(context.Context, *FetchRequest) (*FetchResponse, error)
func (UnimplementedProductsServiceServer) List ¶
func (UnimplementedProductsServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
type UnsafeProductsServiceServer ¶
type UnsafeProductsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeProductsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProductsServiceServer will result in compilation errors.