Documentation
¶
Index ¶
- func BgContext(parent context.Context) context.Context
- func CloneMapSS(src map[string]string) map[string]string
- func EncodePath(pathName string) string
- func GetCanonicalRequest(extractedSignedHeaders http.Header, payload, queryStr, urlPath, method string) string
- func GetSignature(signingKey []byte, stringToSign string) string
- func GetSignedHeaders(signedHeaders http.Header) string
- func GetSigningKey(secretKey string, t time.Time, region string, serviceType string) []byte
- func GetStringToSign(canonicalRequest string, t time.Time, scope string) string
- func MustGetLocalIP4() (ipList set.StringSet)
- func MustNewSignedV4Request(method string, urlStr string, contentLength int64, body io.ReadSeeker, ...) *http.Request
- func NewRequest(method, urlStr string, contentLength int64, body io.ReadSeeker) (*http.Request, error)
- func S3EncodeName(name string, encodingType string) (result string)
- func SetupLogLevels()
- func SignRequestV4(req *http.Request, accessKey, secretKey string, st ServiceType) error
- func XmlDecoder(body io.Reader, v interface{}, size int64) error
- type ServiceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BgContext ¶
BgContext returns a context that can be used for async operations. Cancellation/timeouts are removed, so parent cancellations/timeout will not propagate from parent. Context values are preserved. This can be used for goroutines that live beyond the parent context.
func EncodePath ¶
EncodePath encode the strings from UTF-8 byte representations to HTML hex escape sequences
This is necessary since regular url.Parse() and url.Encode() functions do not support UTF-8 non english characters cannot be parsed due to the nature in which url.Encode() is written
This function on the other hand is a direct replacement for url.Encode() technique to support pretty much every UTF-8 character.
func GetCanonicalRequest ¶
func GetCanonicalRequest(extractedSignedHeaders http.Header, payload, queryStr, urlPath, method string) string
GetCanonicalRequest generate a canonical request of style
canonicalRequest =
<HTTPMethod>\n <CanonicalURI>\n <CanonicalQueryString>\n <CanonicalHeaders>\n <SignedHeaders>\n <HashedPayload>
func GetSignature ¶
GetSignature final signature in hexadecimal form.
func GetSignedHeaders ¶
GetSignedHeaders generate a string i.e alphabetically sorted, semicolon-separated list of lowercase request header names
func GetSigningKey ¶
GetSigningKey hmac seed to calculate final signature.
func GetStringToSign ¶
GetStringToSign a string based on selected query values.
func MustGetLocalIP4 ¶
MustGetLocalIP4 returns IPv4 addresses of localhost. It panics on error.
func MustNewSignedV4Request ¶
func MustNewSignedV4Request(method string, urlStr string, contentLength int64, body io.ReadSeeker, st ServiceType, accessKey, secretKey string, t *testing.T) *http.Request
MustNewSignedV4Request NewSignedV4Request
func NewRequest ¶
func NewRequest(method, urlStr string, contentLength int64, body io.ReadSeeker) (*http.Request, error)
NewRequest Returns new HTTP request object.
func S3EncodeName ¶
S3EncodeName encodes string in response when encodingType is specified in AWS S3 requests.
func SignRequestV4 ¶
func SignRequestV4(req *http.Request, accessKey, secretKey string, st ServiceType) error
SignRequestV4 Sign given request using Signature V4.
Types ¶
type ServiceType ¶
type ServiceType string