Documentation ¶
Overview ¶
Package searchpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSearchServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSearchServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SearchServiceClient) error
- func RegisterSearchServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSearchServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SearchServiceServer) error
- func RegisterSearchServiceServer(s grpc.ServiceRegistrar, srv SearchServiceServer)
- type GetOrderRequest
- type GetOrderResponse
- type Order
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (x *Order) GetCustomerId() string
- func (x *Order) GetCustomerName() string
- func (x *Order) GetItems() []*Order_Item
- func (x *Order) GetOrderId() string
- func (x *Order) GetStatusHistory() []*Order_StatusHistory
- func (x *Order) GetTotal() float64
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (x *Order) String() string
- type Order_Item
- func (*Order_Item) Descriptor() ([]byte, []int)deprecated
- func (x *Order_Item) GetPrice() float64
- func (x *Order_Item) GetProductId() string
- func (x *Order_Item) GetProductName() string
- func (x *Order_Item) GetQuantity() int32
- func (x *Order_Item) GetStoreId() string
- func (x *Order_Item) GetStoreName() string
- func (*Order_Item) ProtoMessage()
- func (x *Order_Item) ProtoReflect() protoreflect.Message
- func (x *Order_Item) Reset()
- func (x *Order_Item) String() string
- type Order_StatusHistory
- func (*Order_StatusHistory) Descriptor() ([]byte, []int)deprecated
- func (x *Order_StatusHistory) GetStatus() string
- func (x *Order_StatusHistory) GetWhen() *timestamppb.Timestamp
- func (*Order_StatusHistory) ProtoMessage()
- func (x *Order_StatusHistory) ProtoReflect() protoreflect.Message
- func (x *Order_StatusHistory) Reset()
- func (x *Order_StatusHistory) String() string
- type SearchOrdersRequest
- func (*SearchOrdersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchOrdersRequest) GetFilters() *SearchOrdersRequest_Filters
- func (x *SearchOrdersRequest) GetLimit() int32
- func (x *SearchOrdersRequest) GetNext() string
- func (*SearchOrdersRequest) ProtoMessage()
- func (x *SearchOrdersRequest) ProtoReflect() protoreflect.Message
- func (x *SearchOrdersRequest) Reset()
- func (x *SearchOrdersRequest) String() string
- type SearchOrdersRequest_Filters
- func (*SearchOrdersRequest_Filters) Descriptor() ([]byte, []int)deprecated
- func (x *SearchOrdersRequest_Filters) GetAfter() *timestamppb.Timestamp
- func (x *SearchOrdersRequest_Filters) GetBefore() *timestamppb.Timestamp
- func (x *SearchOrdersRequest_Filters) GetCustomerId() string
- func (x *SearchOrdersRequest_Filters) GetMaxTotal() float64
- func (x *SearchOrdersRequest_Filters) GetMinTotal() float64
- func (x *SearchOrdersRequest_Filters) GetProductIds() []string
- func (x *SearchOrdersRequest_Filters) GetStatus() string
- func (x *SearchOrdersRequest_Filters) GetStoreIds() []string
- func (*SearchOrdersRequest_Filters) ProtoMessage()
- func (x *SearchOrdersRequest_Filters) ProtoReflect() protoreflect.Message
- func (x *SearchOrdersRequest_Filters) Reset()
- func (x *SearchOrdersRequest_Filters) String() string
- type SearchOrdersResponse
- func (*SearchOrdersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SearchOrdersResponse) GetNext() string
- func (x *SearchOrdersResponse) GetOrders() []*Order
- func (*SearchOrdersResponse) ProtoMessage()
- func (x *SearchOrdersResponse) ProtoReflect() protoreflect.Message
- func (x *SearchOrdersResponse) Reset()
- func (x *SearchOrdersResponse) String() string
- type SearchServiceClient
- type SearchServiceServer
- type UnimplementedSearchServiceServer
- type UnsafeSearchServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_searchpb_api_proto protoreflect.FileDescriptor
var SearchService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "searchpb.SearchService", HandlerType: (*SearchServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SearchOrders", Handler: _SearchService_SearchOrders_Handler, }, { MethodName: "GetOrder", Handler: _SearchService_GetOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "searchpb/api.proto", }
SearchService_ServiceDesc is the grpc.ServiceDesc for SearchService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSearchServiceHandler ¶
func RegisterSearchServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSearchServiceHandler registers the http handlers for service SearchService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSearchServiceHandlerClient ¶
func RegisterSearchServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SearchServiceClient) error
RegisterSearchServiceHandlerClient registers the http handlers for service SearchService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SearchServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SearchServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SearchServiceClient" to call the correct interceptors.
func RegisterSearchServiceHandlerFromEndpoint ¶
func RegisterSearchServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSearchServiceHandlerFromEndpoint is same as RegisterSearchServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSearchServiceHandlerServer ¶
func RegisterSearchServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SearchServiceServer) error
RegisterSearchServiceHandlerServer registers the http handlers for service SearchService to "mux". UnaryRPC :call SearchServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSearchServiceHandlerFromEndpoint instead.
func RegisterSearchServiceServer ¶
func RegisterSearchServiceServer(s grpc.ServiceRegistrar, srv SearchServiceServer)
Types ¶
type GetOrderRequest ¶
type GetOrderRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetOrderRequest) Descriptor
deprecated
func (*GetOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetOrderRequest.ProtoReflect.Descriptor instead.
func (*GetOrderRequest) GetId ¶
func (x *GetOrderRequest) GetId() string
func (*GetOrderRequest) ProtoMessage ¶
func (*GetOrderRequest) ProtoMessage()
func (*GetOrderRequest) ProtoReflect ¶
func (x *GetOrderRequest) ProtoReflect() protoreflect.Message
func (*GetOrderRequest) Reset ¶
func (x *GetOrderRequest) Reset()
func (*GetOrderRequest) String ¶
func (x *GetOrderRequest) String() string
type GetOrderResponse ¶
type GetOrderResponse struct { Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` // contains filtered or unexported fields }
func (*GetOrderResponse) Descriptor
deprecated
func (*GetOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetOrderResponse.ProtoReflect.Descriptor instead.
func (*GetOrderResponse) GetOrder ¶
func (x *GetOrderResponse) GetOrder() *Order
func (*GetOrderResponse) ProtoMessage ¶
func (*GetOrderResponse) ProtoMessage()
func (*GetOrderResponse) ProtoReflect ¶
func (x *GetOrderResponse) ProtoReflect() protoreflect.Message
func (*GetOrderResponse) Reset ¶
func (x *GetOrderResponse) Reset()
func (*GetOrderResponse) String ¶
func (x *GetOrderResponse) String() string
type Order ¶
type Order struct { OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` CustomerName string `protobuf:"bytes,3,opt,name=customer_name,json=customerName,proto3" json:"customer_name,omitempty"` Items []*Order_Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` Total float64 `protobuf:"fixed64,5,opt,name=total,proto3" json:"total,omitempty"` StatusHistory []*Order_StatusHistory `protobuf:"bytes,6,rep,name=status_history,json=statusHistory,proto3" json:"status_history,omitempty"` // contains filtered or unexported fields }
func (*Order) Descriptor
deprecated
func (*Order) GetCustomerId ¶
func (*Order) GetCustomerName ¶
func (*Order) GetItems ¶
func (x *Order) GetItems() []*Order_Item
func (*Order) GetOrderId ¶
func (*Order) GetStatusHistory ¶
func (x *Order) GetStatusHistory() []*Order_StatusHistory
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
type Order_Item ¶
type Order_Item struct { ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` StoreId string `protobuf:"bytes,2,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` ProductName string `protobuf:"bytes,3,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` StoreName string `protobuf:"bytes,4,opt,name=store_name,json=storeName,proto3" json:"store_name,omitempty"` Price float64 `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` Quantity int32 `protobuf:"varint,6,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*Order_Item) Descriptor
deprecated
func (*Order_Item) Descriptor() ([]byte, []int)
Deprecated: Use Order_Item.ProtoReflect.Descriptor instead.
func (*Order_Item) GetPrice ¶
func (x *Order_Item) GetPrice() float64
func (*Order_Item) GetProductId ¶
func (x *Order_Item) GetProductId() string
func (*Order_Item) GetProductName ¶
func (x *Order_Item) GetProductName() string
func (*Order_Item) GetQuantity ¶
func (x *Order_Item) GetQuantity() int32
func (*Order_Item) GetStoreId ¶
func (x *Order_Item) GetStoreId() string
func (*Order_Item) GetStoreName ¶
func (x *Order_Item) GetStoreName() string
func (*Order_Item) ProtoMessage ¶
func (*Order_Item) ProtoMessage()
func (*Order_Item) ProtoReflect ¶
func (x *Order_Item) ProtoReflect() protoreflect.Message
func (*Order_Item) Reset ¶
func (x *Order_Item) Reset()
func (*Order_Item) String ¶
func (x *Order_Item) String() string
type Order_StatusHistory ¶
type Order_StatusHistory struct { When *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=when,proto3" json:"when,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*Order_StatusHistory) Descriptor
deprecated
func (*Order_StatusHistory) Descriptor() ([]byte, []int)
Deprecated: Use Order_StatusHistory.ProtoReflect.Descriptor instead.
func (*Order_StatusHistory) GetStatus ¶
func (x *Order_StatusHistory) GetStatus() string
func (*Order_StatusHistory) GetWhen ¶
func (x *Order_StatusHistory) GetWhen() *timestamppb.Timestamp
func (*Order_StatusHistory) ProtoMessage ¶
func (*Order_StatusHistory) ProtoMessage()
func (*Order_StatusHistory) ProtoReflect ¶
func (x *Order_StatusHistory) ProtoReflect() protoreflect.Message
func (*Order_StatusHistory) Reset ¶
func (x *Order_StatusHistory) Reset()
func (*Order_StatusHistory) String ¶
func (x *Order_StatusHistory) String() string
type SearchOrdersRequest ¶
type SearchOrdersRequest struct { Filters *SearchOrdersRequest_Filters `protobuf:"bytes,1,opt,name=filters,proto3" json:"filters,omitempty"` Next string `protobuf:"bytes,2,opt,name=next,proto3" json:"next,omitempty"` Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // contains filtered or unexported fields }
func (*SearchOrdersRequest) Descriptor
deprecated
func (*SearchOrdersRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchOrdersRequest.ProtoReflect.Descriptor instead.
func (*SearchOrdersRequest) GetFilters ¶
func (x *SearchOrdersRequest) GetFilters() *SearchOrdersRequest_Filters
func (*SearchOrdersRequest) GetLimit ¶
func (x *SearchOrdersRequest) GetLimit() int32
func (*SearchOrdersRequest) GetNext ¶
func (x *SearchOrdersRequest) GetNext() string
func (*SearchOrdersRequest) ProtoMessage ¶
func (*SearchOrdersRequest) ProtoMessage()
func (*SearchOrdersRequest) ProtoReflect ¶
func (x *SearchOrdersRequest) ProtoReflect() protoreflect.Message
func (*SearchOrdersRequest) Reset ¶
func (x *SearchOrdersRequest) Reset()
func (*SearchOrdersRequest) String ¶
func (x *SearchOrdersRequest) String() string
type SearchOrdersRequest_Filters ¶
type SearchOrdersRequest_Filters struct { CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` After *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=after,proto3" json:"after,omitempty"` Before *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=before,proto3" json:"before,omitempty"` StoreIds []string `protobuf:"bytes,4,rep,name=store_ids,json=storeIds,proto3" json:"store_ids,omitempty"` ProductIds []string `protobuf:"bytes,5,rep,name=product_ids,json=productIds,proto3" json:"product_ids,omitempty"` MinTotal float64 `protobuf:"fixed64,6,opt,name=min_total,json=minTotal,proto3" json:"min_total,omitempty"` MaxTotal float64 `protobuf:"fixed64,7,opt,name=max_total,json=maxTotal,proto3" json:"max_total,omitempty"` Status string `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*SearchOrdersRequest_Filters) Descriptor
deprecated
func (*SearchOrdersRequest_Filters) Descriptor() ([]byte, []int)
Deprecated: Use SearchOrdersRequest_Filters.ProtoReflect.Descriptor instead.
func (*SearchOrdersRequest_Filters) GetAfter ¶
func (x *SearchOrdersRequest_Filters) GetAfter() *timestamppb.Timestamp
func (*SearchOrdersRequest_Filters) GetBefore ¶
func (x *SearchOrdersRequest_Filters) GetBefore() *timestamppb.Timestamp
func (*SearchOrdersRequest_Filters) GetCustomerId ¶
func (x *SearchOrdersRequest_Filters) GetCustomerId() string
func (*SearchOrdersRequest_Filters) GetMaxTotal ¶
func (x *SearchOrdersRequest_Filters) GetMaxTotal() float64
func (*SearchOrdersRequest_Filters) GetMinTotal ¶
func (x *SearchOrdersRequest_Filters) GetMinTotal() float64
func (*SearchOrdersRequest_Filters) GetProductIds ¶
func (x *SearchOrdersRequest_Filters) GetProductIds() []string
func (*SearchOrdersRequest_Filters) GetStatus ¶
func (x *SearchOrdersRequest_Filters) GetStatus() string
func (*SearchOrdersRequest_Filters) GetStoreIds ¶
func (x *SearchOrdersRequest_Filters) GetStoreIds() []string
func (*SearchOrdersRequest_Filters) ProtoMessage ¶
func (*SearchOrdersRequest_Filters) ProtoMessage()
func (*SearchOrdersRequest_Filters) ProtoReflect ¶
func (x *SearchOrdersRequest_Filters) ProtoReflect() protoreflect.Message
func (*SearchOrdersRequest_Filters) Reset ¶
func (x *SearchOrdersRequest_Filters) Reset()
func (*SearchOrdersRequest_Filters) String ¶
func (x *SearchOrdersRequest_Filters) String() string
type SearchOrdersResponse ¶
type SearchOrdersResponse struct { Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"` Next string `protobuf:"bytes,2,opt,name=next,proto3" json:"next,omitempty"` // contains filtered or unexported fields }
func (*SearchOrdersResponse) Descriptor
deprecated
func (*SearchOrdersResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchOrdersResponse.ProtoReflect.Descriptor instead.
func (*SearchOrdersResponse) GetNext ¶
func (x *SearchOrdersResponse) GetNext() string
func (*SearchOrdersResponse) GetOrders ¶
func (x *SearchOrdersResponse) GetOrders() []*Order
func (*SearchOrdersResponse) ProtoMessage ¶
func (*SearchOrdersResponse) ProtoMessage()
func (*SearchOrdersResponse) ProtoReflect ¶
func (x *SearchOrdersResponse) ProtoReflect() protoreflect.Message
func (*SearchOrdersResponse) Reset ¶
func (x *SearchOrdersResponse) Reset()
func (*SearchOrdersResponse) String ¶
func (x *SearchOrdersResponse) String() string
type SearchServiceClient ¶
type SearchServiceClient interface { SearchOrders(ctx context.Context, in *SearchOrdersRequest, opts ...grpc.CallOption) (*SearchOrdersResponse, error) GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*GetOrderResponse, error) }
SearchServiceClient is the client API for SearchService 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 NewSearchServiceClient ¶
func NewSearchServiceClient(cc grpc.ClientConnInterface) SearchServiceClient
type SearchServiceServer ¶
type SearchServiceServer interface { SearchOrders(context.Context, *SearchOrdersRequest) (*SearchOrdersResponse, error) GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error) // contains filtered or unexported methods }
SearchServiceServer is the server API for SearchService service. All implementations must embed UnimplementedSearchServiceServer for forward compatibility
type UnimplementedSearchServiceServer ¶
type UnimplementedSearchServiceServer struct { }
UnimplementedSearchServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedSearchServiceServer) GetOrder ¶
func (UnimplementedSearchServiceServer) GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error)
func (UnimplementedSearchServiceServer) SearchOrders ¶
func (UnimplementedSearchServiceServer) SearchOrders(context.Context, *SearchOrdersRequest) (*SearchOrdersResponse, error)
type UnsafeSearchServiceServer ¶
type UnsafeSearchServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSearchServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SearchServiceServer will result in compilation errors.