Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewDocumentDecoder (0.73 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder_test.go

    	dd := strings.Repeat(d, 512*1024)
    	r := NewDocumentDecoder(io.NopCloser(bytes.NewReader([]byte(dd[:maxLen-1]))))
    	b := make([]byte, bufferLen)
    	n, err := r.Read(b)
    	if err != io.ErrShortBuffer {
    		t.Fatalf("expected ErrShortBuffer: %d / %v", n, err)
    	}
    	b = make([]byte, maxLen)
    	n, err = r.Read(b)
    	if err != nil {
    		t.Fatalf("expected nil: %d / %v", n, err)
    	}
    	r = NewDocumentDecoder(io.NopCloser(bytes.NewReader([]byte(dd))))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 10 07:29:34 UTC 2023
    - 12.4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/yaml/decoder.go

    	scanner   *bufio.Scanner
    	remaining []byte
    }
    
    // NewDocumentDecoder decodes YAML documents from the provided
    // stream in chunks by converting each document (as defined by
    // the YAML spec) into its own chunk. io.ErrShortBuffer will be
    // returned if the entire buffer could not be read to assist
    // the caller in framing the chunk.
    func NewDocumentDecoder(r io.ReadCloser) io.ReadCloser {
    	scanner := bufio.NewScanner(r)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 19 21:24:36 UTC 2021
    - 10.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go

    }
    
    // NewFrameReader implements stream framing for this serializer
    func (yamlFramer) NewFrameReader(r io.ReadCloser) io.ReadCloser {
    	// extract the YAML document chunks directly
    	return utilyaml.NewDocumentDecoder(r)
    }
    
    type yamlFrameWriter struct {
    	w io.Writer
    }
    
    // Write separates each document with the YAML document separator (`---` followed by line
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 25 16:08:07 UTC 2022
    - 12K bytes
    - Viewed (0)
Back to top