query: Move Query to object

Move Query message definition to object package since it is only used there.
Package query is completely removed from the repository.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-05 21:21:26 +03:00 committed by Stanislav Bogatyrev
parent d308f91872
commit c88d1fdae3
4 changed files with 62 additions and 125 deletions

View file

@ -140,10 +140,28 @@ message HeadResponse {
message SearchRequest { message SearchRequest {
// ContainerID carries search container identifier. // ContainerID carries search container identifier.
refs.ContainerID ContainerID = 1; refs.ContainerID ContainerID = 1;
// Query in the binary serialized format
bytes Query = 2; message Query {
// QueryVersion is a version of search query format uint32 Version = 1;
uint32 QueryVersion = 3;
message Filter {
enum MatchType {
MatchUnknown = 0;
StringEqual = 1;
}
MatchType matchType = 1;
string Name = 2;
string Value = 3;
}
repeated Filter Filters = 2;
}
Query query = 2;
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)

View file

@ -23,6 +23,8 @@
- [PutResponse](#object.PutResponse) - [PutResponse](#object.PutResponse)
- [Range](#object.Range) - [Range](#object.Range)
- [SearchRequest](#object.SearchRequest) - [SearchRequest](#object.SearchRequest)
- [SearchRequest.Query](#object.SearchRequest.Query)
- [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter)
- [SearchResponse](#object.SearchResponse) - [SearchResponse](#object.SearchResponse)
@ -328,12 +330,36 @@ in distributed system.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries search container identifier. | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries search container identifier. |
| Query | [bytes](#bytes) | | Query in the binary serialized format | | query | [SearchRequest.Query](#object.SearchRequest.Query) | | |
| QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format |
| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) |
| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) |
<a name="object.SearchRequest.Query"></a>
### Message SearchRequest.Query
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Version | [uint32](#uint32) | | |
| Filters | [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) | repeated | |
<a name="object.SearchRequest.Query.Filter"></a>
### Message SearchRequest.Query.Filter
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| matchType | [SearchRequest.Query.Filter.MatchType](#object.SearchRequest.Query.Filter.MatchType) | | |
| Name | [string](#string) | | |
| Value | [string](#string) | | |
<a name="object.SearchResponse"></a> <a name="object.SearchResponse"></a>
### Message SearchResponse ### Message SearchResponse
@ -347,6 +373,18 @@ in distributed system.
<!-- end messages --> <!-- end messages -->
<a name="object.SearchRequest.Query.Filter.MatchType"></a>
### SearchRequest.Query.Filter.MatchType
| Name | Number | Description |
| ---- | ------ | ----------- |
| MatchUnknown | 0 | |
| StringEqual | 1 | |
<!-- end enums --> <!-- end enums -->

View file

@ -1,86 +0,0 @@
# Protocol Documentation
<a name="top"></a>
## Table of Contents
- [query/types.proto](#query/types.proto)
- Messages
- [Filter](#query.Filter)
- [Query](#query.Query)
- [Scalar Value Types](#scalar-value-types)
<a name="query/types.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## query/types.proto
<!-- end services -->
<a name="query.Filter"></a>
### Message Filter
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [Filter.Type](#query.Filter.Type) | | Type of filter |
| Name | [string](#string) | | Name of field that should be filtered |
| Value | [string](#string) | | Value that should be used for filter |
<a name="query.Query"></a>
### Message Query
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Filters | [Filter](#query.Filter) | repeated | Filters is set of filters, should not be empty |
<!-- end messages -->
<a name="query.Filter.Type"></a>
### Filter.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
| Exact | 0 | Exact sets when value of filter should be equal to the header value |
| Regex | 1 | Regex sets when value of filter should match the header value by the regular expression |
<!-- end enums -->
## Scalar Value Types
| .proto Type | Notes | C++ Type | Java Type | Python Type |
| ----------- | ----- | -------- | --------- | ----------- |
| <a name="double" /> double | | double | double | float |
| <a name="float" /> float | | float | float | float |
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long |
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long |
| <a name="bool" /> bool | | bool | boolean | boolean |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |

View file

@ -1,33 +0,0 @@
syntax = "proto3";
package query;
option go_package = "github.com/nspcc-dev/neofs-api-go/query";
option csharp_namespace = "NeoFS.API.Query";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
message Filter {
option (gogoproto.goproto_stringer) = false;
enum Type {
// Exact sets when value of filter should be equal to the header value
Exact = 0;
// Regex sets when value of filter should match the header value by the regular expression
Regex = 1;
}
// Type of filter
Type type = 1 [(gogoproto.customname) = "Type"];
// Name of field that should be filtered
string Name = 2;
// Value that should be used for filter
string Value = 3;
}
message Query {
option (gogoproto.goproto_stringer) = false;
// Filters is set of filters, should not be empty
repeated Filter Filters = 1 [(gogoproto.nullable) = false];
}