forked from abneptis/GoAWS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsts.go
More file actions
32 lines (27 loc) · 676 Bytes
/
consts.go
File metadata and controls
32 lines (27 loc) · 676 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package aws
import (
"os"
"http"
)
const (
DEFAULT_SIGNATURE_VERSION = "2"
DEFAULT_SIGNATURE_METHOD = "HmacSHA256"
)
var ErrorNotFound os.Error = os.NewError("Not found")
var ErrorUnexpectedResponse os.Error = os.NewError("Unexpected response code")
var ErrorConflicts os.Error = os.NewError("Conflicts with another resources")
var ErrorForbidden os.Error = os.NewError("Access denied")
func CodeToError(i int) (err os.Error) {
switch i {
case http.StatusOK:
case http.StatusNotFound:
err = ErrorNotFound
case http.StatusConflict:
err = ErrorConflicts
case http.StatusForbidden:
err = ErrorForbidden
default:
err = ErrorUnexpectedResponse
}
return
}