Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for EmitKV (0.05 sec)

  1. internal/s3select/jstream/decoder.go

    func (d *Decoder) ObjectAsKVS() *Decoder {
    	d.objectAsKVS = true
    	return d
    }
    
    // EmitKV enables emitting a jstream.KV struct when the items(s) parsed
    // at configured emit depth are within a JSON object. By default, only
    // the object values are emitted.
    func (d *Decoder) EmitKV() *Decoder {
    	d.emitKV = true
    	return d
    }
    
    // Recursive enables emitting all values at a depth higher than the
    Registered: Sun Oct 27 19:28:09 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  2. internal/s3select/jstream/decoder_test.go

    		t.Fatalf("expected 0 keyvalue items, got %d", kvcounter)
    	}
    	if counter != 15 {
    		t.Fatalf("expected 15 items, got %d", counter)
    	}
    
    	// test at depth level 1 w/ emitKV
    	counter = 0
    	kvcounter = 0
    	decoder = NewDecoder(mkReader(body), 1).EmitKV()
    
    	for mv = range decoder.Stream() {
    		switch mv.Value.(type) {
    		case KV:
    			kvcounter++
    		default:
    			counter++
    		}
    Registered: Sun Oct 27 19:28:09 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  3. internal/s3select/jstream/README.md

    ```
    red
    green
    blue
    cyan
    magenta
    yellow
    black
    ```
    
    optionally, kev:value pairs can be emitted as an individual struct:
    ```go
    decoder := jstream.NewDecoder(f, 2).EmitKV() // enable KV streaming at a depth level of 2
    ```
    
    ```
    jstream.KV{desc RGB}
    jstream.KV{colors [red green blue]}
    jstream.KV{desc CMYK}
    jstream.KV{colors [cyan magenta yellow black]}
    ```
    
    ## Installing 
    Registered: Sun Oct 27 19:28:09 UTC 2024
    - Last Modified: Mon Sep 23 19:35:41 UTC 2024
    - 3.2K bytes
    - Viewed (0)
Back to top