2020-09-22 06:51:47 +00:00
|
|
|
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 {
|
2020-10-01 12:12:39 +00:00
|
|
|
filters objectSDK.SearchFilters
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|
|
|
|
|
2020-10-01 12:12:39 +00:00
|
|
|
func New(filters objectSDK.SearchFilters) query.Query {
|
2020-09-22 06:51:47 +00:00
|
|
|
return &Query{
|
|
|
|
filters: filters,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func idValue(id *objectSDK.ID) string {
|
2020-10-21 15:49:07 +00:00
|
|
|
return id.String()
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func cidValue(id *container.ID) string {
|
2020-10-21 15:49:07 +00:00
|
|
|
return id.String()
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func ownerIDValue(id *owner.ID) string {
|
2020-10-21 15:49:07 +00:00
|
|
|
return id.String()
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (q *Query) ToSearchFilters() objectSDK.SearchFilters {
|
2020-10-01 12:12:39 +00:00
|
|
|
return q.filters
|
2020-09-22 06:51:47 +00:00
|
|
|
}
|