id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
26,600
minio/minio-go
pkg/s3utils/utils.go
checkBucketNameCommon
func checkBucketNameCommon(bucketName string, strict bool) (err error) { if strings.TrimSpace(bucketName) == "" { return errors.New("Bucket name cannot be empty") } if len(bucketName) < 3 { return errors.New("Bucket name cannot be smaller than 3 characters") } if len(bucketName) > 63 { return errors.New("Buc...
go
func checkBucketNameCommon(bucketName string, strict bool) (err error) { if strings.TrimSpace(bucketName) == "" { return errors.New("Bucket name cannot be empty") } if len(bucketName) < 3 { return errors.New("Bucket name cannot be smaller than 3 characters") } if len(bucketName) > 63 { return errors.New("Buc...
[ "func", "checkBucketNameCommon", "(", "bucketName", "string", ",", "strict", "bool", ")", "(", "err", "error", ")", "{", "if", "strings", ".", "TrimSpace", "(", "bucketName", ")", "==", "\"", "\"", "{", "return", "errors", ".", "New", "(", "\"", "\"", ...
// Common checker for both stricter and basic validation.
[ "Common", "checker", "for", "both", "stricter", "and", "basic", "validation", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3utils/utils.go#L272-L298
26,601
minio/minio-go
core.go
NewCore
func NewCore(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Core, error) { var s3Client Core client, err := NewV4(endpoint, accessKeyID, secretAccessKey, secure) if err != nil { return nil, err } s3Client.Client = client return &s3Client, nil }
go
func NewCore(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Core, error) { var s3Client Core client, err := NewV4(endpoint, accessKeyID, secretAccessKey, secure) if err != nil { return nil, err } s3Client.Client = client return &s3Client, nil }
[ "func", "NewCore", "(", "endpoint", "string", ",", "accessKeyID", ",", "secretAccessKey", "string", ",", "secure", "bool", ")", "(", "*", "Core", ",", "error", ")", "{", "var", "s3Client", "Core", "\n", "client", ",", "err", ":=", "NewV4", "(", "endpoint...
// NewCore - Returns new initialized a Core client, this CoreClient should be // only used under special conditions such as need to access lower primitives // and being able to use them to write your own wrappers.
[ "NewCore", "-", "Returns", "new", "initialized", "a", "Core", "client", "this", "CoreClient", "should", "be", "only", "used", "under", "special", "conditions", "such", "as", "need", "to", "access", "lower", "primitives", "and", "being", "able", "to", "use", ...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L36-L44
26,602
minio/minio-go
core.go
ListObjects
func (c Core) ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (result ListBucketResult, err error) { return c.listObjectsQuery(bucket, prefix, marker, delimiter, maxKeys) }
go
func (c Core) ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (result ListBucketResult, err error) { return c.listObjectsQuery(bucket, prefix, marker, delimiter, maxKeys) }
[ "func", "(", "c", "Core", ")", "ListObjects", "(", "bucket", ",", "prefix", ",", "marker", ",", "delimiter", "string", ",", "maxKeys", "int", ")", "(", "result", "ListBucketResult", ",", "err", "error", ")", "{", "return", "c", ".", "listObjectsQuery", "...
// ListObjects - List all the objects at a prefix, optionally with marker and delimiter // you can further filter the results.
[ "ListObjects", "-", "List", "all", "the", "objects", "at", "a", "prefix", "optionally", "with", "marker", "and", "delimiter", "you", "can", "further", "filter", "the", "results", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L48-L50
26,603
minio/minio-go
core.go
CopyObject
func (c Core) CopyObject(sourceBucket, sourceObject, destBucket, destObject string, metadata map[string]string) (ObjectInfo, error) { return c.copyObjectDo(context.Background(), sourceBucket, sourceObject, destBucket, destObject, metadata) }
go
func (c Core) CopyObject(sourceBucket, sourceObject, destBucket, destObject string, metadata map[string]string) (ObjectInfo, error) { return c.copyObjectDo(context.Background(), sourceBucket, sourceObject, destBucket, destObject, metadata) }
[ "func", "(", "c", "Core", ")", "CopyObject", "(", "sourceBucket", ",", "sourceObject", ",", "destBucket", ",", "destObject", "string", ",", "metadata", "map", "[", "string", "]", "string", ")", "(", "ObjectInfo", ",", "error", ")", "{", "return", "c", "....
// CopyObject - copies an object from source object to destination object on server side.
[ "CopyObject", "-", "copies", "an", "object", "from", "source", "object", "to", "destination", "object", "on", "server", "side", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L59-L61
26,604
minio/minio-go
core.go
PutObject
func (c Core) PutObject(bucket, object string, data io.Reader, size int64, md5Base64, sha256Hex string, metadata map[string]string, sse encrypt.ServerSide) (ObjectInfo, error) { opts := PutObjectOptions{} m := make(map[string]string) for k, v := range metadata { if strings.ToLower(k) == "content-encoding" { opt...
go
func (c Core) PutObject(bucket, object string, data io.Reader, size int64, md5Base64, sha256Hex string, metadata map[string]string, sse encrypt.ServerSide) (ObjectInfo, error) { opts := PutObjectOptions{} m := make(map[string]string) for k, v := range metadata { if strings.ToLower(k) == "content-encoding" { opt...
[ "func", "(", "c", "Core", ")", "PutObject", "(", "bucket", ",", "object", "string", ",", "data", "io", ".", "Reader", ",", "size", "int64", ",", "md5Base64", ",", "sha256Hex", "string", ",", "metadata", "map", "[", "string", "]", "string", ",", "sse", ...
// PutObject - Upload object. Uploads using single PUT call.
[ "PutObject", "-", "Upload", "object", ".", "Uploads", "using", "single", "PUT", "call", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L73-L96
26,605
minio/minio-go
core.go
NewMultipartUpload
func (c Core) NewMultipartUpload(bucket, object string, opts PutObjectOptions) (uploadID string, err error) { result, err := c.initiateMultipartUpload(context.Background(), bucket, object, opts) return result.UploadID, err }
go
func (c Core) NewMultipartUpload(bucket, object string, opts PutObjectOptions) (uploadID string, err error) { result, err := c.initiateMultipartUpload(context.Background(), bucket, object, opts) return result.UploadID, err }
[ "func", "(", "c", "Core", ")", "NewMultipartUpload", "(", "bucket", ",", "object", "string", ",", "opts", "PutObjectOptions", ")", "(", "uploadID", "string", ",", "err", "error", ")", "{", "result", ",", "err", ":=", "c", ".", "initiateMultipartUpload", "(...
// NewMultipartUpload - Initiates new multipart upload and returns the new uploadID.
[ "NewMultipartUpload", "-", "Initiates", "new", "multipart", "upload", "and", "returns", "the", "new", "uploadID", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L99-L102
26,606
minio/minio-go
core.go
ListMultipartUploads
func (c Core) ListMultipartUploads(bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (result ListMultipartUploadsResult, err error) { return c.listMultipartUploadsQuery(bucket, keyMarker, uploadIDMarker, prefix, delimiter, maxUploads) }
go
func (c Core) ListMultipartUploads(bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (result ListMultipartUploadsResult, err error) { return c.listMultipartUploadsQuery(bucket, keyMarker, uploadIDMarker, prefix, delimiter, maxUploads) }
[ "func", "(", "c", "Core", ")", "ListMultipartUploads", "(", "bucket", ",", "prefix", ",", "keyMarker", ",", "uploadIDMarker", ",", "delimiter", "string", ",", "maxUploads", "int", ")", "(", "result", "ListMultipartUploadsResult", ",", "err", "error", ")", "{",...
// ListMultipartUploads - List incomplete uploads.
[ "ListMultipartUploads", "-", "List", "incomplete", "uploads", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L105-L107
26,607
minio/minio-go
core.go
PutObjectPart
func (c Core) PutObjectPart(bucket, object, uploadID string, partID int, data io.Reader, size int64, md5Base64, sha256Hex string, sse encrypt.ServerSide) (ObjectPart, error) { return c.uploadPart(context.Background(), bucket, object, uploadID, data, partID, md5Base64, sha256Hex, size, sse) }
go
func (c Core) PutObjectPart(bucket, object, uploadID string, partID int, data io.Reader, size int64, md5Base64, sha256Hex string, sse encrypt.ServerSide) (ObjectPart, error) { return c.uploadPart(context.Background(), bucket, object, uploadID, data, partID, md5Base64, sha256Hex, size, sse) }
[ "func", "(", "c", "Core", ")", "PutObjectPart", "(", "bucket", ",", "object", ",", "uploadID", "string", ",", "partID", "int", ",", "data", "io", ".", "Reader", ",", "size", "int64", ",", "md5Base64", ",", "sha256Hex", "string", ",", "sse", "encrypt", ...
// PutObjectPart - Upload an object part.
[ "PutObjectPart", "-", "Upload", "an", "object", "part", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L110-L112
26,608
minio/minio-go
core.go
ListObjectParts
func (c Core) ListObjectParts(bucket, object, uploadID string, partNumberMarker int, maxParts int) (result ListObjectPartsResult, err error) { return c.listObjectPartsQuery(bucket, object, uploadID, partNumberMarker, maxParts) }
go
func (c Core) ListObjectParts(bucket, object, uploadID string, partNumberMarker int, maxParts int) (result ListObjectPartsResult, err error) { return c.listObjectPartsQuery(bucket, object, uploadID, partNumberMarker, maxParts) }
[ "func", "(", "c", "Core", ")", "ListObjectParts", "(", "bucket", ",", "object", ",", "uploadID", "string", ",", "partNumberMarker", "int", ",", "maxParts", "int", ")", "(", "result", "ListObjectPartsResult", ",", "err", "error", ")", "{", "return", "c", "....
// ListObjectParts - List uploaded parts of an incomplete upload.x
[ "ListObjectParts", "-", "List", "uploaded", "parts", "of", "an", "incomplete", "upload", ".", "x" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L115-L117
26,609
minio/minio-go
core.go
CompleteMultipartUpload
func (c Core) CompleteMultipartUpload(bucket, object, uploadID string, parts []CompletePart) (string, error) { res, err := c.completeMultipartUpload(context.Background(), bucket, object, uploadID, completeMultipartUpload{ Parts: parts, }) return res.ETag, err }
go
func (c Core) CompleteMultipartUpload(bucket, object, uploadID string, parts []CompletePart) (string, error) { res, err := c.completeMultipartUpload(context.Background(), bucket, object, uploadID, completeMultipartUpload{ Parts: parts, }) return res.ETag, err }
[ "func", "(", "c", "Core", ")", "CompleteMultipartUpload", "(", "bucket", ",", "object", ",", "uploadID", "string", ",", "parts", "[", "]", "CompletePart", ")", "(", "string", ",", "error", ")", "{", "res", ",", "err", ":=", "c", ".", "completeMultipartUp...
// CompleteMultipartUpload - Concatenate uploaded parts and commit to an object.
[ "CompleteMultipartUpload", "-", "Concatenate", "uploaded", "parts", "and", "commit", "to", "an", "object", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L120-L125
26,610
minio/minio-go
core.go
AbortMultipartUpload
func (c Core) AbortMultipartUpload(bucket, object, uploadID string) error { return c.abortMultipartUpload(context.Background(), bucket, object, uploadID) }
go
func (c Core) AbortMultipartUpload(bucket, object, uploadID string) error { return c.abortMultipartUpload(context.Background(), bucket, object, uploadID) }
[ "func", "(", "c", "Core", ")", "AbortMultipartUpload", "(", "bucket", ",", "object", ",", "uploadID", "string", ")", "error", "{", "return", "c", ".", "abortMultipartUpload", "(", "context", ".", "Background", "(", ")", ",", "bucket", ",", "object", ",", ...
// AbortMultipartUpload - Abort an incomplete upload.
[ "AbortMultipartUpload", "-", "Abort", "an", "incomplete", "upload", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L128-L130
26,611
minio/minio-go
core.go
GetBucketPolicy
func (c Core) GetBucketPolicy(bucket string) (string, error) { return c.getBucketPolicy(bucket) }
go
func (c Core) GetBucketPolicy(bucket string) (string, error) { return c.getBucketPolicy(bucket) }
[ "func", "(", "c", "Core", ")", "GetBucketPolicy", "(", "bucket", "string", ")", "(", "string", ",", "error", ")", "{", "return", "c", ".", "getBucketPolicy", "(", "bucket", ")", "\n", "}" ]
// GetBucketPolicy - fetches bucket access policy for a given bucket.
[ "GetBucketPolicy", "-", "fetches", "bucket", "access", "policy", "for", "a", "given", "bucket", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L133-L135
26,612
minio/minio-go
core.go
PutBucketPolicy
func (c Core) PutBucketPolicy(bucket, bucketPolicy string) error { return c.putBucketPolicy(bucket, bucketPolicy) }
go
func (c Core) PutBucketPolicy(bucket, bucketPolicy string) error { return c.putBucketPolicy(bucket, bucketPolicy) }
[ "func", "(", "c", "Core", ")", "PutBucketPolicy", "(", "bucket", ",", "bucketPolicy", "string", ")", "error", "{", "return", "c", ".", "putBucketPolicy", "(", "bucket", ",", "bucketPolicy", ")", "\n", "}" ]
// PutBucketPolicy - applies a new bucket access policy for a given bucket.
[ "PutBucketPolicy", "-", "applies", "a", "new", "bucket", "access", "policy", "for", "a", "given", "bucket", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L138-L140
26,613
minio/minio-go
core.go
GetObject
func (c Core) GetObject(bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error) { return c.getObject(context.Background(), bucketName, objectName, opts) }
go
func (c Core) GetObject(bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error) { return c.getObject(context.Background(), bucketName, objectName, opts) }
[ "func", "(", "c", "Core", ")", "GetObject", "(", "bucketName", ",", "objectName", "string", ",", "opts", "GetObjectOptions", ")", "(", "io", ".", "ReadCloser", ",", "ObjectInfo", ",", "error", ")", "{", "return", "c", ".", "getObject", "(", "context", "....
// GetObject is a lower level API implemented to support reading // partial objects and also downloading objects with special conditions // matching etag, modtime etc.
[ "GetObject", "is", "a", "lower", "level", "API", "implemented", "to", "support", "reading", "partial", "objects", "and", "also", "downloading", "objects", "with", "special", "conditions", "matching", "etag", "modtime", "etc", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L145-L147
26,614
minio/minio-go
core.go
StatObject
func (c Core) StatObject(bucketName, objectName string, opts StatObjectOptions) (ObjectInfo, error) { return c.statObject(context.Background(), bucketName, objectName, opts) }
go
func (c Core) StatObject(bucketName, objectName string, opts StatObjectOptions) (ObjectInfo, error) { return c.statObject(context.Background(), bucketName, objectName, opts) }
[ "func", "(", "c", "Core", ")", "StatObject", "(", "bucketName", ",", "objectName", "string", ",", "opts", "StatObjectOptions", ")", "(", "ObjectInfo", ",", "error", ")", "{", "return", "c", ".", "statObject", "(", "context", ".", "Background", "(", ")", ...
// StatObject is a lower level API implemented to support special // conditions matching etag, modtime on a request.
[ "StatObject", "is", "a", "lower", "level", "API", "implemented", "to", "support", "special", "conditions", "matching", "etag", "modtime", "on", "a", "request", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/core.go#L151-L153
26,615
minio/minio-go
pkg/credentials/file_aws_credentials.go
NewFileAWSCredentials
func NewFileAWSCredentials(filename string, profile string) *Credentials { return New(&FileAWSCredentials{ filename: filename, profile: profile, }) }
go
func NewFileAWSCredentials(filename string, profile string) *Credentials { return New(&FileAWSCredentials{ filename: filename, profile: profile, }) }
[ "func", "NewFileAWSCredentials", "(", "filename", "string", ",", "profile", "string", ")", "*", "Credentials", "{", "return", "New", "(", "&", "FileAWSCredentials", "{", "filename", ":", "filename", ",", "profile", ":", "profile", ",", "}", ")", "\n", "}" ]
// NewFileAWSCredentials returns a pointer to a new Credentials object // wrapping the Profile file provider.
[ "NewFileAWSCredentials", "returns", "a", "pointer", "to", "a", "new", "Credentials", "object", "wrapping", "the", "Profile", "file", "provider", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/file_aws_credentials.go#L52-L57
26,616
minio/minio-go
pkg/s3signer/request-signature-v4.go
GetCredential
func GetCredential(accessKeyID, location string, t time.Time) string { scope := getScope(location, t) return accessKeyID + "/" + scope }
go
func GetCredential(accessKeyID, location string, t time.Time) string { scope := getScope(location, t) return accessKeyID + "/" + scope }
[ "func", "GetCredential", "(", "accessKeyID", ",", "location", "string", ",", "t", "time", ".", "Time", ")", "string", "{", "scope", ":=", "getScope", "(", "location", ",", "t", ")", "\n", "return", "accessKeyID", "+", "\"", "\"", "+", "scope", "\n", "}...
// GetCredential generate a credential string.
[ "GetCredential", "generate", "a", "credential", "string", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-v4.go#L108-L111
26,617
minio/minio-go
pkg/s3signer/request-signature-v4.go
getHashedPayload
func getHashedPayload(req http.Request) string { hashedPayload := req.Header.Get("X-Amz-Content-Sha256") if hashedPayload == "" { // Presign does not have a payload, use S3 recommended value. hashedPayload = unsignedPayload } return hashedPayload }
go
func getHashedPayload(req http.Request) string { hashedPayload := req.Header.Get("X-Amz-Content-Sha256") if hashedPayload == "" { // Presign does not have a payload, use S3 recommended value. hashedPayload = unsignedPayload } return hashedPayload }
[ "func", "getHashedPayload", "(", "req", "http", ".", "Request", ")", "string", "{", "hashedPayload", ":=", "req", ".", "Header", ".", "Get", "(", "\"", "\"", ")", "\n", "if", "hashedPayload", "==", "\"", "\"", "{", "// Presign does not have a payload, use S3 r...
// getHashedPayload get the hexadecimal value of the SHA256 hash of // the request payload.
[ "getHashedPayload", "get", "the", "hexadecimal", "value", "of", "the", "SHA256", "hash", "of", "the", "request", "payload", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-v4.go#L115-L122
26,618
minio/minio-go
pkg/s3signer/request-signature-v4.go
getCanonicalHeaders
func getCanonicalHeaders(req http.Request, ignoredHeaders map[string]bool) string { var headers []string vals := make(map[string][]string) for k, vv := range req.Header { if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok { continue // ignored header } headers = append(headers, strings.ToLower(k)) ...
go
func getCanonicalHeaders(req http.Request, ignoredHeaders map[string]bool) string { var headers []string vals := make(map[string][]string) for k, vv := range req.Header { if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok { continue // ignored header } headers = append(headers, strings.ToLower(k)) ...
[ "func", "getCanonicalHeaders", "(", "req", "http", ".", "Request", ",", "ignoredHeaders", "map", "[", "string", "]", "bool", ")", "string", "{", "var", "headers", "[", "]", "string", "\n", "vals", ":=", "make", "(", "map", "[", "string", "]", "[", "]",...
// getCanonicalHeaders generate a list of request headers for // signature.
[ "getCanonicalHeaders", "generate", "a", "list", "of", "request", "headers", "for", "signature", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-v4.go#L126-L160
26,619
minio/minio-go
pkg/s3signer/request-signature-v4.go
getSignedHeaders
func getSignedHeaders(req http.Request, ignoredHeaders map[string]bool) string { var headers []string for k := range req.Header { if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok { continue // Ignored header found continue. } headers = append(headers, strings.ToLower(k)) } headers = append(header...
go
func getSignedHeaders(req http.Request, ignoredHeaders map[string]bool) string { var headers []string for k := range req.Header { if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok { continue // Ignored header found continue. } headers = append(headers, strings.ToLower(k)) } headers = append(header...
[ "func", "getSignedHeaders", "(", "req", "http", ".", "Request", ",", "ignoredHeaders", "map", "[", "string", "]", "bool", ")", "string", "{", "var", "headers", "[", "]", "string", "\n", "for", "k", ":=", "range", "req", ".", "Header", "{", "if", "_", ...
// getSignedHeaders generate all signed request headers. // i.e lexically sorted, semicolon-separated list of lowercase // request header names.
[ "getSignedHeaders", "generate", "all", "signed", "request", "headers", ".", "i", ".", "e", "lexically", "sorted", "semicolon", "-", "separated", "list", "of", "lowercase", "request", "header", "names", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-v4.go#L165-L176
26,620
minio/minio-go
pkg/s3signer/request-signature-v4.go
PostPresignSignatureV4
func PostPresignSignatureV4(policyBase64 string, t time.Time, secretAccessKey, location string) string { // Get signining key. signingkey := getSigningKey(secretAccessKey, location, t) // Calculate signature. signature := getSignature(signingkey, policyBase64) return signature }
go
func PostPresignSignatureV4(policyBase64 string, t time.Time, secretAccessKey, location string) string { // Get signining key. signingkey := getSigningKey(secretAccessKey, location, t) // Calculate signature. signature := getSignature(signingkey, policyBase64) return signature }
[ "func", "PostPresignSignatureV4", "(", "policyBase64", "string", ",", "t", "time", ".", "Time", ",", "secretAccessKey", ",", "location", "string", ")", "string", "{", "// Get signining key.", "signingkey", ":=", "getSigningKey", "(", "secretAccessKey", ",", "locatio...
// PostPresignSignatureV4 - presigned signature for PostPolicy // requests.
[ "PostPresignSignatureV4", "-", "presigned", "signature", "for", "PostPolicy", "requests", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-v4.go#L258-L264
26,621
minio/minio-go
utils.go
sum256Hex
func sum256Hex(data []byte) string { hash := sha256.New() hash.Write(data) return hex.EncodeToString(hash.Sum(nil)) }
go
func sum256Hex(data []byte) string { hash := sha256.New() hash.Write(data) return hex.EncodeToString(hash.Sum(nil)) }
[ "func", "sum256Hex", "(", "data", "[", "]", "byte", ")", "string", "{", "hash", ":=", "sha256", ".", "New", "(", ")", "\n", "hash", ".", "Write", "(", "data", ")", "\n", "return", "hex", ".", "EncodeToString", "(", "hash", ".", "Sum", "(", "nil", ...
// sum256 calculate sha256sum for an input byte array, returns hex encoded.
[ "sum256", "calculate", "sha256sum", "for", "an", "input", "byte", "array", "returns", "hex", "encoded", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L45-L49
26,622
minio/minio-go
utils.go
sumMD5Base64
func sumMD5Base64(data []byte) string { hash := md5.New() hash.Write(data) return base64.StdEncoding.EncodeToString(hash.Sum(nil)) }
go
func sumMD5Base64(data []byte) string { hash := md5.New() hash.Write(data) return base64.StdEncoding.EncodeToString(hash.Sum(nil)) }
[ "func", "sumMD5Base64", "(", "data", "[", "]", "byte", ")", "string", "{", "hash", ":=", "md5", ".", "New", "(", ")", "\n", "hash", ".", "Write", "(", "data", ")", "\n", "return", "base64", ".", "StdEncoding", ".", "EncodeToString", "(", "hash", ".",...
// sumMD5Base64 calculate md5sum for an input byte array, returns base64 encoded.
[ "sumMD5Base64", "calculate", "md5sum", "for", "an", "input", "byte", "array", "returns", "base64", "encoded", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L52-L56
26,623
minio/minio-go
utils.go
getEndpointURL
func getEndpointURL(endpoint string, secure bool) (*url.URL, error) { if strings.Contains(endpoint, ":") { host, _, err := net.SplitHostPort(endpoint) if err != nil { return nil, err } if !s3utils.IsValidIP(host) && !s3utils.IsValidDomain(host) { msg := "Endpoint: " + endpoint + " does not follow ip addr...
go
func getEndpointURL(endpoint string, secure bool) (*url.URL, error) { if strings.Contains(endpoint, ":") { host, _, err := net.SplitHostPort(endpoint) if err != nil { return nil, err } if !s3utils.IsValidIP(host) && !s3utils.IsValidDomain(host) { msg := "Endpoint: " + endpoint + " does not follow ip addr...
[ "func", "getEndpointURL", "(", "endpoint", "string", ",", "secure", "bool", ")", "(", "*", "url", ".", "URL", ",", "error", ")", "{", "if", "strings", ".", "Contains", "(", "endpoint", ",", "\"", "\"", ")", "{", "host", ",", "_", ",", "err", ":=", ...
// getEndpointURL - construct a new endpoint.
[ "getEndpointURL", "-", "construct", "a", "new", "endpoint", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L59-L93
26,624
minio/minio-go
utils.go
isValidExpiry
func isValidExpiry(expires time.Duration) error { expireSeconds := int64(expires / time.Second) if expireSeconds < 1 { return ErrInvalidArgument("Expires cannot be lesser than 1 second.") } if expireSeconds > 604800 { return ErrInvalidArgument("Expires cannot be greater than 7 days.") } return nil }
go
func isValidExpiry(expires time.Duration) error { expireSeconds := int64(expires / time.Second) if expireSeconds < 1 { return ErrInvalidArgument("Expires cannot be lesser than 1 second.") } if expireSeconds > 604800 { return ErrInvalidArgument("Expires cannot be greater than 7 days.") } return nil }
[ "func", "isValidExpiry", "(", "expires", "time", ".", "Duration", ")", "error", "{", "expireSeconds", ":=", "int64", "(", "expires", "/", "time", ".", "Second", ")", "\n", "if", "expireSeconds", "<", "1", "{", "return", "ErrInvalidArgument", "(", "\"", "\"...
// Verify if input expires value is valid.
[ "Verify", "if", "input", "expires", "value", "is", "valid", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L145-L154
26,625
minio/minio-go
utils.go
cloneHeader
func cloneHeader(h http.Header) http.Header { h2 := make(http.Header, len(h)) for k, vv := range h { vv2 := make([]string, len(vv)) copy(vv2, vv) h2[k] = vv2 } return h2 }
go
func cloneHeader(h http.Header) http.Header { h2 := make(http.Header, len(h)) for k, vv := range h { vv2 := make([]string, len(vv)) copy(vv2, vv) h2[k] = vv2 } return h2 }
[ "func", "cloneHeader", "(", "h", "http", ".", "Header", ")", "http", ".", "Header", "{", "h2", ":=", "make", "(", "http", ".", "Header", ",", "len", "(", "h", ")", ")", "\n", "for", "k", ",", "vv", ":=", "range", "h", "{", "vv2", ":=", "make", ...
// make a copy of http.Header
[ "make", "a", "copy", "of", "http", ".", "Header" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L157-L165
26,626
minio/minio-go
utils.go
filterHeader
func filterHeader(header http.Header, filterKeys []string) (filteredHeader http.Header) { filteredHeader = cloneHeader(header) for _, key := range filterKeys { filteredHeader.Del(key) } return filteredHeader }
go
func filterHeader(header http.Header, filterKeys []string) (filteredHeader http.Header) { filteredHeader = cloneHeader(header) for _, key := range filterKeys { filteredHeader.Del(key) } return filteredHeader }
[ "func", "filterHeader", "(", "header", "http", ".", "Header", ",", "filterKeys", "[", "]", "string", ")", "(", "filteredHeader", "http", ".", "Header", ")", "{", "filteredHeader", "=", "cloneHeader", "(", "header", ")", "\n", "for", "_", ",", "key", ":="...
// Filter relevant response headers from // the HEAD, GET http response. The function takes // a list of headers which are filtered out and // returned as a new http header.
[ "Filter", "relevant", "response", "headers", "from", "the", "HEAD", "GET", "http", "response", ".", "The", "function", "takes", "a", "list", "of", "headers", "which", "are", "filtered", "out", "and", "returned", "as", "a", "new", "http", "header", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L171-L177
26,627
minio/minio-go
utils.go
redactSignature
func redactSignature(origAuth string) string { if !strings.HasPrefix(origAuth, signV4Algorithm) { // Set a temporary redacted auth return "AWS **REDACTED**:**REDACTED**" } /// Signature V4 authorization header. // Strip out accessKeyID from: // Credential=<access-key-id>/<date>/<aws-region>/<aws-service>/aws...
go
func redactSignature(origAuth string) string { if !strings.HasPrefix(origAuth, signV4Algorithm) { // Set a temporary redacted auth return "AWS **REDACTED**:**REDACTED**" } /// Signature V4 authorization header. // Strip out accessKeyID from: // Credential=<access-key-id>/<date>/<aws-region>/<aws-service>/aws...
[ "func", "redactSignature", "(", "origAuth", "string", ")", "string", "{", "if", "!", "strings", ".", "HasPrefix", "(", "origAuth", ",", "signV4Algorithm", ")", "{", "// Set a temporary redacted auth", "return", "\"", "\"", "\n", "}", "\n\n", "/// Signature V4 auth...
// Redact out signature value from authorization string.
[ "Redact", "out", "signature", "value", "from", "authorization", "string", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L186-L200
26,628
minio/minio-go
utils.go
getDefaultLocation
func getDefaultLocation(u url.URL, regionOverride string) (location string) { if regionOverride != "" { return regionOverride } region := s3utils.GetRegionFromURL(u) if region == "" { region = "us-east-1" } return region }
go
func getDefaultLocation(u url.URL, regionOverride string) (location string) { if regionOverride != "" { return regionOverride } region := s3utils.GetRegionFromURL(u) if region == "" { region = "us-east-1" } return region }
[ "func", "getDefaultLocation", "(", "u", "url", ".", "URL", ",", "regionOverride", "string", ")", "(", "location", "string", ")", "{", "if", "regionOverride", "!=", "\"", "\"", "{", "return", "regionOverride", "\n", "}", "\n", "region", ":=", "s3utils", "."...
// Get default location returns the location based on the input // URL `u`, if region override is provided then all location // defaults to regionOverride. // // If no other cases match then the location is set to `us-east-1` // as a last resort.
[ "Get", "default", "location", "returns", "the", "location", "based", "on", "the", "input", "URL", "u", "if", "region", "override", "is", "provided", "then", "all", "location", "defaults", "to", "regionOverride", ".", "If", "no", "other", "cases", "match", "t...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L208-L217
26,629
minio/minio-go
utils.go
isStorageClassHeader
func isStorageClassHeader(headerKey string) bool { return strings.ToLower(amzStorageClass) == strings.ToLower(headerKey) }
go
func isStorageClassHeader(headerKey string) bool { return strings.ToLower(amzStorageClass) == strings.ToLower(headerKey) }
[ "func", "isStorageClassHeader", "(", "headerKey", "string", ")", "bool", "{", "return", "strings", ".", "ToLower", "(", "amzStorageClass", ")", "==", "strings", ".", "ToLower", "(", "headerKey", ")", "\n", "}" ]
// isStorageClassHeader returns true if the header is a supported storage class header
[ "isStorageClassHeader", "returns", "true", "if", "the", "header", "is", "a", "supported", "storage", "class", "header" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L231-L233
26,630
minio/minio-go
utils.go
isStandardHeader
func isStandardHeader(headerKey string) bool { key := strings.ToLower(headerKey) for _, header := range supportedHeaders { if strings.ToLower(header) == key { return true } } return false }
go
func isStandardHeader(headerKey string) bool { key := strings.ToLower(headerKey) for _, header := range supportedHeaders { if strings.ToLower(header) == key { return true } } return false }
[ "func", "isStandardHeader", "(", "headerKey", "string", ")", "bool", "{", "key", ":=", "strings", ".", "ToLower", "(", "headerKey", ")", "\n", "for", "_", ",", "header", ":=", "range", "supportedHeaders", "{", "if", "strings", ".", "ToLower", "(", "header"...
// isStandardHeader returns true if header is a supported header and not a custom header
[ "isStandardHeader", "returns", "true", "if", "header", "is", "a", "supported", "header", "and", "not", "a", "custom", "header" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L236-L244
26,631
minio/minio-go
utils.go
isSSEHeader
func isSSEHeader(headerKey string) bool { key := strings.ToLower(headerKey) for _, h := range sseHeaders { if strings.ToLower(h) == key { return true } } return false }
go
func isSSEHeader(headerKey string) bool { key := strings.ToLower(headerKey) for _, h := range sseHeaders { if strings.ToLower(h) == key { return true } } return false }
[ "func", "isSSEHeader", "(", "headerKey", "string", ")", "bool", "{", "key", ":=", "strings", ".", "ToLower", "(", "headerKey", ")", "\n", "for", "_", ",", "h", ":=", "range", "sseHeaders", "{", "if", "strings", ".", "ToLower", "(", "h", ")", "==", "k...
// isSSEHeader returns true if header is a server side encryption header.
[ "isSSEHeader", "returns", "true", "if", "header", "is", "a", "server", "side", "encryption", "header", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/utils.go#L257-L265
26,632
minio/minio-go
pkg/credentials/file_minio_client.go
NewFileMinioClient
func NewFileMinioClient(filename string, alias string) *Credentials { return New(&FileMinioClient{ filename: filename, alias: alias, }) }
go
func NewFileMinioClient(filename string, alias string) *Credentials { return New(&FileMinioClient{ filename: filename, alias: alias, }) }
[ "func", "NewFileMinioClient", "(", "filename", "string", ",", "alias", "string", ")", "*", "Credentials", "{", "return", "New", "(", "&", "FileMinioClient", "{", "filename", ":", "filename", ",", "alias", ":", "alias", ",", "}", ")", "\n", "}" ]
// NewFileMinioClient returns a pointer to a new Credentials object // wrapping the Alias file provider.
[ "NewFileMinioClient", "returns", "a", "pointer", "to", "a", "new", "Credentials", "object", "wrapping", "the", "Alias", "file", "provider", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/file_minio_client.go#L54-L59
26,633
minio/minio-go
pkg/credentials/file_minio_client.go
loadAlias
func loadAlias(filename, alias string) (hostConfig, error) { cfg := &config{} configBytes, err := ioutil.ReadFile(filename) if err != nil { return hostConfig{}, err } if err = json.Unmarshal(configBytes, cfg); err != nil { return hostConfig{}, err } return cfg.Hosts[alias], nil }
go
func loadAlias(filename, alias string) (hostConfig, error) { cfg := &config{} configBytes, err := ioutil.ReadFile(filename) if err != nil { return hostConfig{}, err } if err = json.Unmarshal(configBytes, cfg); err != nil { return hostConfig{}, err } return cfg.Hosts[alias], nil }
[ "func", "loadAlias", "(", "filename", ",", "alias", "string", ")", "(", "hostConfig", ",", "error", ")", "{", "cfg", ":=", "&", "config", "{", "}", "\n", "configBytes", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "filename", ")", "\n", "if", "e...
// loadAliass loads from the file pointed to by shared credentials filename for alias. // The credentials retrieved from the alias will be returned or error. Error will be // returned if it fails to read from the file.
[ "loadAliass", "loads", "from", "the", "file", "pointed", "to", "by", "shared", "credentials", "filename", "for", "alias", ".", "The", "credentials", "retrieved", "from", "the", "alias", "will", "be", "returned", "or", "error", ".", "Error", "will", "be", "re...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/file_minio_client.go#L123-L133
26,634
minio/minio-go
api-get-object-acl.go
GetObjectACL
func (c Client) GetObjectACL(bucketName, objectName string) (*ObjectInfo, error) { resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{ bucketName: bucketName, objectName: objectName, queryValues: url.Values{ "acl": []string{""}, }, }) if err != nil { return nil, err } defer clo...
go
func (c Client) GetObjectACL(bucketName, objectName string) (*ObjectInfo, error) { resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{ bucketName: bucketName, objectName: objectName, queryValues: url.Values{ "acl": []string{""}, }, }) if err != nil { return nil, err } defer clo...
[ "func", "(", "c", "Client", ")", "GetObjectACL", "(", "bucketName", ",", "objectName", "string", ")", "(", "*", "ObjectInfo", ",", "error", ")", "{", "resp", ",", "err", ":=", "c", ".", "executeMethod", "(", "context", ".", "Background", "(", ")", ",",...
//GetObjectACL get object ACLs
[ "GetObjectACL", "get", "object", "ACLs" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-get-object-acl.go#L44-L85
26,635
minio/minio-go
api-compose-object.go
SetRange
func (s *SourceInfo) SetRange(start, end int64) error { if start > end || start < 0 { return ErrInvalidArgument("start must be non-negative, and start must be at most end.") } // Note that 0 <= start <= end s.start, s.end = start, end return nil }
go
func (s *SourceInfo) SetRange(start, end int64) error { if start > end || start < 0 { return ErrInvalidArgument("start must be non-negative, and start must be at most end.") } // Note that 0 <= start <= end s.start, s.end = start, end return nil }
[ "func", "(", "s", "*", "SourceInfo", ")", "SetRange", "(", "start", ",", "end", "int64", ")", "error", "{", "if", "start", ">", "end", "||", "start", "<", "0", "{", "return", "ErrInvalidArgument", "(", "\"", "\"", ")", "\n", "}", "\n", "// Note that ...
// SetRange - Set the start and end offset of the source object to be // copied. If this method is not called, the whole source object is // copied.
[ "SetRange", "-", "Set", "the", "start", "and", "end", "offset", "of", "the", "source", "object", "to", "be", "copied", ".", "If", "this", "method", "is", "not", "called", "the", "whole", "source", "object", "is", "copied", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-compose-object.go#L147-L154
26,636
minio/minio-go
api-compose-object.go
SetMatchETagCond
func (s *SourceInfo) SetMatchETagCond(etag string) error { if etag == "" { return ErrInvalidArgument("ETag cannot be empty.") } s.Headers.Set("x-amz-copy-source-if-match", etag) return nil }
go
func (s *SourceInfo) SetMatchETagCond(etag string) error { if etag == "" { return ErrInvalidArgument("ETag cannot be empty.") } s.Headers.Set("x-amz-copy-source-if-match", etag) return nil }
[ "func", "(", "s", "*", "SourceInfo", ")", "SetMatchETagCond", "(", "etag", "string", ")", "error", "{", "if", "etag", "==", "\"", "\"", "{", "return", "ErrInvalidArgument", "(", "\"", "\"", ")", "\n", "}", "\n", "s", ".", "Headers", ".", "Set", "(", ...
// SetMatchETagCond - Set ETag match condition. The object is copied // only if the etag of the source matches the value given here.
[ "SetMatchETagCond", "-", "Set", "ETag", "match", "condition", ".", "The", "object", "is", "copied", "only", "if", "the", "etag", "of", "the", "source", "matches", "the", "value", "given", "here", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-compose-object.go#L158-L164
26,637
minio/minio-go
api-compose-object.go
SetModifiedSinceCond
func (s *SourceInfo) SetModifiedSinceCond(modTime time.Time) error { if modTime.IsZero() { return ErrInvalidArgument("Input time cannot be 0.") } s.Headers.Set("x-amz-copy-source-if-modified-since", modTime.Format(http.TimeFormat)) return nil }
go
func (s *SourceInfo) SetModifiedSinceCond(modTime time.Time) error { if modTime.IsZero() { return ErrInvalidArgument("Input time cannot be 0.") } s.Headers.Set("x-amz-copy-source-if-modified-since", modTime.Format(http.TimeFormat)) return nil }
[ "func", "(", "s", "*", "SourceInfo", ")", "SetModifiedSinceCond", "(", "modTime", "time", ".", "Time", ")", "error", "{", "if", "modTime", ".", "IsZero", "(", ")", "{", "return", "ErrInvalidArgument", "(", "\"", "\"", ")", "\n", "}", "\n", "s", ".", ...
// SetModifiedSinceCond - Set the modified since condition.
[ "SetModifiedSinceCond", "-", "Set", "the", "modified", "since", "condition", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-compose-object.go#L178-L184
26,638
minio/minio-go
api-compose-object.go
getProps
func (s *SourceInfo) getProps(c Client) (size int64, etag string, userMeta map[string]string, err error) { // Get object info - need size and etag here. Also, decryption // headers are added to the stat request if given. var objInfo ObjectInfo opts := StatObjectOptions{GetObjectOptions{ServerSideEncryption: encrypt...
go
func (s *SourceInfo) getProps(c Client) (size int64, etag string, userMeta map[string]string, err error) { // Get object info - need size and etag here. Also, decryption // headers are added to the stat request if given. var objInfo ObjectInfo opts := StatObjectOptions{GetObjectOptions{ServerSideEncryption: encrypt...
[ "func", "(", "s", "*", "SourceInfo", ")", "getProps", "(", "c", "Client", ")", "(", "size", "int64", ",", "etag", "string", ",", "userMeta", "map", "[", "string", "]", "string", ",", "err", "error", ")", "{", "// Get object info - need size and etag here. Al...
// Helper to fetch size and etag of an object using a StatObject call.
[ "Helper", "to", "fetch", "size", "and", "etag", "of", "an", "object", "using", "a", "StatObject", "call", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-compose-object.go#L196-L217
26,639
minio/minio-go
api-compose-object.go
copyObjectDo
func (c Client) copyObjectDo(ctx context.Context, srcBucket, srcObject, destBucket, destObject string, metadata map[string]string) (ObjectInfo, error) { // Build headers. headers := make(http.Header) // Set all the metadata headers. for k, v := range metadata { headers.Set(k, v) } // Set the source header ...
go
func (c Client) copyObjectDo(ctx context.Context, srcBucket, srcObject, destBucket, destObject string, metadata map[string]string) (ObjectInfo, error) { // Build headers. headers := make(http.Header) // Set all the metadata headers. for k, v := range metadata { headers.Set(k, v) } // Set the source header ...
[ "func", "(", "c", "Client", ")", "copyObjectDo", "(", "ctx", "context", ".", "Context", ",", "srcBucket", ",", "srcObject", ",", "destBucket", ",", "destObject", "string", ",", "metadata", "map", "[", "string", "]", "string", ")", "(", "ObjectInfo", ",", ...
// Low level implementation of CopyObject API, supports only upto 5GiB worth of copy.
[ "Low", "level", "implementation", "of", "CopyObject", "API", "supports", "only", "upto", "5GiB", "worth", "of", "copy", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-compose-object.go#L220-L262
26,640
minio/minio-go
api-compose-object.go
calculateEvenSplits
func calculateEvenSplits(size int64, src SourceInfo) (startIndex, endIndex []int64) { if size == 0 { return } reqParts := partsRequired(size) startIndex = make([]int64, reqParts) endIndex = make([]int64, reqParts) // Compute number of required parts `k`, as: // // k = ceiling(size / copyPartSize) // // Now...
go
func calculateEvenSplits(size int64, src SourceInfo) (startIndex, endIndex []int64) { if size == 0 { return } reqParts := partsRequired(size) startIndex = make([]int64, reqParts) endIndex = make([]int64, reqParts) // Compute number of required parts `k`, as: // // k = ceiling(size / copyPartSize) // // Now...
[ "func", "calculateEvenSplits", "(", "size", "int64", ",", "src", "SourceInfo", ")", "(", "startIndex", ",", "endIndex", "[", "]", "int64", ")", "{", "if", "size", "==", "0", "{", "return", "\n", "}", "\n\n", "reqParts", ":=", "partsRequired", "(", "size"...
// calculateEvenSplits - computes splits for a source and returns // start and end index slices. Splits happen evenly to be sure that no // part is less than 5MiB, as that could fail the multipart request if // it is not the last part.
[ "calculateEvenSplits", "-", "computes", "splits", "for", "a", "source", "and", "returns", "start", "and", "end", "index", "slices", ".", "Splits", "happen", "evenly", "to", "be", "sure", "that", "no", "part", "is", "less", "than", "5MiB", "as", "that", "co...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-compose-object.go#L525-L565
26,641
minio/minio-go
pkg/set/stringset.go
ToSlice
func (set StringSet) ToSlice() []string { keys := make([]string, 0, len(set)) for k := range set { keys = append(keys, k) } sort.Strings(keys) return keys }
go
func (set StringSet) ToSlice() []string { keys := make([]string, 0, len(set)) for k := range set { keys = append(keys, k) } sort.Strings(keys) return keys }
[ "func", "(", "set", "StringSet", ")", "ToSlice", "(", ")", "[", "]", "string", "{", "keys", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "set", ")", ")", "\n", "for", "k", ":=", "range", "set", "{", "keys", "=", "append", ...
// ToSlice - returns StringSet as string slice.
[ "ToSlice", "-", "returns", "StringSet", "as", "string", "slice", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L30-L37
26,642
minio/minio-go
pkg/set/stringset.go
Contains
func (set StringSet) Contains(s string) bool { _, ok := set[s] return ok }
go
func (set StringSet) Contains(s string) bool { _, ok := set[s] return ok }
[ "func", "(", "set", "StringSet", ")", "Contains", "(", "s", "string", ")", "bool", "{", "_", ",", "ok", ":=", "set", "[", "s", "]", "\n", "return", "ok", "\n", "}" ]
// Contains - checks if string is in the set.
[ "Contains", "-", "checks", "if", "string", "is", "in", "the", "set", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L55-L58
26,643
minio/minio-go
pkg/set/stringset.go
FuncMatch
func (set StringSet) FuncMatch(matchFn func(string, string) bool, matchString string) StringSet { nset := NewStringSet() for k := range set { if matchFn(k, matchString) { nset.Add(k) } } return nset }
go
func (set StringSet) FuncMatch(matchFn func(string, string) bool, matchString string) StringSet { nset := NewStringSet() for k := range set { if matchFn(k, matchString) { nset.Add(k) } } return nset }
[ "func", "(", "set", "StringSet", ")", "FuncMatch", "(", "matchFn", "func", "(", "string", ",", "string", ")", "bool", ",", "matchString", "string", ")", "StringSet", "{", "nset", ":=", "NewStringSet", "(", ")", "\n", "for", "k", ":=", "range", "set", "...
// FuncMatch - returns new set containing each value who passes match function. // A 'matchFn' should accept element in a set as first argument and // 'matchString' as second argument. The function can do any logic to // compare both the arguments and should return true to accept element in // a set to include in outp...
[ "FuncMatch", "-", "returns", "new", "set", "containing", "each", "value", "who", "passes", "match", "function", ".", "A", "matchFn", "should", "accept", "element", "in", "a", "set", "as", "first", "argument", "and", "matchString", "as", "second", "argument", ...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L65-L73
26,644
minio/minio-go
pkg/set/stringset.go
ApplyFunc
func (set StringSet) ApplyFunc(applyFn func(string) string) StringSet { nset := NewStringSet() for k := range set { nset.Add(applyFn(k)) } return nset }
go
func (set StringSet) ApplyFunc(applyFn func(string) string) StringSet { nset := NewStringSet() for k := range set { nset.Add(applyFn(k)) } return nset }
[ "func", "(", "set", "StringSet", ")", "ApplyFunc", "(", "applyFn", "func", "(", "string", ")", "string", ")", "StringSet", "{", "nset", ":=", "NewStringSet", "(", ")", "\n", "for", "k", ":=", "range", "set", "{", "nset", ".", "Add", "(", "applyFn", "...
// ApplyFunc - returns new set containing each value processed by 'applyFn'. // A 'applyFn' should accept element in a set as a argument and return // a processed string. The function can do any logic to return a processed // string.
[ "ApplyFunc", "-", "returns", "new", "set", "containing", "each", "value", "processed", "by", "applyFn", ".", "A", "applyFn", "should", "accept", "element", "in", "a", "set", "as", "a", "argument", "and", "return", "a", "processed", "string", ".", "The", "f...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L79-L85
26,645
minio/minio-go
pkg/set/stringset.go
Equals
func (set StringSet) Equals(sset StringSet) bool { // If length of set is not equal to length of given set, the // set is not equal to given set. if len(set) != len(sset) { return false } // As both sets are equal in length, check each elements are equal. for k := range set { if _, ok := sset[k]; !ok { re...
go
func (set StringSet) Equals(sset StringSet) bool { // If length of set is not equal to length of given set, the // set is not equal to given set. if len(set) != len(sset) { return false } // As both sets are equal in length, check each elements are equal. for k := range set { if _, ok := sset[k]; !ok { re...
[ "func", "(", "set", "StringSet", ")", "Equals", "(", "sset", "StringSet", ")", "bool", "{", "// If length of set is not equal to length of given set, the", "// set is not equal to given set.", "if", "len", "(", "set", ")", "!=", "len", "(", "sset", ")", "{", "return...
// Equals - checks whether given set is equal to current set or not.
[ "Equals", "-", "checks", "whether", "given", "set", "is", "equal", "to", "current", "set", "or", "not", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L88-L103
26,646
minio/minio-go
pkg/set/stringset.go
Intersection
func (set StringSet) Intersection(sset StringSet) StringSet { nset := NewStringSet() for k := range set { if _, ok := sset[k]; ok { nset.Add(k) } } return nset }
go
func (set StringSet) Intersection(sset StringSet) StringSet { nset := NewStringSet() for k := range set { if _, ok := sset[k]; ok { nset.Add(k) } } return nset }
[ "func", "(", "set", "StringSet", ")", "Intersection", "(", "sset", "StringSet", ")", "StringSet", "{", "nset", ":=", "NewStringSet", "(", ")", "\n", "for", "k", ":=", "range", "set", "{", "if", "_", ",", "ok", ":=", "sset", "[", "k", "]", ";", "ok"...
// Intersection - returns the intersection with given set as new set.
[ "Intersection", "-", "returns", "the", "intersection", "with", "given", "set", "as", "new", "set", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L106-L115
26,647
minio/minio-go
pkg/set/stringset.go
Union
func (set StringSet) Union(sset StringSet) StringSet { nset := NewStringSet() for k := range set { nset.Add(k) } for k := range sset { nset.Add(k) } return nset }
go
func (set StringSet) Union(sset StringSet) StringSet { nset := NewStringSet() for k := range set { nset.Add(k) } for k := range sset { nset.Add(k) } return nset }
[ "func", "(", "set", "StringSet", ")", "Union", "(", "sset", "StringSet", ")", "StringSet", "{", "nset", ":=", "NewStringSet", "(", ")", "\n", "for", "k", ":=", "range", "set", "{", "nset", ".", "Add", "(", "k", ")", "\n", "}", "\n\n", "for", "k", ...
// Union - returns the union with given set as new set.
[ "Union", "-", "returns", "the", "union", "with", "given", "set", "as", "new", "set", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L130-L141
26,648
minio/minio-go
pkg/set/stringset.go
UnmarshalJSON
func (set *StringSet) UnmarshalJSON(data []byte) error { sl := []string{} var err error if err = json.Unmarshal(data, &sl); err == nil { *set = make(StringSet) for _, s := range sl { set.Add(s) } } else { var s string if err = json.Unmarshal(data, &s); err == nil { *set = make(StringSet) set.Add(...
go
func (set *StringSet) UnmarshalJSON(data []byte) error { sl := []string{} var err error if err = json.Unmarshal(data, &sl); err == nil { *set = make(StringSet) for _, s := range sl { set.Add(s) } } else { var s string if err = json.Unmarshal(data, &s); err == nil { *set = make(StringSet) set.Add(...
[ "func", "(", "set", "*", "StringSet", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "sl", ":=", "[", "]", "string", "{", "}", "\n", "var", "err", "error", "\n", "if", "err", "=", "json", ".", "Unmarshal", "(", "data", ",...
// UnmarshalJSON - parses JSON data and creates new set with it. // If 'data' contains JSON string array, the set contains each string. // If 'data' contains JSON string, the set contains the string as one element. // If 'data' contains Other JSON types, JSON parse error is returned.
[ "UnmarshalJSON", "-", "parses", "JSON", "data", "and", "creates", "new", "set", "with", "it", ".", "If", "data", "contains", "JSON", "string", "array", "the", "set", "contains", "each", "string", ".", "If", "data", "contains", "JSON", "string", "the", "set...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L152-L169
26,649
minio/minio-go
pkg/set/stringset.go
CreateStringSet
func CreateStringSet(sl ...string) StringSet { set := make(StringSet) for _, k := range sl { set.Add(k) } return set }
go
func CreateStringSet(sl ...string) StringSet { set := make(StringSet) for _, k := range sl { set.Add(k) } return set }
[ "func", "CreateStringSet", "(", "sl", "...", "string", ")", "StringSet", "{", "set", ":=", "make", "(", "StringSet", ")", "\n", "for", "_", ",", "k", ":=", "range", "sl", "{", "set", ".", "Add", "(", "k", ")", "\n", "}", "\n", "return", "set", "\...
// CreateStringSet - creates new string set with given string values.
[ "CreateStringSet", "-", "creates", "new", "string", "set", "with", "given", "string", "values", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L182-L188
26,650
minio/minio-go
pkg/set/stringset.go
CopyStringSet
func CopyStringSet(set StringSet) StringSet { nset := NewStringSet() for k, v := range set { nset[k] = v } return nset }
go
func CopyStringSet(set StringSet) StringSet { nset := NewStringSet() for k, v := range set { nset[k] = v } return nset }
[ "func", "CopyStringSet", "(", "set", "StringSet", ")", "StringSet", "{", "nset", ":=", "NewStringSet", "(", ")", "\n", "for", "k", ",", "v", ":=", "range", "set", "{", "nset", "[", "k", "]", "=", "v", "\n", "}", "\n", "return", "nset", "\n", "}" ]
// CopyStringSet - returns copy of given set.
[ "CopyStringSet", "-", "returns", "copy", "of", "given", "set", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/set/stringset.go#L191-L197
26,651
minio/minio-go
api-put-bucket.go
SetBucketPolicy
func (c Client) SetBucketPolicy(bucketName, policy string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // If policy is empty then delete the bucket policy. if policy == "" { return c.removeBucketPolicy(bucketName) } // Save the updated policies...
go
func (c Client) SetBucketPolicy(bucketName, policy string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // If policy is empty then delete the bucket policy. if policy == "" { return c.removeBucketPolicy(bucketName) } // Save the updated policies...
[ "func", "(", "c", "Client", ")", "SetBucketPolicy", "(", "bucketName", ",", "policy", "string", ")", "error", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";", "err", "!=", "nil", "{", "retur...
// SetBucketPolicy set the access permissions on an existing bucket.
[ "SetBucketPolicy", "set", "the", "access", "permissions", "on", "an", "existing", "bucket", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L102-L115
26,652
minio/minio-go
api-put-bucket.go
putBucketPolicy
func (c Client) putBucketPolicy(bucketName, policy string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("policy", "") ...
go
func (c Client) putBucketPolicy(bucketName, policy string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("policy", "") ...
[ "func", "(", "c", "Client", ")", "putBucketPolicy", "(", "bucketName", ",", "policy", "string", ")", "error", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";", "err", "!=", "nil", "{", "retur...
// Saves a new bucket policy.
[ "Saves", "a", "new", "bucket", "policy", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L118-L155
26,653
minio/minio-go
api-put-bucket.go
removeBucketPolicy
func (c Client) removeBucketPolicy(bucketName string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("policy", "") // Ex...
go
func (c Client) removeBucketPolicy(bucketName string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("policy", "") // Ex...
[ "func", "(", "c", "Client", ")", "removeBucketPolicy", "(", "bucketName", "string", ")", "error", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";", "err", "!=", "nil", "{", "return", "err", "...
// Removes all policies on a bucket.
[ "Removes", "all", "policies", "on", "a", "bucket", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L158-L179
26,654
minio/minio-go
api-put-bucket.go
SetBucketLifecycle
func (c Client) SetBucketLifecycle(bucketName, lifecycle string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // If lifecycle is empty then delete it. if lifecycle == "" { return c.removeBucketLifecycle(bucketName) } // Save the updated lifecycl...
go
func (c Client) SetBucketLifecycle(bucketName, lifecycle string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // If lifecycle is empty then delete it. if lifecycle == "" { return c.removeBucketLifecycle(bucketName) } // Save the updated lifecycl...
[ "func", "(", "c", "Client", ")", "SetBucketLifecycle", "(", "bucketName", ",", "lifecycle", "string", ")", "error", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";", "err", "!=", "nil", "{", ...
// SetBucketLifecycle set the lifecycle on an existing bucket.
[ "SetBucketLifecycle", "set", "the", "lifecycle", "on", "an", "existing", "bucket", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L182-L195
26,655
minio/minio-go
api-put-bucket.go
putBucketLifecycle
func (c Client) putBucketLifecycle(bucketName, lifecycle string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("lifecycl...
go
func (c Client) putBucketLifecycle(bucketName, lifecycle string) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("lifecycl...
[ "func", "(", "c", "Client", ")", "putBucketLifecycle", "(", "bucketName", ",", "lifecycle", "string", ")", "error", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";", "err", "!=", "nil", "{", ...
// Saves a new bucket lifecycle.
[ "Saves", "a", "new", "bucket", "lifecycle", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L198-L236
26,656
minio/minio-go
api-put-bucket.go
SetBucketNotification
func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.V...
go
func (c Client) SetBucketNotification(bucketName string, bucketNotification BucketNotification) error { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return err } // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.V...
[ "func", "(", "c", "Client", ")", "SetBucketNotification", "(", "bucketName", "string", ",", "bucketNotification", "BucketNotification", ")", "error", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";",...
// SetBucketNotification saves a new bucket notification.
[ "SetBucketNotification", "saves", "a", "new", "bucket", "notification", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L263-L301
26,657
minio/minio-go
api-put-bucket.go
RemoveAllBucketNotification
func (c Client) RemoveAllBucketNotification(bucketName string) error { return c.SetBucketNotification(bucketName, BucketNotification{}) }
go
func (c Client) RemoveAllBucketNotification(bucketName string) error { return c.SetBucketNotification(bucketName, BucketNotification{}) }
[ "func", "(", "c", "Client", ")", "RemoveAllBucketNotification", "(", "bucketName", "string", ")", "error", "{", "return", "c", ".", "SetBucketNotification", "(", "bucketName", ",", "BucketNotification", "{", "}", ")", "\n", "}" ]
// RemoveAllBucketNotification - Remove bucket notification clears all previously specified config
[ "RemoveAllBucketNotification", "-", "Remove", "bucket", "notification", "clears", "all", "previously", "specified", "config" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-bucket.go#L304-L306
26,658
minio/minio-go
pkg/credentials/static.go
NewStaticV2
func NewStaticV2(id, secret, token string) *Credentials { return NewStatic(id, secret, token, SignatureV2) }
go
func NewStaticV2(id, secret, token string) *Credentials { return NewStatic(id, secret, token, SignatureV2) }
[ "func", "NewStaticV2", "(", "id", ",", "secret", ",", "token", "string", ")", "*", "Credentials", "{", "return", "NewStatic", "(", "id", ",", "secret", ",", "token", ",", "SignatureV2", ")", "\n", "}" ]
// NewStaticV2 returns a pointer to a new Credentials object // wrapping a static credentials value provider, signature is // set to v2. If access and secret are not specified then // regardless of signature type set it Value will return // as anonymous.
[ "NewStaticV2", "returns", "a", "pointer", "to", "a", "new", "Credentials", "object", "wrapping", "a", "static", "credentials", "value", "provider", "signature", "is", "set", "to", "v2", ".", "If", "access", "and", "secret", "are", "not", "specified", "then", ...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/static.go#L31-L33
26,659
minio/minio-go
pkg/credentials/static.go
NewStaticV4
func NewStaticV4(id, secret, token string) *Credentials { return NewStatic(id, secret, token, SignatureV4) }
go
func NewStaticV4(id, secret, token string) *Credentials { return NewStatic(id, secret, token, SignatureV4) }
[ "func", "NewStaticV4", "(", "id", ",", "secret", ",", "token", "string", ")", "*", "Credentials", "{", "return", "NewStatic", "(", "id", ",", "secret", ",", "token", ",", "SignatureV4", ")", "\n", "}" ]
// NewStaticV4 is similar to NewStaticV2 with similar considerations.
[ "NewStaticV4", "is", "similar", "to", "NewStaticV2", "with", "similar", "considerations", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/static.go#L36-L38
26,660
minio/minio-go
pkg/credentials/static.go
NewStatic
func NewStatic(id, secret, token string, signerType SignatureType) *Credentials { return New(&Static{ Value: Value{ AccessKeyID: id, SecretAccessKey: secret, SessionToken: token, SignerType: signerType, }, }) }
go
func NewStatic(id, secret, token string, signerType SignatureType) *Credentials { return New(&Static{ Value: Value{ AccessKeyID: id, SecretAccessKey: secret, SessionToken: token, SignerType: signerType, }, }) }
[ "func", "NewStatic", "(", "id", ",", "secret", ",", "token", "string", ",", "signerType", "SignatureType", ")", "*", "Credentials", "{", "return", "New", "(", "&", "Static", "{", "Value", ":", "Value", "{", "AccessKeyID", ":", "id", ",", "SecretAccessKey",...
// NewStatic returns a pointer to a new Credentials object // wrapping a static credentials value provider.
[ "NewStatic", "returns", "a", "pointer", "to", "a", "new", "Credentials", "object", "wrapping", "a", "static", "credentials", "value", "provider", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/static.go#L42-L51
26,661
minio/minio-go
pkg/credentials/static.go
Retrieve
func (s *Static) Retrieve() (Value, error) { if s.AccessKeyID == "" || s.SecretAccessKey == "" { // Anonymous is not an error return Value{SignerType: SignatureAnonymous}, nil } return s.Value, nil }
go
func (s *Static) Retrieve() (Value, error) { if s.AccessKeyID == "" || s.SecretAccessKey == "" { // Anonymous is not an error return Value{SignerType: SignatureAnonymous}, nil } return s.Value, nil }
[ "func", "(", "s", "*", "Static", ")", "Retrieve", "(", ")", "(", "Value", ",", "error", ")", "{", "if", "s", ".", "AccessKeyID", "==", "\"", "\"", "||", "s", ".", "SecretAccessKey", "==", "\"", "\"", "{", "// Anonymous is not an error", "return", "Valu...
// Retrieve returns the static credentials.
[ "Retrieve", "returns", "the", "static", "credentials", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/static.go#L54-L60
26,662
minio/minio-go
api-put-object-file-context.go
FPutObjectWithContext
func (c Client) FPutObjectWithContext(ctx context.Context, bucketName, objectName, filePath string, opts PutObjectOptions) (n int64, err error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return 0, err } if err := s3utils.CheckValidObjectName(objectName); err != nil { ...
go
func (c Client) FPutObjectWithContext(ctx context.Context, bucketName, objectName, filePath string, opts PutObjectOptions) (n int64, err error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return 0, err } if err := s3utils.CheckValidObjectName(objectName); err != nil { ...
[ "func", "(", "c", "Client", ")", "FPutObjectWithContext", "(", "ctx", "context", ".", "Context", ",", "bucketName", ",", "objectName", ",", "filePath", "string", ",", "opts", "PutObjectOptions", ")", "(", "n", "int64", ",", "err", "error", ")", "{", "// In...
// FPutObjectWithContext - Create an object in a bucket, with contents from file at filePath. Allows request cancellation.
[ "FPutObjectWithContext", "-", "Create", "an", "object", "in", "a", "bucket", "with", "contents", "from", "file", "at", "filePath", ".", "Allows", "request", "cancellation", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-object-file-context.go#L30-L64
26,663
minio/minio-go
api.go
NewV2
func NewV2(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Client, error) { creds := credentials.NewStaticV2(accessKeyID, secretAccessKey, "") clnt, err := privateNew(endpoint, creds, secure, "", BucketLookupAuto) if err != nil { return nil, err } clnt.overrideSignerType = credentials.Signat...
go
func NewV2(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Client, error) { creds := credentials.NewStaticV2(accessKeyID, secretAccessKey, "") clnt, err := privateNew(endpoint, creds, secure, "", BucketLookupAuto) if err != nil { return nil, err } clnt.overrideSignerType = credentials.Signat...
[ "func", "NewV2", "(", "endpoint", "string", ",", "accessKeyID", ",", "secretAccessKey", "string", ",", "secure", "bool", ")", "(", "*", "Client", ",", "error", ")", "{", "creds", ":=", "credentials", ".", "NewStaticV2", "(", "accessKeyID", ",", "secretAccess...
// NewV2 - instantiate minio client with Amazon S3 signature version // '2' compatibility.
[ "NewV2", "-", "instantiate", "minio", "client", "with", "Amazon", "S3", "signature", "version", "2", "compatibility", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L129-L137
26,664
minio/minio-go
api.go
NewV4
func NewV4(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Client, error) { creds := credentials.NewStaticV4(accessKeyID, secretAccessKey, "") clnt, err := privateNew(endpoint, creds, secure, "", BucketLookupAuto) if err != nil { return nil, err } clnt.overrideSignerType = credentials.Signat...
go
func NewV4(endpoint string, accessKeyID, secretAccessKey string, secure bool) (*Client, error) { creds := credentials.NewStaticV4(accessKeyID, secretAccessKey, "") clnt, err := privateNew(endpoint, creds, secure, "", BucketLookupAuto) if err != nil { return nil, err } clnt.overrideSignerType = credentials.Signat...
[ "func", "NewV4", "(", "endpoint", "string", ",", "accessKeyID", ",", "secretAccessKey", "string", ",", "secure", "bool", ")", "(", "*", "Client", ",", "error", ")", "{", "creds", ":=", "credentials", ".", "NewStaticV4", "(", "accessKeyID", ",", "secretAccess...
// NewV4 - instantiate minio client with Amazon S3 signature version // '4' compatibility.
[ "NewV4", "-", "instantiate", "minio", "client", "with", "Amazon", "S3", "signature", "version", "4", "compatibility", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L141-L149
26,665
minio/minio-go
api.go
New
func New(endpoint, accessKeyID, secretAccessKey string, secure bool) (*Client, error) { creds := credentials.NewStaticV4(accessKeyID, secretAccessKey, "") clnt, err := privateNew(endpoint, creds, secure, "", BucketLookupAuto) if err != nil { return nil, err } // Google cloud storage should be set to signature V2...
go
func New(endpoint, accessKeyID, secretAccessKey string, secure bool) (*Client, error) { creds := credentials.NewStaticV4(accessKeyID, secretAccessKey, "") clnt, err := privateNew(endpoint, creds, secure, "", BucketLookupAuto) if err != nil { return nil, err } // Google cloud storage should be set to signature V2...
[ "func", "New", "(", "endpoint", ",", "accessKeyID", ",", "secretAccessKey", "string", ",", "secure", "bool", ")", "(", "*", "Client", ",", "error", ")", "{", "creds", ":=", "credentials", ".", "NewStaticV4", "(", "accessKeyID", ",", "secretAccessKey", ",", ...
// New - instantiate minio client, adds automatic verification of signature.
[ "New", "-", "instantiate", "minio", "client", "adds", "automatic", "verification", "of", "signature", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L152-L167
26,666
minio/minio-go
api.go
NewWithCredentials
func NewWithCredentials(endpoint string, creds *credentials.Credentials, secure bool, region string) (*Client, error) { return privateNew(endpoint, creds, secure, region, BucketLookupAuto) }
go
func NewWithCredentials(endpoint string, creds *credentials.Credentials, secure bool, region string) (*Client, error) { return privateNew(endpoint, creds, secure, region, BucketLookupAuto) }
[ "func", "NewWithCredentials", "(", "endpoint", "string", ",", "creds", "*", "credentials", ".", "Credentials", ",", "secure", "bool", ",", "region", "string", ")", "(", "*", "Client", ",", "error", ")", "{", "return", "privateNew", "(", "endpoint", ",", "c...
// NewWithCredentials - instantiate minio client with credentials provider // for retrieving credentials from various credentials provider such as // IAM, File, Env etc.
[ "NewWithCredentials", "-", "instantiate", "minio", "client", "with", "credentials", "provider", "for", "retrieving", "credentials", "from", "various", "credentials", "provider", "such", "as", "IAM", "File", "Env", "etc", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L172-L174
26,667
minio/minio-go
api.go
NewWithOptions
func NewWithOptions(endpoint string, opts *Options) (*Client, error) { return privateNew(endpoint, opts.Creds, opts.Secure, opts.Region, opts.BucketLookup) }
go
func NewWithOptions(endpoint string, opts *Options) (*Client, error) { return privateNew(endpoint, opts.Creds, opts.Secure, opts.Region, opts.BucketLookup) }
[ "func", "NewWithOptions", "(", "endpoint", "string", ",", "opts", "*", "Options", ")", "(", "*", "Client", ",", "error", ")", "{", "return", "privateNew", "(", "endpoint", ",", "opts", ".", "Creds", ",", "opts", ".", "Secure", ",", "opts", ".", "Region...
// NewWithOptions - instantiate minio client with options
[ "NewWithOptions", "-", "instantiate", "minio", "client", "with", "options" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L185-L187
26,668
minio/minio-go
api.go
redirectHeaders
func (c *Client) redirectHeaders(req *http.Request, via []*http.Request) error { if len(via) >= 5 { return errors.New("stopped after 5 redirects") } if len(via) == 0 { return nil } lastRequest := via[len(via)-1] var reAuth bool for attr, val := range lastRequest.Header { // if hosts do not match do not cop...
go
func (c *Client) redirectHeaders(req *http.Request, via []*http.Request) error { if len(via) >= 5 { return errors.New("stopped after 5 redirects") } if len(via) == 0 { return nil } lastRequest := via[len(via)-1] var reAuth bool for attr, val := range lastRequest.Header { // if hosts do not match do not cop...
[ "func", "(", "c", "*", "Client", ")", "redirectHeaders", "(", "req", "*", "http", ".", "Request", ",", "via", "[", "]", "*", "http", ".", "Request", ")", "error", "{", "if", "len", "(", "via", ")", ">=", "5", "{", "return", "errors", ".", "New", ...
// Redirect requests by re signing the request.
[ "Redirect", "requests", "by", "re", "signing", "the", "request", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L212-L270
26,669
minio/minio-go
api.go
hashMaterials
func (c *Client) hashMaterials() (hashAlgos map[string]hash.Hash, hashSums map[string][]byte) { hashSums = make(map[string][]byte) hashAlgos = make(map[string]hash.Hash) if c.overrideSignerType.IsV4() { if c.secure { hashAlgos["md5"] = md5.New() } else { hashAlgos["sha256"] = sha256.New() } } else { i...
go
func (c *Client) hashMaterials() (hashAlgos map[string]hash.Hash, hashSums map[string][]byte) { hashSums = make(map[string][]byte) hashAlgos = make(map[string]hash.Hash) if c.overrideSignerType.IsV4() { if c.secure { hashAlgos["md5"] = md5.New() } else { hashAlgos["sha256"] = sha256.New() } } else { i...
[ "func", "(", "c", "*", "Client", ")", "hashMaterials", "(", ")", "(", "hashAlgos", "map", "[", "string", "]", "hash", ".", "Hash", ",", "hashSums", "map", "[", "string", "]", "[", "]", "byte", ")", "{", "hashSums", "=", "make", "(", "map", "[", "...
// Hash materials provides relevant initialized hash algo writers // based on the expected signature type. // // - For signature v4 request if the connection is insecure compute only sha256. // - For signature v4 request if the connection is secure compute only md5. // - For anonymous request compute md5.
[ "Hash", "materials", "provides", "relevant", "initialized", "hash", "algo", "writers", "based", "on", "the", "expected", "signature", "type", ".", "-", "For", "signature", "v4", "request", "if", "the", "connection", "is", "insecure", "compute", "only", "sha256",...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L399-L414
26,670
minio/minio-go
api.go
isVirtualHostStyleRequest
func (c *Client) isVirtualHostStyleRequest(url url.URL, bucketName string) bool { if bucketName == "" { return false } if c.lookup == BucketLookupDNS { return true } if c.lookup == BucketLookupPath { return false } // default to virtual only for Amazon/Google storage. In all other cases use // path sty...
go
func (c *Client) isVirtualHostStyleRequest(url url.URL, bucketName string) bool { if bucketName == "" { return false } if c.lookup == BucketLookupDNS { return true } if c.lookup == BucketLookupPath { return false } // default to virtual only for Amazon/Google storage. In all other cases use // path sty...
[ "func", "(", "c", "*", "Client", ")", "isVirtualHostStyleRequest", "(", "url", "url", ".", "URL", ",", "bucketName", "string", ")", "bool", "{", "if", "bucketName", "==", "\"", "\"", "{", "return", "false", "\n", "}", "\n\n", "if", "c", ".", "lookup", ...
// returns true if virtual hosted style requests are to be used.
[ "returns", "true", "if", "virtual", "hosted", "style", "requests", "are", "to", "be", "used", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api.go#L888-L903
26,671
minio/minio-go
api-list.go
listIncompleteUploads
func (c Client) listIncompleteUploads(bucketName, objectPrefix string, recursive, aggregateSize bool, doneCh <-chan struct{}) <-chan ObjectMultipartInfo { // Allocate channel for multipart uploads. objectMultipartStatCh := make(chan ObjectMultipartInfo, 1) // Delimiter is set to "/" by default. delimiter := "/" if...
go
func (c Client) listIncompleteUploads(bucketName, objectPrefix string, recursive, aggregateSize bool, doneCh <-chan struct{}) <-chan ObjectMultipartInfo { // Allocate channel for multipart uploads. objectMultipartStatCh := make(chan ObjectMultipartInfo, 1) // Delimiter is set to "/" by default. delimiter := "/" if...
[ "func", "(", "c", "Client", ")", "listIncompleteUploads", "(", "bucketName", ",", "objectPrefix", "string", ",", "recursive", ",", "aggregateSize", "bool", ",", "doneCh", "<-", "chan", "struct", "{", "}", ")", "<-", "chan", "ObjectMultipartInfo", "{", "// Allo...
// listIncompleteUploads lists all incomplete uploads.
[ "listIncompleteUploads", "lists", "all", "incomplete", "uploads", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-list.go#L452-L537
26,672
minio/minio-go
api-list.go
listObjectParts
func (c Client) listObjectParts(bucketName, objectName, uploadID string) (partsInfo map[int]ObjectPart, err error) { // Part number marker for the next batch of request. var nextPartNumberMarker int partsInfo = make(map[int]ObjectPart) for { // Get list of uploaded parts a maximum of 1000 per request. listObjPa...
go
func (c Client) listObjectParts(bucketName, objectName, uploadID string) (partsInfo map[int]ObjectPart, err error) { // Part number marker for the next batch of request. var nextPartNumberMarker int partsInfo = make(map[int]ObjectPart) for { // Get list of uploaded parts a maximum of 1000 per request. listObjPa...
[ "func", "(", "c", "Client", ")", "listObjectParts", "(", "bucketName", ",", "objectName", ",", "uploadID", "string", ")", "(", "partsInfo", "map", "[", "int", "]", "ObjectPart", ",", "err", "error", ")", "{", "// Part number marker for the next batch of request.",...
// listObjectParts list all object parts recursively.
[ "listObjectParts", "list", "all", "object", "parts", "recursively", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-list.go#L602-L629
26,673
minio/minio-go
api-list.go
findUploadIDs
func (c Client) findUploadIDs(bucketName, objectName string) ([]string, error) { var uploadIDs []string // Make list incomplete uploads recursive. isRecursive := true // Turn off size aggregation of individual parts, in this request. isAggregateSize := false // Create done channel to cleanup the routine. doneCh ...
go
func (c Client) findUploadIDs(bucketName, objectName string) ([]string, error) { var uploadIDs []string // Make list incomplete uploads recursive. isRecursive := true // Turn off size aggregation of individual parts, in this request. isAggregateSize := false // Create done channel to cleanup the routine. doneCh ...
[ "func", "(", "c", "Client", ")", "findUploadIDs", "(", "bucketName", ",", "objectName", "string", ")", "(", "[", "]", "string", ",", "error", ")", "{", "var", "uploadIDs", "[", "]", "string", "\n", "// Make list incomplete uploads recursive.", "isRecursive", "...
// findUploadIDs lists all incomplete uploads and find the uploadIDs of the matching object name.
[ "findUploadIDs", "lists", "all", "incomplete", "uploads", "and", "find", "the", "uploadIDs", "of", "the", "matching", "object", "name", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-list.go#L632-L652
26,674
minio/minio-go
api-list.go
getTotalMultipartSize
func (c Client) getTotalMultipartSize(bucketName, objectName, uploadID string) (size int64, err error) { // Iterate over all parts and aggregate the size. partsInfo, err := c.listObjectParts(bucketName, objectName, uploadID) if err != nil { return 0, err } for _, partInfo := range partsInfo { size += partInfo....
go
func (c Client) getTotalMultipartSize(bucketName, objectName, uploadID string) (size int64, err error) { // Iterate over all parts and aggregate the size. partsInfo, err := c.listObjectParts(bucketName, objectName, uploadID) if err != nil { return 0, err } for _, partInfo := range partsInfo { size += partInfo....
[ "func", "(", "c", "Client", ")", "getTotalMultipartSize", "(", "bucketName", ",", "objectName", ",", "uploadID", "string", ")", "(", "size", "int64", ",", "err", "error", ")", "{", "// Iterate over all parts and aggregate the size.", "partsInfo", ",", "err", ":=",...
// getTotalMultipartSize - calculate total uploaded size for the a given multipart object.
[ "getTotalMultipartSize", "-", "calculate", "total", "uploaded", "size", "for", "the", "a", "given", "multipart", "object", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-list.go#L655-L665
26,675
minio/minio-go
retry-continous.go
newRetryTimerContinous
func (c Client) newRetryTimerContinous(unit time.Duration, cap time.Duration, jitter float64, doneCh chan struct{}) <-chan int { attemptCh := make(chan int) // normalize jitter to the range [0, 1.0] if jitter < NoJitter { jitter = NoJitter } if jitter > MaxJitter { jitter = MaxJitter } // computes the expo...
go
func (c Client) newRetryTimerContinous(unit time.Duration, cap time.Duration, jitter float64, doneCh chan struct{}) <-chan int { attemptCh := make(chan int) // normalize jitter to the range [0, 1.0] if jitter < NoJitter { jitter = NoJitter } if jitter > MaxJitter { jitter = MaxJitter } // computes the expo...
[ "func", "(", "c", "Client", ")", "newRetryTimerContinous", "(", "unit", "time", ".", "Duration", ",", "cap", "time", ".", "Duration", ",", "jitter", "float64", ",", "doneCh", "chan", "struct", "{", "}", ")", "<-", "chan", "int", "{", "attemptCh", ":=", ...
// newRetryTimerContinous creates a timer with exponentially increasing delays forever.
[ "newRetryTimerContinous", "creates", "a", "timer", "with", "exponentially", "increasing", "delays", "forever", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/retry-continous.go#L23-L69
26,676
minio/minio-go
pkg/credentials/iam_aws.go
NewIAM
func NewIAM(endpoint string) *Credentials { p := &IAM{ Client: &http.Client{ Transport: http.DefaultTransport, }, endpoint: endpoint, } return New(p) }
go
func NewIAM(endpoint string) *Credentials { p := &IAM{ Client: &http.Client{ Transport: http.DefaultTransport, }, endpoint: endpoint, } return New(p) }
[ "func", "NewIAM", "(", "endpoint", "string", ")", "*", "Credentials", "{", "p", ":=", "&", "IAM", "{", "Client", ":", "&", "http", ".", "Client", "{", "Transport", ":", "http", ".", "DefaultTransport", ",", "}", ",", "endpoint", ":", "endpoint", ",", ...
// NewIAM returns a pointer to a new Credentials object wrapping the IAM.
[ "NewIAM", "returns", "a", "pointer", "to", "a", "new", "Credentials", "object", "wrapping", "the", "IAM", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/iam_aws.go#L71-L79
26,677
minio/minio-go
pkg/credentials/iam_aws.go
Retrieve
func (m *IAM) Retrieve() (Value, error) { endpoint, isEcsTask := getEndpoint(m.endpoint) var roleCreds ec2RoleCredRespBody var err error if isEcsTask { roleCreds, err = getEcsTaskCredentials(m.Client, endpoint) } else { roleCreds, err = getCredentials(m.Client, endpoint) } if err != nil { return Value{}, e...
go
func (m *IAM) Retrieve() (Value, error) { endpoint, isEcsTask := getEndpoint(m.endpoint) var roleCreds ec2RoleCredRespBody var err error if isEcsTask { roleCreds, err = getEcsTaskCredentials(m.Client, endpoint) } else { roleCreds, err = getCredentials(m.Client, endpoint) } if err != nil { return Value{}, e...
[ "func", "(", "m", "*", "IAM", ")", "Retrieve", "(", ")", "(", "Value", ",", "error", ")", "{", "endpoint", ",", "isEcsTask", ":=", "getEndpoint", "(", "m", ".", "endpoint", ")", "\n", "var", "roleCreds", "ec2RoleCredRespBody", "\n", "var", "err", "erro...
// Retrieve retrieves credentials from the EC2 service. // Error will be returned if the request fails, or unable to extract // the desired
[ "Retrieve", "retrieves", "credentials", "from", "the", "EC2", "service", ".", "Error", "will", "be", "returned", "if", "the", "request", "fails", "or", "unable", "to", "extract", "the", "desired" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/iam_aws.go#L84-L105
26,678
minio/minio-go
pkg/credentials/iam_aws.go
getCredentials
func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, error) { // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html u, err := getIAMRoleURL(endpoint) if err != nil { return ec2RoleCredRespBody{}, err } // http://docs.aws.amazon.com/AWSEC2/latest/UserGuid...
go
func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, error) { // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html u, err := getIAMRoleURL(endpoint) if err != nil { return ec2RoleCredRespBody{}, err } // http://docs.aws.amazon.com/AWSEC2/latest/UserGuid...
[ "func", "getCredentials", "(", "client", "*", "http", ".", "Client", ",", "endpoint", "string", ")", "(", "ec2RoleCredRespBody", ",", "error", ")", "{", "// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html", "u", ",", "err", ":=", "getIAM...
// getCredentials - obtains the credentials from the IAM role name associated with // the current EC2 service. // // If the credentials cannot be found, or there is an error // reading the response an error will be returned.
[ "getCredentials", "-", "obtains", "the", "credentials", "from", "the", "IAM", "role", "name", "associated", "with", "the", "current", "EC2", "service", ".", "If", "the", "credentials", "cannot", "be", "found", "or", "there", "is", "an", "error", "reading", "...
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/iam_aws.go#L196-L250
26,679
minio/minio-go
api-put-object-copy.go
CopyObject
func (c Client) CopyObject(dst DestinationInfo, src SourceInfo) error { return c.CopyObjectWithProgress(dst, src, nil) }
go
func (c Client) CopyObject(dst DestinationInfo, src SourceInfo) error { return c.CopyObjectWithProgress(dst, src, nil) }
[ "func", "(", "c", "Client", ")", "CopyObject", "(", "dst", "DestinationInfo", ",", "src", "SourceInfo", ")", "error", "{", "return", "c", ".", "CopyObjectWithProgress", "(", "dst", ",", "src", ",", "nil", ")", "\n", "}" ]
// CopyObject - copy a source object into a new object
[ "CopyObject", "-", "copy", "a", "source", "object", "into", "a", "new", "object" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-object-copy.go#L30-L32
26,680
minio/minio-go
api-put-object-copy.go
CopyObjectWithProgress
func (c Client) CopyObjectWithProgress(dst DestinationInfo, src SourceInfo, progress io.Reader) error { header := make(http.Header) for k, v := range src.Headers { header[k] = v } var err error var size int64 // If progress bar is specified, size should be requested as well initiate a StatObject request. if p...
go
func (c Client) CopyObjectWithProgress(dst DestinationInfo, src SourceInfo, progress io.Reader) error { header := make(http.Header) for k, v := range src.Headers { header[k] = v } var err error var size int64 // If progress bar is specified, size should be requested as well initiate a StatObject request. if p...
[ "func", "(", "c", "Client", ")", "CopyObjectWithProgress", "(", "dst", "DestinationInfo", ",", "src", "SourceInfo", ",", "progress", "io", ".", "Reader", ")", "error", "{", "header", ":=", "make", "(", "http", ".", "Header", ")", "\n", "for", "k", ",", ...
// CopyObjectWithProgress - copy a source object into a new object, optionally takes // progress bar input to notify current progress.
[ "CopyObjectWithProgress", "-", "copy", "a", "source", "object", "into", "a", "new", "object", "optionally", "takes", "progress", "bar", "input", "to", "notify", "current", "progress", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-object-copy.go#L36-L83
26,681
minio/minio-go
api-put-object-file.go
FPutObject
func (c Client) FPutObject(bucketName, objectName, filePath string, opts PutObjectOptions) (n int64, err error) { return c.FPutObjectWithContext(context.Background(), bucketName, objectName, filePath, opts) }
go
func (c Client) FPutObject(bucketName, objectName, filePath string, opts PutObjectOptions) (n int64, err error) { return c.FPutObjectWithContext(context.Background(), bucketName, objectName, filePath, opts) }
[ "func", "(", "c", "Client", ")", "FPutObject", "(", "bucketName", ",", "objectName", ",", "filePath", "string", ",", "opts", "PutObjectOptions", ")", "(", "n", "int64", ",", "err", "error", ")", "{", "return", "c", ".", "FPutObjectWithContext", "(", "conte...
// FPutObject - Create an object in a bucket, with contents from file at filePath
[ "FPutObject", "-", "Create", "an", "object", "in", "a", "bucket", "with", "contents", "from", "file", "at", "filePath" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-put-object-file.go#L25-L27
26,682
minio/minio-go
s3-endpoints.go
getS3Endpoint
func getS3Endpoint(bucketLocation string) (s3Endpoint string) { s3Endpoint, ok := awsS3EndpointMap[bucketLocation] if !ok { // Default to 's3.dualstack.us-east-1.amazonaws.com' endpoint. s3Endpoint = "s3.dualstack.us-east-1.amazonaws.com" } return s3Endpoint }
go
func getS3Endpoint(bucketLocation string) (s3Endpoint string) { s3Endpoint, ok := awsS3EndpointMap[bucketLocation] if !ok { // Default to 's3.dualstack.us-east-1.amazonaws.com' endpoint. s3Endpoint = "s3.dualstack.us-east-1.amazonaws.com" } return s3Endpoint }
[ "func", "getS3Endpoint", "(", "bucketLocation", "string", ")", "(", "s3Endpoint", "string", ")", "{", "s3Endpoint", ",", "ok", ":=", "awsS3EndpointMap", "[", "bucketLocation", "]", "\n", "if", "!", "ok", "{", "// Default to 's3.dualstack.us-east-1.amazonaws.com' endpo...
// getS3Endpoint get Amazon S3 endpoint based on the bucket location.
[ "getS3Endpoint", "get", "Amazon", "S3", "endpoint", "based", "on", "the", "bucket", "location", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/s3-endpoints.go#L45-L52
26,683
minio/minio-go
api-get-policy.go
GetBucketPolicy
func (c Client) GetBucketPolicy(bucketName string) (string, error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return "", err } bucketPolicy, err := c.getBucketPolicy(bucketName) if err != nil { errResponse := ToErrorResponse(err) if errResponse.Code == "NoSuchBuck...
go
func (c Client) GetBucketPolicy(bucketName string) (string, error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return "", err } bucketPolicy, err := c.getBucketPolicy(bucketName) if err != nil { errResponse := ToErrorResponse(err) if errResponse.Code == "NoSuchBuck...
[ "func", "(", "c", "Client", ")", "GetBucketPolicy", "(", "bucketName", "string", ")", "(", "string", ",", "error", ")", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "bucketName", ")", ";", "err", "!=", "nil", ...
// GetBucketPolicy - get bucket policy at a given path.
[ "GetBucketPolicy", "-", "get", "bucket", "policy", "at", "a", "given", "path", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-get-policy.go#L30-L44
26,684
minio/minio-go
api-get-policy.go
getBucketPolicy
func (c Client) getBucketPolicy(bucketName string) (string, error) { // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("policy", "") // Execute GET on bucket to list objects. resp, err := c.executeMethod(context.Background(), "GET", r...
go
func (c Client) getBucketPolicy(bucketName string) (string, error) { // Get resources properly escaped and lined up before // using them in http request. urlValues := make(url.Values) urlValues.Set("policy", "") // Execute GET on bucket to list objects. resp, err := c.executeMethod(context.Background(), "GET", r...
[ "func", "(", "c", "Client", ")", "getBucketPolicy", "(", "bucketName", "string", ")", "(", "string", ",", "error", ")", "{", "// Get resources properly escaped and lined up before", "// using them in http request.", "urlValues", ":=", "make", "(", "url", ".", "Values"...
// Request server for current bucket policy.
[ "Request", "server", "for", "current", "bucket", "policy", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-get-policy.go#L47-L78
26,685
minio/minio-go
pkg/s3signer/request-signature-streaming.go
getSignedChunkLength
func getSignedChunkLength(chunkDataSize int64) int64 { return int64(len(fmt.Sprintf("%x", chunkDataSize))) + chunkSigConstLen + signatureStrLen + crlfLen + chunkDataSize + crlfLen }
go
func getSignedChunkLength(chunkDataSize int64) int64 { return int64(len(fmt.Sprintf("%x", chunkDataSize))) + chunkSigConstLen + signatureStrLen + crlfLen + chunkDataSize + crlfLen }
[ "func", "getSignedChunkLength", "(", "chunkDataSize", "int64", ")", "int64", "{", "return", "int64", "(", "len", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "chunkDataSize", ")", ")", ")", "+", "chunkSigConstLen", "+", "signatureStrLen", "+", "crlfLen"...
// getSignedChunkLength - calculates the length of chunk metadata
[ "getSignedChunkLength", "-", "calculates", "the", "length", "of", "chunk", "metadata" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L53-L60
26,686
minio/minio-go
pkg/s3signer/request-signature-streaming.go
buildChunkStringToSign
func buildChunkStringToSign(t time.Time, region, previousSig string, chunkData []byte) string { stringToSignParts := []string{ streamingPayloadHdr, t.Format(iso8601DateFormat), getScope(region, t), previousSig, emptySHA256, hex.EncodeToString(sum256(chunkData)), } return strings.Join(stringToSignParts, ...
go
func buildChunkStringToSign(t time.Time, region, previousSig string, chunkData []byte) string { stringToSignParts := []string{ streamingPayloadHdr, t.Format(iso8601DateFormat), getScope(region, t), previousSig, emptySHA256, hex.EncodeToString(sum256(chunkData)), } return strings.Join(stringToSignParts, ...
[ "func", "buildChunkStringToSign", "(", "t", "time", ".", "Time", ",", "region", ",", "previousSig", "string", ",", "chunkData", "[", "]", "byte", ")", "string", "{", "stringToSignParts", ":=", "[", "]", "string", "{", "streamingPayloadHdr", ",", "t", ".", ...
// buildChunkStringToSign - returns the string to sign given chunk data // and previous signature.
[ "buildChunkStringToSign", "-", "returns", "the", "string", "to", "sign", "given", "chunk", "data", "and", "previous", "signature", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L81-L92
26,687
minio/minio-go
pkg/s3signer/request-signature-streaming.go
prepareStreamingRequest
func prepareStreamingRequest(req *http.Request, sessionToken string, dataLen int64, timestamp time.Time) { // Set x-amz-content-sha256 header. req.Header.Set("X-Amz-Content-Sha256", streamingSignAlgorithm) if sessionToken != "" { req.Header.Set("X-Amz-Security-Token", sessionToken) } req.Header.Set("X-Amz-Date"...
go
func prepareStreamingRequest(req *http.Request, sessionToken string, dataLen int64, timestamp time.Time) { // Set x-amz-content-sha256 header. req.Header.Set("X-Amz-Content-Sha256", streamingSignAlgorithm) if sessionToken != "" { req.Header.Set("X-Amz-Security-Token", sessionToken) } req.Header.Set("X-Amz-Date"...
[ "func", "prepareStreamingRequest", "(", "req", "*", "http", ".", "Request", ",", "sessionToken", "string", ",", "dataLen", "int64", ",", "timestamp", "time", ".", "Time", ")", "{", "// Set x-amz-content-sha256 header.", "req", ".", "Header", ".", "Set", "(", "...
// prepareStreamingRequest - prepares a request with appropriate // headers before computing the seed signature.
[ "prepareStreamingRequest", "-", "prepares", "a", "request", "with", "appropriate", "headers", "before", "computing", "the", "seed", "signature", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L96-L107
26,688
minio/minio-go
pkg/s3signer/request-signature-streaming.go
buildChunkSignature
func buildChunkSignature(chunkData []byte, reqTime time.Time, region, previousSignature, secretAccessKey string) string { chunkStringToSign := buildChunkStringToSign(reqTime, region, previousSignature, chunkData) signingKey := getSigningKey(secretAccessKey, region, reqTime) return getSignature(signingKey, chunkS...
go
func buildChunkSignature(chunkData []byte, reqTime time.Time, region, previousSignature, secretAccessKey string) string { chunkStringToSign := buildChunkStringToSign(reqTime, region, previousSignature, chunkData) signingKey := getSigningKey(secretAccessKey, region, reqTime) return getSignature(signingKey, chunkS...
[ "func", "buildChunkSignature", "(", "chunkData", "[", "]", "byte", ",", "reqTime", "time", ".", "Time", ",", "region", ",", "previousSignature", ",", "secretAccessKey", "string", ")", "string", "{", "chunkStringToSign", ":=", "buildChunkStringToSign", "(", "reqTim...
// buildChunkSignature - returns chunk signature for a given chunk and previous signature.
[ "buildChunkSignature", "-", "returns", "chunk", "signature", "for", "a", "given", "chunk", "and", "previous", "signature", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L116-L123
26,689
minio/minio-go
pkg/s3signer/request-signature-streaming.go
setSeedSignature
func (s *StreamingReader) setSeedSignature(req *http.Request) { // Get canonical request canonicalRequest := getCanonicalRequest(*req, ignoredStreamingHeaders) // Get string to sign from canonical request. stringToSign := getStringToSignV4(s.reqTime, s.region, canonicalRequest) signingKey := getSigningKey(s.secr...
go
func (s *StreamingReader) setSeedSignature(req *http.Request) { // Get canonical request canonicalRequest := getCanonicalRequest(*req, ignoredStreamingHeaders) // Get string to sign from canonical request. stringToSign := getStringToSignV4(s.reqTime, s.region, canonicalRequest) signingKey := getSigningKey(s.secr...
[ "func", "(", "s", "*", "StreamingReader", ")", "setSeedSignature", "(", "req", "*", "http", ".", "Request", ")", "{", "// Get canonical request", "canonicalRequest", ":=", "getCanonicalRequest", "(", "*", "req", ",", "ignoredStreamingHeaders", ")", "\n\n", "// Get...
// getSeedSignature - returns the seed signature for a given request.
[ "getSeedSignature", "-", "returns", "the", "seed", "signature", "for", "a", "given", "request", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L126-L137
26,690
minio/minio-go
pkg/s3signer/request-signature-streaming.go
signChunk
func (s *StreamingReader) signChunk(chunkLen int) { // Compute chunk signature for next header signature := buildChunkSignature(s.chunkBuf[:chunkLen], s.reqTime, s.region, s.prevSignature, s.secretAccessKey) // For next chunk signature computation s.prevSignature = signature // Write chunk header into streamin...
go
func (s *StreamingReader) signChunk(chunkLen int) { // Compute chunk signature for next header signature := buildChunkSignature(s.chunkBuf[:chunkLen], s.reqTime, s.region, s.prevSignature, s.secretAccessKey) // For next chunk signature computation s.prevSignature = signature // Write chunk header into streamin...
[ "func", "(", "s", "*", "StreamingReader", ")", "signChunk", "(", "chunkLen", "int", ")", "{", "// Compute chunk signature for next header", "signature", ":=", "buildChunkSignature", "(", "s", ".", "chunkBuf", "[", ":", "chunkLen", "]", ",", "s", ".", "reqTime", ...
// signChunk - signs a chunk read from s.baseReader of chunkLen size.
[ "signChunk", "-", "signs", "a", "chunk", "read", "from", "s", ".", "baseReader", "of", "chunkLen", "size", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L162-L183
26,691
minio/minio-go
pkg/s3signer/request-signature-streaming.go
setStreamingAuthHeader
func (s *StreamingReader) setStreamingAuthHeader(req *http.Request) { credential := GetCredential(s.accessKeyID, s.region, s.reqTime) authParts := []string{ signV4Algorithm + " Credential=" + credential, "SignedHeaders=" + getSignedHeaders(*req, ignoredStreamingHeaders), "Signature=" + s.seedSignature, } // ...
go
func (s *StreamingReader) setStreamingAuthHeader(req *http.Request) { credential := GetCredential(s.accessKeyID, s.region, s.reqTime) authParts := []string{ signV4Algorithm + " Credential=" + credential, "SignedHeaders=" + getSignedHeaders(*req, ignoredStreamingHeaders), "Signature=" + s.seedSignature, } // ...
[ "func", "(", "s", "*", "StreamingReader", ")", "setStreamingAuthHeader", "(", "req", "*", "http", ".", "Request", ")", "{", "credential", ":=", "GetCredential", "(", "s", ".", "accessKeyID", ",", "s", ".", "region", ",", "s", ".", "reqTime", ")", "\n", ...
// setStreamingAuthHeader - builds and sets authorization header value // for streaming signature.
[ "setStreamingAuthHeader", "-", "builds", "and", "sets", "authorization", "header", "value", "for", "streaming", "signature", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L187-L198
26,692
minio/minio-go
pkg/s3signer/request-signature-streaming.go
StreamingSignV4
func StreamingSignV4(req *http.Request, accessKeyID, secretAccessKey, sessionToken, region string, dataLen int64, reqTime time.Time) *http.Request { // Set headers needed for streaming signature. prepareStreamingRequest(req, sessionToken, dataLen, reqTime) if req.Body == nil { req.Body = ioutil.NopCloser(bytes....
go
func StreamingSignV4(req *http.Request, accessKeyID, secretAccessKey, sessionToken, region string, dataLen int64, reqTime time.Time) *http.Request { // Set headers needed for streaming signature. prepareStreamingRequest(req, sessionToken, dataLen, reqTime) if req.Body == nil { req.Body = ioutil.NopCloser(bytes....
[ "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.
[ "StreamingSignV4", "-", "provides", "chunked", "upload", "signatureV4", "support", "by", "implementing", "io", ".", "Reader", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L202-L240
26,693
minio/minio-go
pkg/s3signer/request-signature-streaming.go
Read
func (s *StreamingReader) Read(buf []byte) (int, error) { switch { // After the last chunk is read from underlying reader, we // never re-fill s.buf. case s.done: // s.buf will be (re-)filled with next chunk when has lesser // bytes than asked for. case s.buf.Len() < len(buf): s.chunkBufLen = 0 for { n1,...
go
func (s *StreamingReader) Read(buf []byte) (int, error) { switch { // After the last chunk is read from underlying reader, we // never re-fill s.buf. case s.done: // s.buf will be (re-)filled with next chunk when has lesser // bytes than asked for. case s.buf.Len() < len(buf): s.chunkBufLen = 0 for { n1,...
[ "func", "(", "s", "*", "StreamingReader", ")", "Read", "(", "buf", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "switch", "{", "// After the last chunk is read from underlying reader, we", "// never re-fill s.buf.", "case", "s", ".", "done", ":", ...
// Read - this method performs chunk upload signature providing a // io.Reader interface.
[ "Read", "-", "this", "method", "performs", "chunk", "upload", "signature", "providing", "a", "io", ".", "Reader", "interface", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/request-signature-streaming.go#L244-L301
26,694
minio/minio-go
api-notification.go
GetBucketNotification
func (c Client) GetBucketNotification(bucketName string) (bucketNotification BucketNotification, err error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return BucketNotification{}, err } notification, err := c.getBucketNotification(bucketName) if err != nil { return ...
go
func (c Client) GetBucketNotification(bucketName string) (bucketNotification BucketNotification, err error) { // Input validation. if err := s3utils.CheckValidBucketName(bucketName); err != nil { return BucketNotification{}, err } notification, err := c.getBucketNotification(bucketName) if err != nil { return ...
[ "func", "(", "c", "Client", ")", "GetBucketNotification", "(", "bucketName", "string", ")", "(", "bucketNotification", "BucketNotification", ",", "err", "error", ")", "{", "// Input validation.", "if", "err", ":=", "s3utils", ".", "CheckValidBucketName", "(", "buc...
// GetBucketNotification - get bucket notification at a given path.
[ "GetBucketNotification", "-", "get", "bucket", "notification", "at", "a", "given", "path", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-notification.go#L33-L43
26,695
minio/minio-go
api-notification.go
getBucketNotification
func (c Client) getBucketNotification(bucketName string) (BucketNotification, error) { urlValues := make(url.Values) urlValues.Set("notification", "") // Execute GET on bucket to list objects. resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{ bucketName: bucketName, queryValues: ...
go
func (c Client) getBucketNotification(bucketName string) (BucketNotification, error) { urlValues := make(url.Values) urlValues.Set("notification", "") // Execute GET on bucket to list objects. resp, err := c.executeMethod(context.Background(), "GET", requestMetadata{ bucketName: bucketName, queryValues: ...
[ "func", "(", "c", "Client", ")", "getBucketNotification", "(", "bucketName", "string", ")", "(", "BucketNotification", ",", "error", ")", "{", "urlValues", ":=", "make", "(", "url", ".", "Values", ")", "\n", "urlValues", ".", "Set", "(", "\"", "\"", ",",...
// Request server for notification rules.
[ "Request", "server", "for", "notification", "rules", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-notification.go#L46-L63
26,696
minio/minio-go
api-notification.go
processBucketNotificationResponse
func processBucketNotificationResponse(bucketName string, resp *http.Response) (BucketNotification, error) { if resp.StatusCode != http.StatusOK { errResponse := httpRespToErrorResponse(resp, bucketName, "") return BucketNotification{}, errResponse } var bucketNotification BucketNotification err := xmlDecoder(r...
go
func processBucketNotificationResponse(bucketName string, resp *http.Response) (BucketNotification, error) { if resp.StatusCode != http.StatusOK { errResponse := httpRespToErrorResponse(resp, bucketName, "") return BucketNotification{}, errResponse } var bucketNotification BucketNotification err := xmlDecoder(r...
[ "func", "processBucketNotificationResponse", "(", "bucketName", "string", ",", "resp", "*", "http", ".", "Response", ")", "(", "BucketNotification", ",", "error", ")", "{", "if", "resp", ".", "StatusCode", "!=", "http", ".", "StatusOK", "{", "errResponse", ":=...
// processes the GetNotification http response from the server.
[ "processes", "the", "GetNotification", "http", "response", "from", "the", "server", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-notification.go#L66-L77
26,697
minio/minio-go
api-notification.go
ListenBucketNotification
func (c Client) ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan NotificationInfo { notificationInfoCh := make(chan NotificationInfo, 1) // Only success, start a routine to start reading line by line. go func(notificationInfoCh chan<- NotificationInfo) { d...
go
func (c Client) ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan NotificationInfo { notificationInfoCh := make(chan NotificationInfo, 1) // Only success, start a routine to start reading line by line. go func(notificationInfoCh chan<- NotificationInfo) { d...
[ "func", "(", "c", "Client", ")", "ListenBucketNotification", "(", "bucketName", ",", "prefix", ",", "suffix", "string", ",", "events", "[", "]", "string", ",", "doneCh", "<-", "chan", "struct", "{", "}", ")", "<-", "chan", "NotificationInfo", "{", "notific...
// ListenBucketNotification - listen on bucket notifications.
[ "ListenBucketNotification", "-", "listen", "on", "bucket", "notifications", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/api-notification.go#L138-L228
26,698
minio/minio-go
pkg/credentials/signature-type.go
String
func (s SignatureType) String() string { if s.IsV2() { return "S3v2" } else if s.IsV4() { return "S3v4" } else if s.IsStreamingV4() { return "S3v4Streaming" } return "Anonymous" }
go
func (s SignatureType) String() string { if s.IsV2() { return "S3v2" } else if s.IsV4() { return "S3v4" } else if s.IsStreamingV4() { return "S3v4Streaming" } return "Anonymous" }
[ "func", "(", "s", "SignatureType", ")", "String", "(", ")", "string", "{", "if", "s", ".", "IsV2", "(", ")", "{", "return", "\"", "\"", "\n", "}", "else", "if", "s", ".", "IsV4", "(", ")", "{", "return", "\"", "\"", "\n", "}", "else", "if", "...
// Stringer humanized version of signature type, // strings returned here are case insensitive.
[ "Stringer", "humanized", "version", "of", "signature", "type", "strings", "returned", "here", "are", "case", "insensitive", "." ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/credentials/signature-type.go#L57-L66
26,699
minio/minio-go
pkg/s3signer/utils.go
getHostAddr
func getHostAddr(req *http.Request) string { if req.Host != "" { return req.Host } return req.URL.Host }
go
func getHostAddr(req *http.Request) string { if req.Host != "" { return req.Host } return req.URL.Host }
[ "func", "getHostAddr", "(", "req", "*", "http", ".", "Request", ")", "string", "{", "if", "req", ".", "Host", "!=", "\"", "\"", "{", "return", "req", ".", "Host", "\n", "}", "\n", "return", "req", ".", "URL", ".", "Host", "\n", "}" ]
// getHostAddr returns host header if available, otherwise returns host from URL
[ "getHostAddr", "returns", "host", "header", "if", "available", "otherwise", "returns", "host", "from", "URL" ]
68eef499b4c530409962a5d1a12fa8c848587761
https://github.com/minio/minio-go/blob/68eef499b4c530409962a5d1a12fa8c848587761/pkg/s3signer/utils.go#L45-L50