Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 180 for Unmarshal (0.19 sec)

  1. internal/config/identity/openid/jwks_test.go

    	var jk JWKS
    	if err := json.Unmarshal([]byte(jsonkey), &jk); err != nil {
    		t.Fatal("Unmarshal: ", err)
    	} else if len(jk.Keys) != 3 {
    		t.Fatalf("Expected 3 keys, got %d", len(jk.Keys))
    	}
    
    	var kids []string
    	for ii, jks := range jk.Keys {
    		_, err := jks.DecodePublicKey()
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 9.8K bytes
    - Viewed (0)
  2. internal/event/targetid.go

    }
    
    // MarshalJSON - encodes to JSON data.
    func (tid TargetID) MarshalJSON() ([]byte, error) {
    	return json.Marshal(tid.String())
    }
    
    // UnmarshalJSON - decodes JSON data.
    func (tid *TargetID) UnmarshalJSON(data []byte) error {
    	var s string
    	if err := json.Unmarshal(data, &s); err != nil {
    		return err
    	}
    
    	targetID, err := parseTargetID(s)
    	if err != nil {
    		return err
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 1.8K bytes
    - Viewed (0)
  3. istioctl/pkg/writer/ztunnel/configdump/configdump_test.go

    )
    
    func TestConfigWriter_Prime(t *testing.T) {
    	tests := []struct {
    		name        string
    		wantConfigs int
    		inputFile   string
    		wantErr     bool
    	}{
    		{
    			name:        "errors if unable to unmarshal bytes",
    			inputFile:   "",
    			wantConfigs: 0,
    			wantErr:     true,
    		},
    		{
    			name:        "loads valid ztunnel config_dump",
    			inputFile:   "testdata/dump.json",
    			wantConfigs: 27,
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Feb 02 18:21:48 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  4. internal/config/policy/plugin/config.go

    }
    
    // UnmarshalJSON - decodes JSON data.
    func (a *Args) UnmarshalJSON(data []byte) error {
    	// subtype to avoid recursive call to UnmarshalJSON()
    	type subArgs Args
    	var so subArgs
    
    	if err := json.Unmarshal(data, &so); err != nil {
    		return err
    	}
    
    	oa := Args(so)
    	if oa.URL == nil || oa.URL.String() == "" {
    		*a = oa
    		return nil
    	}
    
    	*a = oa
    	return nil
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Sep 14 21:50:16 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  5. internal/bucket/lifecycle/transition_test.go

    			input: `<Transition>
    			<Days>1</Days>
    		  </Transition>`,
    			err: errXMLNotWellFormed,
    		},
    	}
    
    	for i, tc := range trTests {
    		var tr Transition
    		err := xml.Unmarshal([]byte(tc.input), &tr)
    		if err != nil {
    			t.Fatalf("%d: xml unmarshal failed with %v", i+1, err)
    		}
    		if err = tr.Validate(); err != tc.err {
    			t.Fatalf("%d: Invalid transition %v: err %v", i+1, tr, err)
    		}
    	}
    
    	ntrTests := []struct {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Oct 01 18:58:17 GMT 2021
    - 2.3K bytes
    - Viewed (0)
  6. cmd/batch-job-common-types.go

    type BatchJobSize int64
    
    // UnmarshalYAML to parse humanized byte values
    func (s *BatchJobSize) UnmarshalYAML(unmarshal func(interface{}) error) error {
    	var batchExpireSz string
    	err := unmarshal(&batchExpireSz)
    	if err != nil {
    		return err
    	}
    	sz, err := humanize.ParseBytes(batchExpireSz)
    	if err != nil {
    		return err
    	}
    	*s = BatchJobSize(sz)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 01 21:53:26 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  7. internal/event/config_test.go

    		{[]byte(`<FilterRule><Name>suffix</Name><Value>foo/bar</Value></FilterRule>`), &FilterRule{"suffix", "foo/bar"}, false},
    	}
    
    	for i, testCase := range testCases {
    		result := &FilterRule{}
    		err := xml.Unmarshal(testCase.data, result)
    		expectErr := (err != nil)
    
    		if expectErr != testCase.expectErr {
    			t.Fatalf("test %v: error: expected: %v, got: %v", i+1, testCase.expectErr, expectErr)
    		}
    
    		if !testCase.expectErr {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Dec 05 10:16:33 GMT 2023
    - 29K bytes
    - Viewed (0)
  8. cmd/xl-storage-format-v1.go

    		Algorithm: c.Algorithm.String(),
    		Hash:      hex.EncodeToString(c.Hash),
    	}
    	return json.Marshal(info)
    }
    
    // UnmarshalJSON - custom checksum info unmarshaller
    func (c *ChecksumInfo) UnmarshalJSON(data []byte) error {
    	var info checksumInfoJSON
    	json := jsoniter.ConfigCompatibleWithStandardLibrary
    	if err := json.Unmarshal(data, &info); err != nil {
    		return err
    	}
    	sum, err := hex.DecodeString(info.Hash)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  9. internal/bucket/lifecycle/filter_test.go

    		},
    		ObjectSizeGreaterThan: 100 * humanize.MiByte,
    		ObjectSizeLessThan:    100 * humanize.GiByte,
    	}
    	b, err := xml.Marshal(f1)
    	if err != nil {
    		t.Fatalf("Failed to marshal %v", f1)
    	}
    	var f2 Filter
    	err = xml.Unmarshal(b, &f2)
    	if err != nil {
    		t.Fatalf("Failed to unmarshal %s", string(b))
    	}
    	if f1.ObjectSizeLessThan != f2.ObjectSizeLessThan {
    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)
  10. tests/scanner_valuer_test.go

    type StringsSlice []string
    
    func (l StringsSlice) Value() (driver.Value, error) {
    	bytes, err := json.Marshal(l)
    	return string(bytes), err
    }
    
    func (l *StringsSlice) Scan(input interface{}) error {
    	switch value := input.(type) {
    	case string:
    		return json.Unmarshal([]byte(value), l)
    	case []byte:
    		return json.Unmarshal(value, l)
    	default:
    		return errors.New("not supported")
    	}
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
Back to top