Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 85 for marshal1 (0.35 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go

    }
    
    // MarshalJSON implements the json.Marshaler interface.
    func (t MicroTime) MarshalJSON() ([]byte, error) {
    	if t.IsZero() {
    		// Encode unset/nil objects as JSON's "null".
    		return []byte("null"), nil
    	}
    
    	return json.Marshal(t.UTC().Format(RFC3339Micro))
    }
    
    func (t MicroTime) MarshalCBOR() ([]byte, error) {
    	if t.IsZero() {
    		return cbor.Marshal(nil)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  2. src/hash/crc32/crc32_test.go

    			if h.Sum32() != h2.Sum32() {
    				t.Errorf("Castagnoli(%s) = 0x%x != marshaled 0x%x", g.in, h.Sum32(), h2.Sum32())
    			}
    		}
    	})
    }
    
    func TestMarshalTableMismatch(t *testing.T) {
    	h1 := New(IEEETable)
    	h2 := New(MakeTable(Castagnoli))
    
    	state1, err := h1.(encoding.BinaryMarshaler).MarshalBinary()
    	if err != nil {
    		t.Errorf("could not marshal: %v", err)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go

    	buf = t.UTC().AppendFormat(buf, time.RFC3339)
    	buf = append(buf, '"')
    	return buf, nil
    }
    
    func (t Time) MarshalCBOR() ([]byte, error) {
    	if t.IsZero() {
    		return cbor.Marshal(nil)
    	}
    
    	return cbor.Marshal(t.UTC().Format(time.RFC3339))
    }
    
    // ToUnstructured implements the value.UnstructuredConverter interface.
    func (t Time) ToUnstructured() interface{} {
    	if t.IsZero() {
    		return nil
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  4. pilot/pkg/config/kube/crdclient/client.go

    	}
    }
    
    func genPatchBytes(oldRes, modRes runtime.Object, patchType types.PatchType) ([]byte, error) {
    	oldJSON, err := json.Marshal(oldRes)
    	if err != nil {
    		return nil, fmt.Errorf("failed marhsalling original resource: %v", err)
    	}
    	newJSON, err := json.Marshal(modRes)
    	if err != nil {
    		return nil, fmt.Errorf("failed marhsalling modified resource: %v", err)
    	}
    	switch patchType {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jun 14 00:12:28 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  5. pkg/config/model.go

    		}
    	}
    
    	b := &bytes.Buffer{}
    	// gogo protobuf
    	if pb, ok := s.(gogoproto.Message); ok {
    		err := (&gogojsonpb.Marshaler{Indent: indent}).Marshal(b, pb)
    		return b.Bytes(), err
    	}
    	if pretty {
    		return json.MarshalIndent(s, "", indent)
    	}
    	return json.Marshal(s)
    }
    
    type deepCopier interface {
    	DeepCopyInterface() any
    }
    
    func ApplyYAML(s Spec, yml string) error {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 29 15:31:09 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  6. staging/src/k8s.io/api/core/v1/generated.pb.go

    }
    
    func (m *AWSElasticBlockStoreVolumeSource) Marshal() (dAtA []byte, err error) {
    	size := m.Size()
    	dAtA = make([]byte, size)
    	n, err := m.MarshalToSizedBuffer(dAtA[:size])
    	if err != nil {
    		return nil, err
    	}
    	return dAtA[:n], nil
    }
    
    func (m *AWSElasticBlockStoreVolumeSource) MarshalTo(dAtA []byte) (int, error) {
    	size := m.Size()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 1.8M bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go

    	}
    
    	for _, c := range cases {
    		input := TimeHolder{c.input}
    		result, err := yaml.Marshal(&input)
    		if err != nil {
    			t.Errorf("Failed to marshal input: '%v': %v", input, err)
    		}
    		if string(result) != c.result {
    			t.Errorf("Failed to marshal input: '%v': expected %+v, got %q", input, c.result, string(result))
    		}
    	}
    }
    
    func TestTimeUnmarshalYAML(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go

    	}
    
    	for _, c := range cases {
    		input := MicroTimeHolder{c.input}
    		result, err := yaml.Marshal(&input)
    		if err != nil {
    			t.Errorf("Failed to marshal input: '%v': %v", input, err)
    		}
    		if string(result) != c.result {
    			t.Errorf("Failed to marshal input: '%v': expected %+v, got %q", input, c.result, string(result))
    		}
    	}
    }
    
    func TestMicroTimeUnmarshalYAML(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:10 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  9. cni/pkg/nodeagent/cni-watcher_test.go

    	}
    
    	payload, _ := json.Marshal(valid)
    
    	addEvent, err := processAddEvent(payload)
    
    	assert.NoError(t, err)
    	assert.Equal(t, valid, addEvent)
    }
    
    func TestProcessAddEventBadPayload(t *testing.T) {
    	valid := CNIPluginAddEvent{
    		Netns:        "/var/netns/foo",
    		PodName:      "pod-bingo",
    		PodNamespace: "funkyns",
    	}
    
    	payload, _ := json.Marshal(valid)
    
    	invalid := string(payload) + "funkyjunk"
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 21:31:35 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go

    		{FromString("123"), "{\"val\":\"123\"}"},
    	}
    
    	for _, c := range cases {
    		input := IntOrStringHolder{c.input}
    		result, err := json.Marshal(&input)
    		if err != nil {
    			t.Errorf("Failed to marshal input '%v': %v", input, err)
    		}
    		if string(result) != c.result {
    			t.Errorf("Failed to marshal input '%v': expected: %+v, got %q", input, c.result, string(result))
    		}
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 14.3K bytes
    - Viewed (0)
Back to top