forked from TrueCloudLab/frostfs-node
32219bb294
This function duplicates query processing that is done in meta-storage now. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
34 lines
676 B
Go
34 lines
676 B
Go
package query
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-api-go/pkg/container"
|
|
objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object"
|
|
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/object/search/query"
|
|
)
|
|
|
|
type Query struct {
|
|
filters objectSDK.SearchFilters
|
|
}
|
|
|
|
func New(filters objectSDK.SearchFilters) query.Query {
|
|
return &Query{
|
|
filters: filters,
|
|
}
|
|
}
|
|
|
|
func idValue(id *objectSDK.ID) string {
|
|
return id.String()
|
|
}
|
|
|
|
func cidValue(id *container.ID) string {
|
|
return id.String()
|
|
}
|
|
|
|
func ownerIDValue(id *owner.ID) string {
|
|
return id.String()
|
|
}
|
|
|
|
func (q *Query) ToSearchFilters() objectSDK.SearchFilters {
|
|
return q.filters
|
|
}
|