You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
751 B
45 lines
751 B
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("")
|
|
}
|
|
}
|
|
|