Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)
- type DiscoveryService
- type DiscoveryServiceClient
- type DiscoveryServiceServer
- type InterceptorTestSuite
- func (s *InterceptorTestSuite) NewClient(dialOpts ...grpc.DialOption) DiscoveryServiceClient
- func (s *InterceptorTestSuite) RestartServer(delayedStart time.Duration) <-chan bool
- func (s *InterceptorTestSuite) ServerAddr() string
- func (s *InterceptorTestSuite) SetupSuite()
- func (s *InterceptorTestSuite) TearDownSuite()
- type ListProductsRequest
- func (*ListProductsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListProductsRequest) GetFieldMask() *fieldmaskpb.FieldMask
- func (x *ListProductsRequest) GetId() string
- func (x *ListProductsRequest) GetKeySearch() string
- func (*ListProductsRequest) ProtoMessage()
- func (x *ListProductsRequest) ProtoReflect() protoreflect.Message
- func (x *ListProductsRequest) Reset()
- func (x *ListProductsRequest) String() string
- type ListProductsResponse
- func (*ListProductsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListProductsResponse) GetResult() *ListProductsResult
- func (*ListProductsResponse) ProtoMessage()
- func (x *ListProductsResponse) ProtoReflect() protoreflect.Message
- func (x *ListProductsResponse) Reset()
- func (x *ListProductsResponse) String() string
- type ListProductsResult
- func (*ListProductsResult) Descriptor() ([]byte, []int)deprecated
- func (x *ListProductsResult) GetProducts() []*Product
- func (*ListProductsResult) ProtoMessage()
- func (x *ListProductsResult) ProtoReflect() protoreflect.Message
- func (x *ListProductsResult) Reset()
- func (x *ListProductsResult) String() string
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetId() string
- func (x *Product) GetImg() string
- func (x *Product) GetName() string
- func (x *Product) GetPrice() float64
- func (x *Product) GetShop() *Shop
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type Shop
- type UnimplementedDiscoveryServiceServer
- type UnsafeDiscoveryServiceServer
Constants ¶
const (
DiscoveryService_ListProducts_FullMethodName = "/discovery.v1.DiscoveryService/ListProducts"
)
Variables ¶
var DiscoveryService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "discovery.v1.DiscoveryService", HandlerType: (*DiscoveryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListProducts", Handler: _DiscoveryService_ListProducts_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "discovery/v1/service.proto", }
DiscoveryService_ServiceDesc is the grpc.ServiceDesc for DiscoveryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_discovery_v1_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDiscoveryServiceServer ¶
func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)
Types ¶
type DiscoveryService ¶
type DiscoveryService struct {
UnimplementedDiscoveryServiceServer
}
func (*DiscoveryService) ListProducts ¶
func (s *DiscoveryService) ListProducts(ctx context.Context, req *ListProductsRequest) (*ListProductsResponse, error)
type DiscoveryServiceClient ¶
type DiscoveryServiceClient interface { // ListProducts ... ListProducts(ctx context.Context, in *ListProductsRequest, opts ...grpc.CallOption) (*ListProductsResponse, error) }
DiscoveryServiceClient is the client API for DiscoveryService 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 NewDiscoveryServiceClient ¶
func NewDiscoveryServiceClient(cc grpc.ClientConnInterface) DiscoveryServiceClient
type DiscoveryServiceServer ¶
type DiscoveryServiceServer interface { // ListProducts ... ListProducts(context.Context, *ListProductsRequest) (*ListProductsResponse, error) }
DiscoveryServiceServer is the server API for DiscoveryService service. All implementations should embed UnimplementedDiscoveryServiceServer for forward compatibility
type InterceptorTestSuite ¶
type InterceptorTestSuite struct { suite.Suite DiscoveryService *DiscoveryService ServerOpts []grpc.ServerOption ClientOpts []grpc.DialOption ServerListener net.Listener Server *grpc.Server Client DiscoveryServiceClient // contains filtered or unexported fields }
InterceptorTestSuite is a testify/Suite that starts a gRPC PingService server and a client.
func (*InterceptorTestSuite) NewClient ¶
func (s *InterceptorTestSuite) NewClient(dialOpts ...grpc.DialOption) DiscoveryServiceClient
func (*InterceptorTestSuite) RestartServer ¶
func (s *InterceptorTestSuite) RestartServer(delayedStart time.Duration) <-chan bool
func (*InterceptorTestSuite) ServerAddr ¶
func (s *InterceptorTestSuite) ServerAddr() string
func (*InterceptorTestSuite) SetupSuite ¶
func (s *InterceptorTestSuite) SetupSuite()
func (*InterceptorTestSuite) TearDownSuite ¶
func (s *InterceptorTestSuite) TearDownSuite()
type ListProductsRequest ¶
type ListProductsRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` KeySearch string `protobuf:"bytes,2,opt,name=key_search,json=keySearch,proto3" json:"key_search,omitempty"` FieldMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=field_mask,json=fieldMask,proto3" json:"field_mask,omitempty"` // contains filtered or unexported fields }
ListProductsRequest ...
func (*ListProductsRequest) Descriptor
deprecated
func (*ListProductsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListProductsRequest.ProtoReflect.Descriptor instead.
func (*ListProductsRequest) GetFieldMask ¶
func (x *ListProductsRequest) GetFieldMask() *fieldmaskpb.FieldMask
func (*ListProductsRequest) GetId ¶
func (x *ListProductsRequest) GetId() string
func (*ListProductsRequest) GetKeySearch ¶
func (x *ListProductsRequest) GetKeySearch() string
func (*ListProductsRequest) ProtoMessage ¶
func (*ListProductsRequest) ProtoMessage()
func (*ListProductsRequest) ProtoReflect ¶
func (x *ListProductsRequest) ProtoReflect() protoreflect.Message
func (*ListProductsRequest) Reset ¶
func (x *ListProductsRequest) Reset()
func (*ListProductsRequest) String ¶
func (x *ListProductsRequest) String() string
type ListProductsResponse ¶
type ListProductsResponse struct { Result *ListProductsResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` // contains filtered or unexported fields }
GetProductResponse ...
func (*ListProductsResponse) Descriptor
deprecated
func (*ListProductsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListProductsResponse.ProtoReflect.Descriptor instead.
func (*ListProductsResponse) GetResult ¶
func (x *ListProductsResponse) GetResult() *ListProductsResult
func (*ListProductsResponse) ProtoMessage ¶
func (*ListProductsResponse) ProtoMessage()
func (*ListProductsResponse) ProtoReflect ¶
func (x *ListProductsResponse) ProtoReflect() protoreflect.Message
func (*ListProductsResponse) Reset ¶
func (x *ListProductsResponse) Reset()
func (*ListProductsResponse) String ¶
func (x *ListProductsResponse) String() string
type ListProductsResult ¶
type ListProductsResult struct { Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` // Pagination // contains filtered or unexported fields }
ListProductsResult ...
func (*ListProductsResult) Descriptor
deprecated
func (*ListProductsResult) Descriptor() ([]byte, []int)
Deprecated: Use ListProductsResult.ProtoReflect.Descriptor instead.
func (*ListProductsResult) GetProducts ¶
func (x *ListProductsResult) GetProducts() []*Product
func (*ListProductsResult) ProtoMessage ¶
func (*ListProductsResult) ProtoMessage()
func (*ListProductsResult) ProtoReflect ¶
func (x *ListProductsResult) ProtoReflect() protoreflect.Message
func (*ListProductsResult) Reset ¶
func (x *ListProductsResult) Reset()
func (*ListProductsResult) String ¶
func (x *ListProductsResult) String() string
type Product ¶
type Product 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"` Img string `protobuf:"bytes,3,opt,name=img,proto3" json:"img,omitempty"` Price float64 `protobuf:"fixed64,4,opt,name=price,proto3" json:"price,omitempty"` Shop *Shop `protobuf:"bytes,5,opt,name=shop,proto3" json:"shop,omitempty"` // contains filtered or unexported fields }
Product ...
func (*Product) Descriptor
deprecated
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type Shop ¶
type Shop 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"` Img string `protobuf:"bytes,3,opt,name=img,proto3" json:"img,omitempty"` // contains filtered or unexported fields }
Shop ...
func (*Shop) Descriptor
deprecated
func (*Shop) ProtoMessage ¶
func (*Shop) ProtoMessage()
func (*Shop) ProtoReflect ¶
func (x *Shop) ProtoReflect() protoreflect.Message
type UnimplementedDiscoveryServiceServer ¶
type UnimplementedDiscoveryServiceServer struct { }
UnimplementedDiscoveryServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedDiscoveryServiceServer) ListProducts ¶
func (UnimplementedDiscoveryServiceServer) ListProducts(context.Context, *ListProductsRequest) (*ListProductsResponse, error)
type UnsafeDiscoveryServiceServer ¶
type UnsafeDiscoveryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDiscoveryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServiceServer will result in compilation errors.