Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for PathKV (0.12 sec)

  1. operator/pkg/util/path.go

    	if !ok {
    		return false
    	}
    
    	n, err := strconv.Atoi(pe)
    	return err == nil && n >= InsertIndex
    }
    
    // PathKV returns the key and value string parts of the entire key/value path element.
    // It returns an error if pe is not a key/value path element.
    func PathKV(pe string) (k, v string, err error) {
    	if !IsKVPathElement(pe) {
    		return "", "", fmt.Errorf("%s is not a valid key:value path element", pe)
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Dec 12 17:12:54 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  2. operator/pkg/util/path_test.go

    		},
    		{
    			desc:    "empty",
    			in:      "",
    			wantErr: errors.New(""),
    		},
    	}
    
    	for _, tt := range tests {
    		t.Run(tt.desc, func(t *testing.T) {
    			if k, v, err := PathKV(tt.in); k != tt.wantK || v != tt.wantV || errNilCheck(err, tt.wantErr) {
    				t.Errorf("%s: expect %v %v %v got %v %v %v", tt.desc, tt.wantK, tt.wantV, tt.wantErr, k, v, err)
    			}
    		})
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Aug 29 00:15:38 UTC 2020
    - 6.7K bytes
    - Viewed (0)
  3. operator/pkg/tpath/tree.go

    		// must have map type, and try to find one which has a matching key:value.
    		for idx, le := range lst {
    			// non-leaf list, expect to match item by key:value.
    			if lm, ok := le.(map[any]any); ok {
    				k, v, err := util.PathKV(pe)
    				if err != nil {
    					return nil, false, fmt.Errorf("path %s: %s", fullPath, err)
    				}
    				if stringsEqual(lm[k], v) {
    					scope.Debugf("found matching kv %v:%v", k, v)
    					nn := &PathContext{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 17.5K bytes
    - Viewed (0)
  4. operator/pkg/translate/translate.go

    			break
    		}
    
    		if util.IsKVPathElement(pe) {
    			currentNode, ok := currentNode.([]any)
    			if !ok {
    				return nil, fmt.Errorf("path %s has an unexpected KV element %s", path, pe)
    			}
    			k, v, err := util.PathKV(pe)
    			if err != nil {
    				return nil, err
    			}
    			if k == "" || v == "" {
    				return nil, fmt.Errorf("path %s has an invalid KV element %s", path, pe)
    			}
    			currentNode[0] = map[string]any{k: v}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Feb 12 19:43:09 UTC 2024
    - 36.3K bytes
    - Viewed (0)
Back to top