Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for UnmarshalJSON (0.28 sec)

  1. internal/config/policy/opa/config.go

    	resp, err := client.Do(req)
    	if err != nil {
    		return err
    	}
    	defer a.CloseRespFn(resp.Body)
    
    	return nil
    }
    
    // UnmarshalJSON - decodes JSON data.
    func (a *Args) UnmarshalJSON(data []byte) error {
    	// subtype to avoid recursive call to UnmarshalJSON()
    	type subArgs Args
    	var so subArgs
    
    	if err := json.Unmarshal(data, &so); err != nil {
    		return err
    	}
    
    	oa := Args(so)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Sep 14 21:50:16 GMT 2023
    - 5.2K bytes
    - Viewed (1)
  2. internal/event/targetid.go

    	return ARN{TargetID: tid, region: region}
    }
    
    // MarshalJSON - encodes to JSON data.
    func (tid TargetID) MarshalJSON() ([]byte, error) {
    	return json.Marshal(tid.String())
    }
    
    // UnmarshalJSON - decodes JSON data.
    func (tid *TargetID) UnmarshalJSON(data []byte) error {
    	var s string
    	if err := json.Unmarshal(data, &s); err != nil {
    		return err
    	}
    
    	targetID, err := parseTargetID(s)
    	if err != nil {
    		return err
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 1.8K bytes
    - Viewed (0)
  3. internal/config/policy/plugin/config.go

    	resp, err := client.Do(req)
    	if err != nil {
    		return err
    	}
    	defer a.CloseRespFn(resp.Body)
    
    	return nil
    }
    
    // UnmarshalJSON - decodes JSON data.
    func (a *Args) UnmarshalJSON(data []byte) error {
    	// subtype to avoid recursive call to UnmarshalJSON()
    	type subArgs Args
    	var so subArgs
    
    	if err := json.Unmarshal(data, &so); err != nil {
    		return err
    	}
    
    	oa := Args(so)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Sep 14 21:50:16 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  4. istioctl/pkg/util/configdump/wrapper.go

    // Wrapper is a wrapper around the Envoy ConfigDump
    // It has extra helper functions for handling any/struct/marshal protobuf pain
    type Wrapper struct {
    	*admin.ConfigDump
    }
    
    // UnmarshalJSON is a custom unmarshaller to handle protobuf pain
    func (w *Wrapper) UnmarshalJSON(b []byte) error {
    	cd := &admin.ConfigDump{}
    	err := protomarshal.UnmarshalAllowUnknownWithAnyResolver(nonStrictResolver, b, cd)
    	*w = Wrapper{cd}
    	return err
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sun Apr 21 17:42:54 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. internal/config/bool-flag.go

    	}
    
    	return "off"
    }
    
    // MarshalJSON - converts BoolFlag into JSON data.
    func (bf BoolFlag) MarshalJSON() ([]byte, error) {
    	return json.Marshal(bf.String())
    }
    
    // UnmarshalJSON - parses given data into BoolFlag.
    func (bf *BoolFlag) UnmarshalJSON(data []byte) (err error) {
    	var s string
    	if err = json.Unmarshal(data, &s); err == nil {
    		b := BoolFlag(true)
    		if s == "" {
    			// Empty string is treated as valid.
    			*bf = b
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 07 15:10:40 GMT 2022
    - 2.3K bytes
    - Viewed (0)
  6. istioctl/pkg/util/clusters/wrapper.go

    }
    
    // MarshalJSON is a custom marshaller to handle protobuf pain
    func (w *Wrapper) MarshalJSON() ([]byte, error) {
    	return protomarshal.Marshal(w)
    }
    
    // UnmarshalJSON is a custom unmarshaller to handle protobuf pain
    func (w *Wrapper) UnmarshalJSON(b []byte) error {
    	cd := &admin.Clusters{}
    	err := protomarshal.UnmarshalAllowUnknown(b, cd)
    	*w = Wrapper{cd}
    	return err
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Nov 03 08:41:32 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  7. internal/config/bool-flag_test.go

    		data, _ := testCase.flag.MarshalJSON()
    		if testCase.expectedResult != string(data) {
    			t.Fatalf("expected: %v, got: %v", testCase.expectedResult, string(data))
    		}
    	}
    }
    
    // Test BoolFlag.UnmarshalJSON()
    func TestBoolFlagUnmarshalJSON(t *testing.T) {
    	testCases := []struct {
    		data           []byte
    		expectedResult BoolFlag
    		expectedErr    bool
    	}{
    		{[]byte(`{}`), BoolFlag(false), true},
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 3.5K bytes
    - Viewed (0)
  8. internal/config/lambda/event/targetid.go

    	return ARN{TargetID: tid, region: region}
    }
    
    // MarshalJSON - encodes to JSON data.
    func (tid TargetID) MarshalJSON() ([]byte, error) {
    	return json.Marshal(tid.String())
    }
    
    // UnmarshalJSON - decodes JSON data.
    func (tid *TargetID) UnmarshalJSON(data []byte) error {
    	var s string
    	if err := json.Unmarshal(data, &s); err != nil {
    		return err
    	}
    
    	targetID, err := parseTargetID(s)
    	if err != nil {
    		return err
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Mar 07 16:12:41 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  9. cmd/xl-storage-format-v1.go

    		Name:      fmt.Sprintf("part.%d", c.PartNumber),
    		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
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  10. internal/event/name.go

    	*name = eventName
    	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 Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 08 17:45:03 GMT 2024
    - 10.2K bytes
    - Viewed (0)
Back to top