Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for TestTags (0.2 sec)

  1. internal/bucket/replication/filter.go

    		}
    	}
    	if !f.Tag.IsEmpty() {
    		if err := f.Tag.Validate(); err != nil {
    			return err
    		}
    	}
    	return nil
    }
    
    // TestTags tests if the object tags satisfy the Filter tags requirement,
    // it returns true if there is no tags in the underlying Filter.
    func (f *Filter) TestTags(userTags string) bool {
    	if f.cachedTags == nil {
    		cached := make(map[string]string)
    		for _, t := range append(f.And.Tags, f.Tag) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Sep 28 18:25:46 GMT 2022
    - 3.5K bytes
    - Viewed (2)
  2. internal/bucket/lifecycle/filter.go

    		}
    	case sizeGtPred:
    		if f.ObjectSizeGreaterThan < 0 {
    			err = errXMLNotWellFormed
    		}
    	}
    	return err
    }
    
    // TestTags tests if the object tags satisfy the Filter tags requirement,
    // it returns true if there is no tags in the underlying Filter.
    func (f Filter) TestTags(userTags string) bool {
    	if f.cachedTags == nil {
    		cache := make(map[string]string)
    		for _, t := range append(f.And.Tags, f.Tag) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Feb 27 00:01:20 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  3. internal/bucket/lifecycle/filter_test.go

    		},
    		{
    			filter:   twoTags,
    			userTags: "BAR=2&FOO=1",
    			want:     true,
    		},
    	}
    	for i, test := range tests {
    		t.Run(fmt.Sprintf("Test %d", i+1), func(t *testing.T) {
    			if got := test.filter.TestTags(test.userTags); got != test.want {
    				t.Errorf("Expected %v but got %v", test.want, got)
    			}
    		})
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Feb 27 00:01:20 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  4. internal/bucket/replication/replication.go

    			continue
    		}
    		if obj.ExistingObject && rule.ExistingObjectReplication.Status == Disabled {
    			continue
    		}
    		if !strings.HasPrefix(obj.Name, rule.Prefix()) {
    			continue
    		}
    		if rule.Filter.TestTags(obj.UserTags) {
    			rules = append(rules, rule)
    		}
    	}
    	sort.Slice(rules, func(i, j int) bool {
    		return rules[i].Priority > rules[j].Priority && rules[i].Destination.String() == rules[j].Destination.String()
    	})
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Mar 28 17:44:56 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  5. internal/bucket/lifecycle/lifecycle.go

    	for _, rule := range lc.Rules {
    		if rule.Status == Disabled {
    			continue
    		}
    		if !strings.HasPrefix(obj.Name, rule.GetPrefix()) {
    			continue
    		}
    		if !obj.DeleteMarker && !rule.Filter.TestTags(obj.UserTags) {
    			continue
    		}
    		if !obj.DeleteMarker && !rule.Filter.BySize(obj.Size) {
    			continue
    		}
    		rules = append(rules, rule)
    	}
    	return rules
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 06:41:22 GMT 2024
    - 17K bytes
    - Viewed (0)
Back to top