Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 57 for Unmarshal (0.55 sec)

  1. cmd/format-erasure.go

    	for _, set := range f.Erasure.Sets {
    		drives += len(set)
    	}
    	return drives
    }
    
    func (f *formatErasureV3) Clone() *formatErasureV3 {
    	b, err := json.Marshal(f)
    	if err != nil {
    		panic(err)
    	}
    	var dst formatErasureV3
    	if err = json.Unmarshal(b, &dst); err != nil {
    		panic(err)
    	}
    	return &dst
    }
    
    // Returns formatErasure.Erasure.Version
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 03 15:54:03 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  2. cmd/xl-storage-format_test.go

    }
    
    // Tests the correctness of constructing XLMetaV1 using jsoniter lib.
    // The result will be compared with the result obtained from json.unMarshal of the byte data.
    func TestGetXLMetaV1Jsoniter1(t *testing.T) {
    	xlMetaJSON := getXLMetaBytes(1)
    
    	var unMarshalXLMeta xlMetaV1Object
    	if err := json.Unmarshal(xlMetaJSON, &unMarshalXLMeta); err != nil {
    		t.Errorf("Unmarshalling failed: %v", err)
    	}
    
    	var jsoniterXLMeta xlMetaV1Object
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 17.6K bytes
    - Viewed (0)
  3. docs/debugging/xl-meta/main.go

    						if err != nil {
    							return err
    						}
    						// Quote string...
    						b, _ := json.Marshal(file.Name)
    						b2, err := decode(r, file.Name)
    						if err != nil {
    							return err
    						}
    						var tmp map[string]interface{}
    						if err := json.Unmarshal(b2, &tmp); err == nil {
    							if b3, err := json.Marshal(tmp); err == nil {
    								b2 = b3
    							}
    						}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Apr 24 17:56:22 GMT 2024
    - 20.2K bytes
    - Viewed (1)
  4. cmd/batch-expire.go

    type BatchJobExpirePurge struct {
    	line, col      int
    	RetainVersions int `yaml:"retainVersions" json:"retainVersions"`
    }
    
    var _ yaml.Unmarshaler = &BatchJobExpirePurge{}
    
    // UnmarshalYAML - BatchJobExpirePurge extends unmarshal to extract line, col
    func (p *BatchJobExpirePurge) UnmarshalYAML(val *yaml.Node) error {
    	type purge BatchJobExpirePurge
    	var tmp purge
    	err := val.Decode(&tmp)
    	if err != nil {
    		return err
    	}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 21K bytes
    - Viewed (1)
  5. istioctl/pkg/workload/workload.go

    // fake go-client used for mocking cannot.)
    func unstructureIstioType(spec any) (map[string]any, error) {
    	b, err := yaml.Marshal(spec)
    	if err != nil {
    		return nil, err
    	}
    	iSpec := map[string]any{}
    	err = yaml.Unmarshal(b, &iSpec)
    	if err != nil {
    		return nil, err
    	}
    	return iSpec, nil
    }
    
    func convertToUnsignedInt32Map(s []string) map[string]uint32 {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Apr 17 20:06:41 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  6. internal/grid/types.go

    			}
    		}
    	}
    	return
    }
    
    // JSONPool is a pool for JSON objects that unmarshal into T.
    type JSONPool[T any] struct {
    	pool    sync.Pool
    	emptySz int
    }
    
    // NewJSONPool returns a new JSONPool.
    func NewJSONPool[T any]() *JSONPool[T] {
    	var t T
    	sz := 128
    	if b, err := json.Marshal(t); err != nil {
    		sz = len(b)
    	}
    	return &JSONPool[T]{
    		pool: sync.Pool{
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Apr 01 23:42:09 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  7. internal/event/name.go

    	return nil
    }
    
    // MarshalJSON - encodes to JSON data.
    func (name Name) MarshalJSON() ([]byte, error) {
    	return json.Marshal(name.String())
    }
    
    // UnmarshalJSON - decodes JSON data.
    func (name *Name) UnmarshalJSON(data []byte) error {
    	var s string
    	if err := json.Unmarshal(data, &s); err != nil {
    		return err
    	}
    
    	eventName, err := ParseName(s)
    	if err != nil {
    		return err
    	}
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 01:11:10 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  8. cmd/server-main.go

    	cfReader := bytes.NewReader(rd)
    
    	cv := config.ServerConfigVersion{}
    	if err = yaml.Unmarshal(rd, &cv); err != nil {
    		return err
    	}
    
    	switch cv.Version {
    	case "v1", "v2":
    	default:
    		return fmt.Errorf("unexpected version: %s", cv.Version)
    	}
    
    	cfCommon := config.ServerConfigCommon{}
    	if err = yaml.Unmarshal(rd, &cfCommon); err != nil {
    		return err
    	}
    
    	configCommonToSrvCtx(cfCommon, ctxt)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 03 15:54:03 GMT 2024
    - 34.9K bytes
    - Viewed (1)
  9. cmd/bucket-targets.go

    	if len(cmetadata) != 0 {
    		if err := json.Unmarshal(cmetadata, &meta); err != nil {
    			return nil, err
    		}
    		if crypto.S3.IsEncrypted(meta) {
    			if data, err = decryptBucketMetadata(cdata, bucket, meta, kms.Context{
    				bucket:            bucket,
    				bucketTargetsFile: bucketTargetsFile,
    			}); err != nil {
    				return nil, err
    			}
    		}
    	}
    
    	if err = json.Unmarshal(data, &t); err != nil {
    		return nil, err
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 01:09:56 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  10. internal/grid/handlers.go

    		},
    	}
    	return func() RT { return pool.Get().(RT) },
    		func(r RT) {
    			if r != rZero {
    				pool.Put(r)
    			}
    		}
    }
    
    // NewSingleHandler creates a typed handler that can provide Marshal/Unmarshal.
    // Use Register to register a server handler.
    // Use Call to initiate a clientside call.
    func NewSingleHandler[Req, Resp RoundTripper](h HandlerID, newReq func() Req, newResp func() Resp) *SingleHandler[Req, Resp] {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 27.1K bytes
    - Viewed (0)
Back to top