-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return response type based on incoming header
- Loading branch information
1 parent
2e468e9
commit 1babc4e
Showing
17 changed files
with
288 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package fixtures | ||
|
||
var XMLNS = "http://queue.amazonaws.com/doc/2012-11-05/" | ||
var REQUEST_ID = "request-id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package models | ||
|
||
import "github.com/Admiral-Piett/goaws/app" | ||
|
||
// NOTE: Every response in here MUST implement the `AbstractResponseBody` interface in order to be used | ||
// in `encodeResponse` | ||
|
||
/*** Error Responses ***/ | ||
type ErrorResult struct { | ||
Type string `xml:"Type,omitempty"` | ||
Code string `xml:"Code,omitempty"` | ||
Message string `xml:"Message,omitempty"` | ||
} | ||
|
||
type ErrorResponse struct { | ||
Result ErrorResult `xml:"Error"` | ||
RequestId string `xml:"RequestId"` | ||
} | ||
|
||
func (r ErrorResponse) GetResult() interface{} { | ||
return r.Result | ||
} | ||
|
||
func (r ErrorResponse) GetRequestId() string { | ||
return r.RequestId | ||
} | ||
|
||
/*** Create Queue Response */ | ||
type CreateQueueResult struct { | ||
QueueUrl string `json:"QueueUrl" xml:"QueueUrl"` | ||
} | ||
|
||
type CreateQueueResponse struct { | ||
Xmlns string `xml:"xmlns,attr"` | ||
Result CreateQueueResult `xml:"CreateQueueResult"` | ||
Metadata app.ResponseMetadata `xml:"ResponseMetadata"` | ||
} | ||
|
||
func (r CreateQueueResponse) GetResult() interface{} { | ||
return r.Result | ||
} | ||
|
||
func (r CreateQueueResponse) GetRequestId() string { | ||
return r.Metadata.RequestId | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.