- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for UnmarshalCBOR (0.2 sec)
-
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
if err != nil { return err } pt, err := time.Parse(RFC3339Micro, str) if err != nil { return err } t.Time = pt.Local() return nil } func (t *MicroTime) UnmarshalCBOR(b []byte) error { var s *string if err := cbor.Unmarshal(b, &s); err != nil { return err } if s == nil { t.Time = time.Time{} return 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) -
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:09 UTC 2024 - 5.2K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go
if value[0] == '"' { intstr.Type = String return json.Unmarshal(value, &intstr.StrVal) } intstr.Type = Int return json.Unmarshal(value, &intstr.IntVal) } func (intstr *IntOrString) UnmarshalCBOR(value []byte) error { if err := cbor.Unmarshal(value, &intstr.StrVal); err == nil { intstr.Type = String return nil } if err := cbor.Unmarshal(value, &intstr.IntVal); err != nil { return err }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:09 UTC 2024 - 7.8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time_test.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:10 UTC 2024 - 11.1K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:09 UTC 2024 - 9.4K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go
}, } { t.Run(fmt.Sprintf("{Type:%d,IntVal:%d,StrVal:%q}", tc.want.Type, tc.want.IntVal, tc.want.StrVal), func(t *testing.T) { var got IntOrString err := got.UnmarshalCBOR(tc.in) if tc.assertOnError != nil { tc.assertOnError(t, err) } else if err != nil { t.Fatalf("unexpected error: %v", err) } if diff := cmp.Diff(got, tc.want); diff != "" {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:09 UTC 2024 - 14.3K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor_test.go
} func (anyObject) DeepCopyObject() runtime.Object { panic("unimplemented") } func (p anyObject) MarshalCBOR() ([]byte, error) { return modes.Encode.Marshal(p.Value) } func (p *anyObject) UnmarshalCBOR(in []byte) error { return modes.Decode.Unmarshal(in, &p.Value) } func TestEncode(t *testing.T) { for _, tc := range []struct { name string in runtime.Object
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Mon May 13 14:57:12 UTC 2024 - 20.1K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
if err != nil { return err } // This copy is safe because parsed will not be referred to again. *q = parsed return nil } func (q *Quantity) UnmarshalCBOR(value []byte) error { var s *string if err := cbor.Unmarshal(value, &s); err != nil { return err } if s == nil { q.d.Dec = nil q.i = int64Amount{} return nil }
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:10 UTC 2024 - 23.8K bytes - Viewed (0) -
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go
in: []byte{0x07}, // 7 errMessage: "cbor: cannot unmarshal positive integer into Go value of type string", }, } { t.Run(tc.name, func(t *testing.T) { var got Quantity if err := got.UnmarshalCBOR(tc.in); err != nil { if tc.errMessage == "" { t.Fatalf("want nil error, got: %v", err) } else if gotMessage := err.Error(); tc.errMessage != gotMessage {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Wed May 29 21:48:10 UTC 2024 - 49.4K bytes - Viewed (0)