mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
Initial work for xml list objects
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package minioapi
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMinioApi(t *testing.T) {
|
||||
owner := Owner{
|
||||
ID: "MyID",
|
||||
DisplayName: "MyDisplayName",
|
||||
}
|
||||
contents := []Content{
|
||||
Content{
|
||||
Key: "one",
|
||||
LastModified: "two",
|
||||
ETag: "\"ETag\"",
|
||||
Size: 1,
|
||||
StorageClass: "three",
|
||||
Owner: owner,
|
||||
},
|
||||
Content{
|
||||
Key: "four",
|
||||
LastModified: "five",
|
||||
ETag: "\"ETag\"",
|
||||
Size: 1,
|
||||
StorageClass: "six",
|
||||
Owner: owner,
|
||||
},
|
||||
}
|
||||
data := &ListResponse{
|
||||
Name: "name",
|
||||
Contents: contents,
|
||||
}
|
||||
|
||||
xmlEncoder := xml.NewEncoder(os.Stdout)
|
||||
if err := xmlEncoder.Encode(data); err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
fmt.Println("")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user