From ebff07aaf2040f2ef48490ad54eee78295659e21 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 1 Feb 2021 20:57:18 +0300 Subject: [PATCH] [#254] object: Support new values of search match type Support STRING_NOT_EQUAL and NOT_PRESENT match types of object search filters. Signed-off-by: Leonard Lyubich --- pkg/object/search.go | 10 ++++++++++ pkg/object/search_test.go | 6 ++++-- v2/object/grpc/service.pb.go | Bin 148258 -> 148476 bytes v2/object/grpc/types.pb.go | Bin 39466 -> 39930 bytes v2/object/types.go | 2 ++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/object/search.go b/pkg/object/search.go index 5d59e1a8..208fcf48 100644 --- a/pkg/object/search.go +++ b/pkg/object/search.go @@ -15,12 +15,18 @@ type SearchMatchType uint32 const ( MatchUnknown SearchMatchType = iota MatchStringEqual + MatchStringNotEqual + MatchNotPresent ) func (m SearchMatchType) ToV2() v2object.MatchType { switch m { case MatchStringEqual: return v2object.MatchStringEqual + case MatchStringNotEqual: + return v2object.MatchStringNotEqual + case MatchNotPresent: + return v2object.MatchNotPresent default: return v2object.MatchUnknown } @@ -30,6 +36,10 @@ func SearchMatchFromV2(t v2object.MatchType) (m SearchMatchType) { switch t { case v2object.MatchStringEqual: m = MatchStringEqual + case v2object.MatchStringNotEqual: + m = MatchStringNotEqual + case v2object.MatchNotPresent: + m = MatchNotPresent default: m = MatchUnknown } diff --git a/pkg/object/search_test.go b/pkg/object/search_test.go index 48291060..573d06be 100644 --- a/pkg/object/search_test.go +++ b/pkg/object/search_test.go @@ -12,8 +12,10 @@ import ( var ( eqV2Matches = map[object.SearchMatchType]v2object.MatchType{ - object.MatchUnknown: v2object.MatchUnknown, - object.MatchStringEqual: v2object.MatchStringEqual, + object.MatchUnknown: v2object.MatchUnknown, + object.MatchStringEqual: v2object.MatchStringEqual, + object.MatchStringNotEqual: v2object.MatchStringNotEqual, + object.MatchNotPresent: v2object.MatchNotPresent, } ) diff --git a/v2/object/grpc/service.pb.go b/v2/object/grpc/service.pb.go index 890ac9667e663017800588a9130482ca0e5e3830..8f0ea63caece9536a2f8cf28fbb25b8a9e62c902 100644 GIT binary patch delta 236 zcmX|*v2MaJ6h+mMe#ISF+w6>$SOaRabRw?(Qa>PeWIqy^I#i+)>ckK51#J9HzNAA< zkl3ztq;u|RKl=L_oqzkUEPKo{Ih vG{GxvpRd9fvZ`et&{=XwKvNuE4vH102fn&rPRdQnRP4xnANtFoe>j?d7U@=0 delta 26 icmey<&bg?Kb3^|<=90>S$q%oJG&kJe-f*9>CItYsb`5a= diff --git a/v2/object/grpc/types.pb.go b/v2/object/grpc/types.pb.go index 1109640a283dca2a61a9516325c559934f00c67f..b7fdd95af57aa785ec2b18d38f8d0a8c64d05ab1 100644 GIT binary patch delta 552 zcmZ3rh3VIJrVT1w^_=?p3T~x2ISR!kMVWc&3b~oZxrrso8C;ycAS$G?AT>TXB*@dx zJ>JhhB;GYJ)X_%)E~Q|rV8jJ7!Y45~TOmJ9Av?7aStm$KK#*&&t6vC;CSxv5E-s)p z*U39rg(ur_WodF6St%%?Tco7J#mQ+5lt40P@)E8rYfen1RtgYc1k!`7K?x=UmN(wa z&HbW~$;@E$*P1v+5kn%nDh6A)>T2xc2h{#C20#>Ht+VVVXKFi8cIV74h(AynK{ zM`5yVonk%22ry{?Rs}K0APMLa+}ceIK*pMawV42o0jzoWFhJy zj!6VtFgdkOol#+OU!5rv7w6<7b()h;l<`mgTc-}TBqST4usNgQkR$+4R-4!W delta 136 zcmeyhooUq;rVT1wlQ*(TP2R?pHQARtZSzO&r-e+$mYZ+X#xV+*80jb&RG6fJNYg|e zg~`SZnoL}rlVcl985Jf^fpGSLIbR{1i+Ku@?HffWp9^4P1!^)*nmjQ;9;BtA5u{~% Yqvqt>