Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 140 for Unmarshal (0.16 sec)

  1. 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)
  2. cmd/xl-storage-format-v1.go

    		Algorithm: c.Algorithm.String(),
    		Hash:      hex.EncodeToString(c.Hash),
    	}
    	return json.Marshal(info)
    }
    
    // UnmarshalJSON - custom checksum info unmarshaller
    func (c *ChecksumInfo) UnmarshalJSON(data []byte) error {
    	var info checksumInfoJSON
    	json := jsoniter.ConfigCompatibleWithStandardLibrary
    	if err := json.Unmarshal(data, &info); err != nil {
    		return err
    	}
    	sum, err := hex.DecodeString(info.Hash)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  3. internal/bucket/lifecycle/rule_test.go

    			expectedErr: errInvalidRuleDelMarkerExpiration,
    		},
    	}
    
    	for i, tc := range invalidTestCases {
    		t.Run(fmt.Sprintf("Test %d", i+1), func(t *testing.T) {
    			var rule Rule
    			err := xml.Unmarshal([]byte(tc.inputXML), &rule)
    			if err != nil {
    				t.Fatal(err)
    			}
    
    			if err := rule.Validate(); err != tc.expectedErr {
    				t.Fatalf("%d: Expected %v but got %v", i+1, tc.expectedErr, err)
    			}
    		})
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 01:11:10 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  4. 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)
  5. common-protos/k8s.io/apimachinery/pkg/runtime/generated.proto

    //
    // 	{
    // 		"kind":"MyAPIObject",
    // 		"apiVersion":"v1",
    // 		"myPlugin": {
    // 			"kind":"PluginA",
    // 			"aOption":"foo",
    // 		},
    // 	}
    //
    // So what happens? Decode first uses json or yaml to unmarshal the serialized data into
    // your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
    // The next step is to copy (using pkg/conversion) into the internal struct. The runtime
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. cmd/object-handlers_test.go

    	if err != nil {
    		t.Fatalf("[%s] Failed to read NewMultipartUpload response <ERROR> %v", instanceType, err)
    	}
    	err = xml.Unmarshal(mpartRespBytes, &mpartResp)
    	if err != nil {
    		t.Fatalf("[%s] Failed to unmarshal NewMultipartUpload response <ERROR> %v", instanceType, err)
    	}
    
    	noAPIErr := APIError{}
    	missingDateHeaderErr := getAPIError(ErrMissingDateHeader)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 160K bytes
    - Viewed (0)
  9. internal/store/queuestore.go

    	eventData, err = os.ReadFile(filepath.Join(store.directory, key+store.fileExt))
    	if err != nil {
    		return item, err
    	}
    
    	if len(eventData) == 0 {
    		return item, os.ErrNotExist
    	}
    
    	if err = json.Unmarshal(eventData, &item); err != nil {
    		return item, err
    	}
    
    	return item, nil
    }
    
    // Del - Deletes an entry from the store.
    func (store *QueueStore[_]) Del(key string) error {
    	store.Lock()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  10. cmd/format-erasure_test.go

    	}
    
    	b, err = os.ReadFile(pathJoin(rootPath, minioMetaBucket, formatConfigFile))
    	if err != nil {
    		t.Fatal(err)
    	}
    	formatV3 := &formatErasureV3{}
    	if err = json.Unmarshal(b, formatV3); err != nil {
    		t.Fatal(err)
    	}
    	if formatV3.Erasure.This != m.Erasure.Disk {
    		t.Fatalf("expected drive uuid: %s, got: %s", m.Erasure.Disk, formatV3.Erasure.This)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.9K bytes
    - Viewed (0)
Back to top