Updates of Lego.
This commit is contained in:
parent
5f4d440493
commit
2b2cfdfb32
102 changed files with 8355 additions and 902 deletions
28
vendor/github.com/nrdcg/goinwx/response.go
generated
vendored
Normal file
28
vendor/github.com/nrdcg/goinwx/response.go
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
package goinwx
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Response is a INWX API response. This wraps the standard http.Response returned from INWX.
|
||||
type Response struct {
|
||||
Code int `xmlrpc:"code"`
|
||||
Message string `xmlrpc:"msg"`
|
||||
ReasonCode string `xmlrpc:"reasonCode"`
|
||||
Reason string `xmlrpc:"reason"`
|
||||
ResponseData map[string]interface{} `xmlrpc:"resData"`
|
||||
}
|
||||
|
||||
// An ErrorResponse reports the error caused by an API request
|
||||
type ErrorResponse struct {
|
||||
Code int `xmlrpc:"code"`
|
||||
Message string `xmlrpc:"msg"`
|
||||
ReasonCode string `xmlrpc:"reasonCode"`
|
||||
Reason string `xmlrpc:"reason"`
|
||||
}
|
||||
|
||||
func (r *ErrorResponse) Error() string {
|
||||
if r.Reason != "" {
|
||||
return fmt.Sprintf("(%d) %s. Reason: (%s) %s",
|
||||
r.Code, r.Message, r.ReasonCode, r.Reason)
|
||||
}
|
||||
return fmt.Sprintf("(%d) %s", r.Code, r.Message)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue