Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for extractPathPrefixAndSuffix (0.23 sec)

  1. cmd/iam-etcd-store.go

    )
    
    var defaultContextTimeout = 30 * time.Second
    
    func etcdKvsToSet(prefix string, kvs []*mvccpb.KeyValue) set.StringSet {
    	users := set.NewStringSet()
    	for _, kv := range kvs {
    		user := extractPathPrefixAndSuffix(string(kv.Key), prefix, path.Base(string(kv.Key)))
    		users.Add(user)
    	}
    	return users
    }
    
    // Extract path string by stripping off the `prefix` value and the suffix,
    // value, usually in the following form.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  2. cmd/iam-etcd-store_test.go

    		{"config/iam/groups/foo/config.json", "config/iam/groups/", "/config.json", "foo"},
    		{"config/iam/groups/foo/config.json", "config/iam/groups/", "config.json", "foo"},
    	}
    	for i, test := range specs {
    		result := extractPathPrefixAndSuffix(test.path, test.prefix, test.suffix)
    		if result != test.expected {
    			t.Errorf("unexpected result on test[%v]: expected[%s] but had [%s]", i, test.expected, result)
    		}
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 1.5K bytes
    - Viewed (0)
Back to top