Version: v7.0.602 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 16 Imported by: 0




View Source
const (
	ServiceTypeS3  = "s3"
	ServiceTypeSTS = "sts"

Different service types


This section is empty.


func GetCredential

func GetCredential(accessKeyID, location string, t time.Time, serviceType string) string

GetCredential generate a credential string.

func PostPresignSignatureV2

func PostPresignSignatureV2(policyBase64, secretAccessKey string) string

PostPresignSignatureV2 - presigned signature for PostPolicy request.

func PostPresignSignatureV4

func PostPresignSignatureV4(policyBase64 string, t time.Time, secretAccessKey, location string) string

PostPresignSignatureV4 - presigned signature for PostPolicy requests.

func PreSignV2

func PreSignV2(req http.Request, accessKeyID, secretAccessKey string, expires int64, virtualHost bool) *http.Request

PreSignV2 - presign the request in following style. https://${S3_BUCKET}${S3_OBJECT}?AWSAccessKeyId=${S3_ACCESS_KEY}&Expires=${TIMESTAMP}&Signature=${SIGNATURE}.

func PreSignV4

func PreSignV4(req http.Request, accessKeyID, secretAccessKey, sessionToken, location string, expires int64) *http.Request

PreSignV4 presign the request, in accordance with

func SignV2

func SignV2(req http.Request, accessKeyID, secretAccessKey string, virtualHost bool) *http.Request

SignV2 sign the request before Do() (AWS Signature Version 2).

func SignV4

func SignV4(req http.Request, accessKeyID, secretAccessKey, sessionToken, location string) *http.Request

SignV4 sign the request before Do(), in accordance with

func SignV4STS

func SignV4STS(req http.Request, accessKeyID, secretAccessKey, location string) *http.Request

SignV4STS - signature v4 for STS request.

func StreamingSignV4

func StreamingSignV4(req *http.Request, accessKeyID, secretAccessKey, sessionToken,
	region string, dataLen int64, reqTime time.Time) *http.Request

StreamingSignV4 - provides chunked upload signatureV4 support by implementing io.Reader.


type StreamingReader

type StreamingReader struct {
	// contains filtered or unexported fields

StreamingReader implements chunked upload signature as a reader on top of req.Body's ReaderCloser chunk header;data;... repeat

func (*StreamingReader) Close

func (s *StreamingReader) Close() error

Close - this method makes underlying io.ReadCloser's Close method available.

func (*StreamingReader) Read

func (s *StreamingReader) Read(buf []byte) (int, error)

Read - this method performs chunk upload signature providing a io.Reader interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL