MCPcopy
hub / github.com/minio/minio-go / ToXML

Method ToXML

pkg/cors/cors.go:82–91  ·  view source on GitHub ↗

ToXML marshals the CORS configuration to XML.

()

Source from the content-addressed store, hash-verified

80
81// ToXML marshals the CORS configuration to XML.
82func (c Config) ToXML() ([]byte, error) {
83 if c.XMLNS == "" {
84 c.XMLNS = defaultXMLNS
85 }
86 data, err := xml.Marshal(&c)
87 if err != nil {
88 return nil, fmt.Errorf("marshaling xml: %w", err)
89 }
90 return append([]byte(xml.Header), data...), nil
91}

Callers 2

putBucketCorsMethod · 0.80
TestCORSXMLMarshalFunction · 0.80

Calls 1

MarshalMethod · 0.65

Tested by 1

TestCORSXMLMarshalFunction · 0.64