Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for toMap (0.19 sec)

  1. cmd/data-usage-cache_test.go

    			},
    		},
    	}
    	for i, test := range tests {
    		t.Run(fmt.Sprintf("Test-%d", i), func(t *testing.T) {
    			var h sizeHistogram
    			for _, sz := range test.sizes {
    				h.add(sz)
    			}
    			got := h.toMap()
    			exp := test.want
    			// what is in exp is in got
    			for k := range exp {
    				if exp[k] != got[k] {
    					t.Fatalf("interval %s: Expected %d values but got %d values\n", k, exp[k], got[k])
    				}
    			}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Jan 13 07:51:08 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  2. internal/bucket/replication/filter.go

    	if len(f.cachedTags) == 0 {
    		return true
    	}
    
    	parsedTags, err := tags.ParseObjectTags(userTags)
    	if err != nil {
    		return false
    	}
    
    	tagsMap := parsedTags.ToMap()
    
    	// This filter has tags configured but this object
    	// does not have any tag, skip this object
    	if len(tagsMap) == 0 {
    		return false
    	}
    
    	// Both filter and object have tags, find a match,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Sep 28 18:25:46 GMT 2022
    - 3.5K bytes
    - Viewed (2)
  3. internal/bucket/lifecycle/filter.go

    	if len(f.cachedTags) == 0 {
    		return true
    	}
    
    	parsedTags, err := tags.ParseObjectTags(userTags)
    	if err != nil {
    		return false
    	}
    	tagsMap := parsedTags.ToMap()
    
    	// Not enough tags on object to satisfy the rule filter's tags
    	if len(tagsMap) < len(f.cachedTags) {
    		return false
    	}
    
    	var mismatch bool
    	for k, cv := range f.cachedTags {
    		v, ok := tagsMap[k]
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Feb 27 00:01:20 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  4. cmd/bucket-policy.go

    		cloneHeader.Del("x-amz-signature-age")
    	}
    
    	if userTags := cloneHeader.Get(xhttp.AmzObjectTagging); userTags != "" {
    		tag, _ := tags.ParseObjectTags(userTags)
    		if tag != nil {
    			tagMap := tag.ToMap()
    			keys := make([]string, 0, len(tagMap))
    			for k, v := range tagMap {
    				args[pathJoin("ExistingObjectTag", k)] = []string{v}
    				args[pathJoin("RequestObjectTag", k)] = []string{v}
    				keys = append(keys, k)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 8K bytes
    - Viewed (0)
  5. operator/cmd/mesh/manifest-generate_test.go

    		d := dobj.Unstructured()
    		c := dobj.Container("istio-proxy")
    		g.Expect(d).Should(HavePathValueContain(PathValue{"spec.template.metadata.labels", toMap("service.istio.io/canonical-revision:21")}))
    		g.Expect(d).Should(HavePathValueContain(PathValue{"metadata.labels", toMap("aaa:aaa-val,bbb:bbb-val")}))
    		g.Expect(c).Should(HavePathValueEqual(PathValue{"resources.requests.cpu", "111m"}))
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Thu Apr 18 18:16:49 GMT 2024
    - 43.5K bytes
    - Viewed (0)
  6. operator/cmd/mesh/test-util_test.go

    	g.Expect(err).Should(BeNil(), "path %s should exist (%s)", path, err)
    	g.Expect(f).Should(BeTrue(), "path %s should exist", path)
    	return got.Node
    }
    
    // toMap transforms a comma separated key:value list (e.g. "a:aval, b:bval") to a map.
    func toMap(s string) map[string]any {
    	out := make(map[string]any)
    	for _, l := range strings.Split(s, ",") {
    		l = strings.TrimSpace(l)
    		kv := strings.Split(l, ":")
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Oct 31 14:48:28 GMT 2023
    - 15.3K bytes
    - Viewed (0)
  7. cmd/batch-rotate.go

    			tagMap := map[string]string{}
    			tagStr := info.Metadata[xhttp.AmzObjectTagging]
    			if len(tagStr) != 0 {
    				t, err := tags.ParseObjectTags(tagStr)
    				if err != nil {
    					return false
    				}
    				tagMap = t.ToMap()
    			}
    
    			for _, kv := range r.Flags.Filter.Tags {
    				for t, v := range tagMap {
    					if kv.Match(BatchJobKV{Key: t, Value: v}) {
    						return true
    					}
    				}
    			}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14.2K bytes
    - Viewed (0)
  8. cmd/data-usage-cache.go

    		if intOld.start != intNew.start || intOld.end != intNew.end {
    			nidx++
    			continue
    		}
    		h[nidx] += v[oidx]
    		oidx++
    		nidx++
    	}
    }
    
    // toMap returns the map to a map[string]uint64.
    func (h *sizeHistogram) toMap() map[string]uint64 {
    	res := make(map[string]uint64, dataUsageBucketLen)
    	var splCount uint64
    	for i, count := range h {
    		szInt := ObjectsHistogramIntervals[i]
    		switch {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 41.4K bytes
    - Viewed (1)
  9. cmd/bucket-replication.go

    		if strings.Join(enc, ",") != oi1.ContentEncoding {
    			return replicateMetadata
    		}
    	}
    
    	t, _ := tags.ParseObjectTags(oi1.UserTags)
    	if (oi2.UserTagCount > 0 && !reflect.DeepEqual(oi2.UserTags, t.ToMap())) || (oi2.UserTagCount != len(t.ToMap())) {
    		return replicateMetadata
    	}
    
    	// Compare only necessary headers
    	compareKeys := []string{
    		"Expires",
    		"Cache-Control",
    		"Content-Language",
    		"Content-Disposition",
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 01:09:56 GMT 2024
    - 112.2K bytes
    - Viewed (1)
  10. cmd/batch-expire.go

    		var tagMap map[string]string
    		if len(obj.UserTags) != 0 {
    			t, err := tags.ParseObjectTags(obj.UserTags)
    			if err != nil {
    				return false
    			}
    			tagMap = t.ToMap()
    		}
    
    		for _, kv := range ef.Tags {
    			// Object (version) must match all tags specified in
    			// the filter
    			var match bool
    			for t, v := range tagMap {
    				if kv.Match(BatchJobKV{Key: t, Value: v}) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 21K bytes
    - Viewed (1)
Back to top