From 31b1bed5d78b840a17e71569f8fa65e5e34af6df Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 27 Oct 2020 18:11:36 +0300 Subject: [PATCH] [#182] v2/object: Define reserved search filter keys Signed-off-by: Leonard Lyubich --- v2/object/filters.go | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 v2/object/filters.go diff --git a/v2/object/filters.go b/v2/object/filters.go new file mode 100644 index 0000000..24209af --- /dev/null +++ b/v2/object/filters.go @@ -0,0 +1,44 @@ +package object + +// ReservedFilterPrefix is a prefix of key to object header value or property. +const ReservedFilterPrefix = "$Object:" + +const ( + // FilterHeaderVersion is a filter key to "version" field of the object header. + FilterHeaderVersion = ReservedFilterPrefix + "version" + + // FilterHeaderContainerID is a filter key to "container_id" field of the object header. + FilterHeaderContainerID = ReservedFilterPrefix + "containerID" + + // FilterHeaderOwnerID is a filter key to "owner_id" field of the object header. + FilterHeaderOwnerID = ReservedFilterPrefix + "ownerID" + + // FilterHeaderCreationEpoch is a filter key to "creation_epoch" field of the object header. + FilterHeaderCreationEpoch = ReservedFilterPrefix + "creationEpoch" + + // FilterHeaderPayloadLength is a filter key to "payload_length" field of the object header. + FilterHeaderPayloadLength = ReservedFilterPrefix + "payloadLength" + + // FilterHeaderPayloadHash is a filter key to "payload_hash" field of the object header. + FilterHeaderPayloadHash = ReservedFilterPrefix + "payloadHash" + + // FilterHeaderObjectType is a filter key to "object_type" field of the object header. + FilterHeaderObjectType = ReservedFilterPrefix + "objectType" + + // FilterHeaderHomomorphicHash is a filter key to "homomorphic_hash" field of the object header. + FilterHeaderHomomorphicHash = ReservedFilterPrefix + "homomorphicHash" + + // FilterHeaderParent is a filter key to "split.parent" field of the object header. + FilterHeaderParent = ReservedFilterPrefix + "split.parent" +) + +const ( + // FilterPropertyRoot is a filter key to check if an object is a top object in a split hierarchy. + FilterPropertyRoot = ReservedFilterPrefix + "ROOT" + + // FilterPropertyLeaf is a filter key to check if an object is a leaf in a split hierarchy. + FilterPropertyLeaf = ReservedFilterPrefix + "LEAF" + + // FilterPropertyChildfree is a filter key to check if an object has empty children list in `Split` header. + FilterPropertyChildfree = ReservedFilterPrefix + "CHILDFREE" +)