예제 #1
0
func (this *EurekaRequestGet) request(data interface{}, r render.Render, req *http.Request) {
	if req.URL.Query().Get("json") != "" {
		r.JSON(200, data)
	} else {
		r.XML(200, data)
	}
}
예제 #2
0
/*
ListContainers endpoint
https://msdn.microsoft.com/en-us/library/azure/dd179352.aspx

The List Containers operation returns a list of the containers under the specified account.
*/
func ListContainers(req *http.Request, r render.Render) {

	resp := ListContainersResponse{}

	resp.ServiceEndpoint = "fbs.local"
	resp.Marker = "test"

	resp.Containers = []ListContainersResponseContainer{
		ListContainersResponseContainer{
			Name: "test",
			Properties: ListContainersResponseContainerProperties{
				Etag: "yes",
			},
			Metadata: []ListContainersResponseContainerMetadata{
				ListContainersResponseContainerMetadata{
					XMLName: xml.Name{Local: "Key"},
					Value:   "Value",
				},
			},
		},
	}
	r.XML(200, resp)
}