Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for MarshalJSON (0.25 sec)

  1. istioctl/pkg/util/proto/messageslice.go

    )
    
    // MessageSlice allows us to marshal slices of protobuf messages like clusters/listeners/routes/endpoints correctly
    type MessageSlice []proto.Message
    
    // MarshalJSON handles marshaling of slices of proto messages
    func (pSlice MessageSlice) MarshalJSON() ([]byte, error) {
    	buffer := bytes.NewBufferString("[")
    	sliceLength := len(pSlice)
    	for index, msg := range pSlice {
    		b, err := protomarshal.Marshal(msg)
    		if err != nil {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Oct 19 21:53:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  2. internal/event/targetid.go

    	return tid.ID + ":" + tid.Name
    }
    
    // ToARN - converts to ARN.
    func (tid TargetID) ToARN(region string) ARN {
    	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
    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. istioctl/pkg/util/clusters/wrapper.go

    // Wrapper is a wrapper around the Envoy Clusters
    // It has extra helper functions for handling any/struct/marshal protobuf pain
    type Wrapper struct {
    	*admin.Clusters
    }
    
    // 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 {
    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)
  4. internal/config/lambda/event/targetid.go

    	return tid.ID + ":" + tid.Name
    }
    
    // ToARN - converts to ARN.
    func (tid TargetID) ToARN(region string) ARN {
    	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
    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)
  5. internal/config/bool-flag.go

    type BoolFlag bool
    
    // String - returns string of BoolFlag.
    func (bf BoolFlag) String() string {
    	if bf {
    		return "on"
    	}
    
    	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
    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. internal/s3select/simdj/record.go

    		if err != nil {
    			return nil, err
    		}
    		return sql.FromBool(v), nil
    	case simdjson.TypeNull:
    		return sql.FromNull(), nil
    	case simdjson.TypeObject, simdjson.TypeArray:
    		b, err := iter.MarshalJSON()
    		return sql.FromBytes(b), err
    	}
    	return nil, fmt.Errorf("iterToValue: unknown JSON type: %s", iter.Type().String())
    }
    
    // Reset the record.
    func (r *Record) Reset() {
    	r.object = simdjson.Object{}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 5.4K bytes
    - Viewed (0)
  7. internal/config/bool-flag_test.go

    		}
    	}
    }
    
    // Test BoolFlag.MarshalJSON()
    func TestBoolFlagMarshalJSON(t *testing.T) {
    	var bf BoolFlag
    
    	testCases := []struct {
    		flag           BoolFlag
    		expectedResult string
    	}{
    		{bf, `"off"`},
    		{BoolFlag(true), `"on"`},
    		{BoolFlag(false), `"off"`},
    	}
    
    	for _, testCase := range testCases {
    		data, _ := testCase.flag.MarshalJSON()
    		if testCase.expectedResult != string(data) {
    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. cmd/xl-storage-format-v1.go

    }
    
    type checksumInfoJSON struct {
    	Name      string `json:"name"`
    	Algorithm string `json:"algorithm"`
    	Hash      string `json:"hash,omitempty"`
    }
    
    // MarshalJSON marshals the ChecksumInfo struct
    func (c ChecksumInfo) MarshalJSON() ([]byte, error) {
    	info := checksumInfoJSON{
    		Name:      fmt.Sprintf("part.%d", c.PartNumber),
    		Algorithm: c.Algorithm.String(),
    		Hash:      hex.EncodeToString(c.Hash),
    	}
    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)
  9. internal/s3select/json/record.go

    	"github.com/minio/minio/internal/s3select/sql"
    )
    
    // RawJSON is a byte-slice that contains valid JSON
    type RawJSON []byte
    
    // MarshalJSON instance for []byte that assumes that byte-slice is
    // already serialized JSON
    func (b RawJSON) MarshalJSON() ([]byte, error) {
    	return b, nil
    }
    
    // Record - is JSON record.
    type Record struct {
    	// Used in Set(), Marshal*()
    	KVS jstream.KVS
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  10. internal/event/name.go

    		return err
    	}
    
    	eventName, err := ParseName(s)
    	if err != nil {
    		return err
    	}
    
    	*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
    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