Documentation
¶
Index ¶
- Constants
- Variables
- func CloneHeader(h map[string]string, enc func(string, string) (string, string)) map[string]string
- func Concat(delim string, str ...string) string
- func EncodeHeaderString(h map[string]string) (string, string)
- func EncodeQueryString(pars map[string]string) string
- func EncodeURLString(pars map[string]string) string
- func EncodeUri(value string, encodeSlash bool) string
- func GenUTF8Hex(ch rune) string
- func HashMD5(content []byte) string
- func HashSHA256(content []byte) string
- func HmacSHA1(key []byte, content string) []byte
- func HmacSHA256(key []byte, content string) []byte
- type AWSRequest
- type AWSResponse
- type AWSService
- type Credentials
Constants ¶
View Source
const (
DEBUG_VERBOSE = 0 // 0: off, 1~N:
)
Variables ¶
View Source
var (
TEST_CREDENTIALS_FILE string
)
Functions ¶
func CloneHeader ¶
func EncodeQueryString ¶
func EncodeURLString ¶
func GenUTF8Hex ¶
func HashSHA256 ¶
func HmacSHA256 ¶
Types ¶
type AWSRequest ¶
type AWSRequest struct { Method string // "GET", "POST", "DELETE", etc. Path string // absolute path, starts with '/' Headers map[string]string Parameters map[string]string Payload bytes.Buffer }
func (*AWSRequest) DeleteParameter ¶
func (this *AWSRequest) DeleteParameter(key string)
func (*AWSRequest) Init ¶
func (this *AWSRequest) Init() *AWSRequest
func (*AWSRequest) Parameter ¶
func (this *AWSRequest) Parameter(key string) string
func (*AWSRequest) SetParameter ¶
func (this *AWSRequest) SetParameter(key string, value string)
type AWSResponse ¶
type AWSResponse struct { }
func (*AWSResponse) Init ¶
func (this *AWSResponse) Init(req *AWSRequest, resp *http.Response) (*AWSResponse, error)
type AWSService ¶
type AWSService struct { // ref: http://docs.aws.amazon.com/general/latest/gr/rande.html // TO-DO: convert endpoint to region & service. Region string // "us-west-1", etc. Service string // "ec2", "s3", etc. Endpoint string // Note: S3 doesn't support hosted style, use path style always. Credentials *Credentials }
func (*AWSService) Init ¶
func (this *AWSService) Init(cred *Credentials) (*AWSService, error)
func (*AWSService) Sign4 ¶
func (this *AWSService) Sign4(req *AWSRequest, useAuthorizationHeader bool) (*http.Request, error)
type Credentials ¶
type Credentials struct { AccessKeyID string SecretAccessKey string SecurityToken string Expiration time.Time }
func NewCredentialsFromCSV ¶
func NewCredentialsFromCSV(filename string) (*Credentials, error)
*
credentials.csv file is download from amazon console when you create an account.
func (*Credentials) Expired ¶
func (cred *Credentials) Expired() bool
Click to show internal directories.
Click to hide internal directories.