- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 73 for newDecoder (0.09 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
internal/s3select/jstream/decoder_test.go
func TestDecoderSimple(t *testing.T) { var ( counter int mv *MetaValue body = `[{"bio":"bada bing bada boom","id":1,"name":"Charles","falseVal":false}]` ) decoder := NewDecoder(mkReader(body), 1) for mv = range decoder.Stream() { counter++ t.Logf("depth=%d offset=%d len=%d (%v)", mv.Depth, mv.Offset, mv.Length, mv.Value) } if err := decoder.Err(); err != nil {
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 6.6K bytes - Click Count (0) -
internal/config/policy/opa/config.go
type opaResult struct { Result bool `json:"result"` } respBody := bytes.NewReader(opaRespBytes) var result opaResult if err = json.NewDecoder(respBody).Decode(&result); err != nil { respBody.Seek(0, 0) var resultAllow opaResultAllow if err = json.NewDecoder(respBody).Decode(&resultAllow); err != nil { return false, err } return resultAllow.Result.Allow, nil } return result.Result, nilCreated: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 5.3K bytes - Click Count (0) -
internal/s3select/jstream/README.md
<img width="85%" src="https://bradley.codes/static/img/jstream-levels.gif" alt="jstream"/> we can choose to extract and act only the objects within the top-level array: ```go f, _ := os.Open("input.json") decoder := jstream.NewDecoder(f, 1) // extract JSON values at a depth level of 1 for mv := range decoder.Stream() { fmt.Printf("%v\n ", mv.Value) } ``` output: ``` map[desc:RGB colors:[red green blue]]
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Mon Sep 23 19:35:41 GMT 2024 - 3.2K bytes - Click Count (0) -
internal/config/identity/openid/provider/keycloak.go
} req.Header.Set("Content-Type", "application/x-www-form-urlencoded") resp, err := k.client.Do(req) if err != nil { return err } defer resp.Body.Close() var accessToken Token if err = json.NewDecoder(resp.Body).Decode(&accessToken); err != nil { return err } k.Lock() k.accessToken = accessToken k.Unlock() return nil } // LookupUser lookup user by their userid.
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Jul 14 18:12:07 GMT 2024 - 4.6K bytes - Click Count (0) -
cmd/storage-datatypes_test.go
MountPath: "/tmp/drive1", ID: "uuid", Error: "", } var buf bytes.Buffer gob.NewEncoder(&buf).Encode(v) encoded := buf.Bytes() b.Log("Size:", buf.Len(), "bytes") b.SetBytes(1) b.ReportAllocs() for b.Loop() { dec := gob.NewDecoder(bytes.NewBuffer(encoded)) err := dec.Decode(&v) if err != nil { b.Fatal(err) } } }
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 9.1K bytes - Click Count (0) -
internal/config/policy/plugin/config.go
type opaResult struct { Result bool `json:"result"` } respBody := bytes.NewReader(opaRespBytes) var result opaResult if err = json.NewDecoder(respBody).Decode(&result); err != nil { respBody.Seek(0, 0) var resultAllow opaResultAllow if err = json.NewDecoder(respBody).Decode(&resultAllow); err != nil { return false, err } return resultAllow.Result.Allow, nil } return result.Result, nilCreated: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 5.8K bytes - Click Count (0) -
cmd/postpolicyform.go
// keys, so we need to use this technique to merge the // keys. func sanitizePolicy(r io.Reader) (io.Reader, error) { var buf bytes.Buffer e := json.NewEncoder(&buf) d := jstream.NewDecoder(r, 0).ObjectAsKVS().MaxDepth(10) sset := set.NewStringSet() for mv := range d.Stream() { if mv.ValueType == jstream.Object { // This is a JSON object type (that preserves key order)
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Thu Oct 23 15:10:12 GMT 2025 - 12.1K bytes - Click Count (0) -
schema/serializer.go
switch v := dbValue.(type) { case []byte: bytesValue = v default: return fmt.Errorf("failed to unmarshal gob value: %#v", dbValue) } if len(bytesValue) > 0 { decoder := gob.NewDecoder(bytes.NewBuffer(bytesValue)) err = decoder.Decode(fieldValue.Interface()) } } field.ReflectValueOf(ctx, dst).Set(fieldValue.Elem()) return } // Value implements serializer interfaceCreated: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Sun Oct 26 12:29:44 GMT 2025 - 5.1K bytes - Click Count (0) -
internal/config/identity/openid/jwt.go
) type publicKeys struct { *sync.RWMutex // map of kid to public key pkMap map[string]any } func (pk *publicKeys) parseAndAdd(b io.Reader) error { var jwk JWKS err := json.NewDecoder(b).Decode(&jwk) if err != nil { return err } for _, key := range jwk.Keys { pkey, err := key.DecodePublicKey() if err != nil { return err } pk.add(key.Kid, pkey) }Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 8.4K bytes - Click Count (0) -
internal/s3select/sql/jsonpath_test.go
"os" "path/filepath" "reflect" "testing" "github.com/alecthomas/participle" "github.com/minio/minio/internal/s3select/jstream" ) func getJSONStructs(b []byte) ([]any, error) { dec := jstream.NewDecoder(bytes.NewBuffer(b), 0).ObjectAsKVS().MaxDepth(100) var result []any for parsedVal := range dec.Stream() { result = append(result, parsedVal.Value) } if err := dec.Err(); err != nil { return nil, err }
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Fri Aug 29 02:39:48 GMT 2025 - 2.7K bytes - Click Count (0)