Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for NewSerializer (0.31 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructuredscheme/scheme.go

    			MediaTypeSubType: "json",
    			EncodesAsText:    true,
    			Serializer:       json.NewSerializer(json.DefaultMetaFactory, s.creator, s.typer, false),
    			PrettySerializer: json.NewSerializer(json.DefaultMetaFactory, s.creator, s.typer, true),
    			StreamSerializer: &runtime.StreamSerializerInfo{
    				EncodesAsText: true,
    				Serializer:    json.NewSerializer(json.DefaultMetaFactory, s.creator, s.typer, false),
    				Framer:        json.Framer,
    			},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 27 12:37:23 UTC 2020
    - 4.2K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/encoder_with_allocator_test.go

    	"k8s.io/apimachinery/pkg/runtime/serializer/protobuf"
    )
    
    func BenchmarkProtobufEncoder(b *testing.B) {
    	benchmarkEncodeFor(b, protobuf.NewSerializer(nil, nil))
    }
    
    func BenchmarkProtobufEncodeWithAllocator(b *testing.B) {
    	benchmarkEncodeWithAllocatorFor(b, protobuf.NewSerializer(nil, nil))
    }
    
    func BenchmarkRawProtobufEncoder(b *testing.B) {
    	benchmarkEncodeFor(b, protobuf.NewRawSerializer(nil, nil))
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 23 13:38:29 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/endpoints/filters/request_deadline_test.go

    			withDeadline := WithRequestDeadline(handler, fakeSink, fakeRuleEvaluator,
    				func(_ *http.Request, _ *request.RequestInfo) bool { return test.longRunning },
    				newSerializer(), requestTimeoutMaximum)
    			withDeadline = WithRequestInfo(withDeadline, &fakeRequestResolver{})
    
    			testRequest := newRequest(t, test.requestURL)
    
    			// make sure a default request does not have any deadline set
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 14 23:04:34 UTC 2022
    - 16.7K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/test/runtime_serializer_protobuf_protobuf_test.go

    	return len(d.data)
    }
    
    func (d *testBufferedMarshalable) DeepCopyObject() runtime.Object {
    	panic("testBufferedMarshalable does not support DeepCopy")
    }
    
    func TestRecognize(t *testing.T) {
    	s := protobuf.NewSerializer(nil, nil)
    	ignores := [][]byte{
    		nil,
    		{},
    		[]byte("k8s"),
    		{0x6b, 0x38, 0x73, 0x01},
    	}
    	for i, data := range ignores {
    		if ok, _, err := s.RecognizesData(data); err != nil || ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:16 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf_test.go

    	creater := &mockCreater{obj: &runtimetesting.MockCacheableObject{}}
    	typer := &mockTyper{gvk: &gvk}
    
    	encoders := []runtime.Encoder{
    		NewSerializer(creater, typer),
    		NewRawSerializer(creater, typer),
    	}
    
    	for _, encoder := range encoders {
    		runtimetesting.CacheableObjectTest(t, encoder)
    	}
    }
    
    type mockCreater struct {
    	apiVersion string
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 27 03:17:50 UTC 2022
    - 5K bytes
    - Viewed (0)
  6. pkg/api/testing/serialization_proto_test.go

    // reflection (to clear APIVersion and Kind)
    func BenchmarkEncodeCodecProtobuf(b *testing.B) {
    	items := benchmarkItems(b)
    	width := len(items)
    	s := protobuf.NewSerializer(nil, nil)
    	b.ResetTimer()
    	for i := 0; i < b.N; i++ {
    		if _, err := runtime.Encode(s, &items[i%width]); err != nil {
    			b.Fatal(err)
    		}
    	}
    	b.StopTimer()
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 7.1K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor.go

    	creater     runtime.ObjectCreater
    	typer       runtime.ObjectTyper
    	options     options
    }
    
    func NewSerializer(creater runtime.ObjectCreater, typer runtime.ObjectTyper, options ...Option) Serializer {
    	return newSerializer(&defaultMetaFactory{}, creater, typer, options...)
    }
    
    func newSerializer(metaFactory metaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper, options ...Option) *serializer {
    	s := &serializer{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 14:57:12 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/recognizer/testing/recognizer_test.go

    func (a A) DeepCopyObject() runtime.Object {
    	return a
    }
    
    func TestRecognizer(t *testing.T) {
    	s := runtime.NewScheme()
    	s.AddKnownTypes(schema.GroupVersion{Version: "v1"}, &A{})
    	d := recognizer.NewDecoder(
    		json.NewSerializer(json.DefaultMetaFactory, s, s, false),
    		json.NewYAMLSerializer(json.DefaultMetaFactory, s, s),
    	)
    	out, _, err := d.Decode([]byte(`
    kind: A
    apiVersion: v1
    `), nil, nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 18 07:28:47 UTC 2017
    - 1.5K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor_test.go

    			recognizes: true,
    		},
    		{
    			in:         []byte{0xff, 0xff, 0xff, 0x01, 0x02, 0x03},
    			recognizes: false,
    		},
    	} {
    		t.Run(hex.EncodeToString(tc.in), func(t *testing.T) {
    			s := NewSerializer(nil, nil)
    			recognizes, unknown, err := s.RecognizesData(tc.in)
    			if recognizes != tc.recognizes {
    				t.Errorf("expected recognized to be %t, got %t", tc.recognizes, recognizes)
    			}
    			if unknown {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 14:57:12 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/plugin/pkg/audit/webhook/webhook_test.go

    // The object passed to cb is of the same type as list.
    func newWebhookHandler(t *testing.T, list runtime.Object, cb func(events runtime.Object)) http.Handler {
    	s := json.NewSerializer(json.DefaultMetaFactory, audit.Scheme, audit.Scheme, false)
    	return &testWebhookHandler{
    		t:          t,
    		list:       list,
    		onEvents:   cb,
    		serializer: s,
    	}
    }
    
    type testWebhookHandler struct {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 08 06:37:26 UTC 2022
    - 3.9K bytes
    - Viewed (0)
Back to top