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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
125,500 | minio/minio | cmd/gateway/oss/gateway-oss.go | ListObjects | func (l *ossObjects) ListObjects(ctx context.Context, bucket, prefix, marker, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, err error) {
return ossListObjects(ctx, l.Client, bucket, prefix, marker, delimiter, maxKeys)
} | go | func (l *ossObjects) ListObjects(ctx context.Context, bucket, prefix, marker, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, err error) {
return ossListObjects(ctx, l.Client, bucket, prefix, marker, delimiter, maxKeys)
} | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"ListObjects",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
",",
"marker",
",",
"delimiter",
"string",
",",
"maxKeys",
"int",
")",
"(",
"loi",
"minio",
".",
"ListObjectsInfo",
",",
"err",
... | // ListObjects lists all blobs in OSS bucket filtered by prefix. | [
"ListObjects",
"lists",
"all",
"blobs",
"in",
"OSS",
"bucket",
"filtered",
"by",
"prefix",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L504-L506 |
125,501 | minio/minio | cmd/gateway/oss/gateway-oss.go | ListObjectsV2 | func (l *ossObjects) ListObjectsV2(ctx context.Context, bucket, prefix, continuationToken, delimiter string, maxKeys int,
fetchOwner bool, startAfter string) (loi minio.ListObjectsV2Info, err error) {
return ossListObjectsV2(ctx, l.Client, bucket, prefix, continuationToken, delimiter, maxKeys, fetchOwner, startAfter)... | go | func (l *ossObjects) ListObjectsV2(ctx context.Context, bucket, prefix, continuationToken, delimiter string, maxKeys int,
fetchOwner bool, startAfter string) (loi minio.ListObjectsV2Info, err error) {
return ossListObjectsV2(ctx, l.Client, bucket, prefix, continuationToken, delimiter, maxKeys, fetchOwner, startAfter)... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"ListObjectsV2",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
",",
"continuationToken",
",",
"delimiter",
"string",
",",
"maxKeys",
"int",
",",
"fetchOwner",
"bool",
",",
"startAfter",
"string... | // ListObjectsV2 lists all blobs in OSS bucket filtered by prefix | [
"ListObjectsV2",
"lists",
"all",
"blobs",
"in",
"OSS",
"bucket",
"filtered",
"by",
"prefix"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L509-L512 |
125,502 | minio/minio | cmd/gateway/oss/gateway-oss.go | ossGetObject | func ossGetObject(ctx context.Context, client *oss.Client, bucket, key string, startOffset, length int64, writer io.Writer, etag string) error {
if length < 0 && length != -1 {
logger.LogIf(ctx, fmt.Errorf("Invalid argument"))
return ossToObjectError(fmt.Errorf("Invalid argument"), bucket, key)
}
bkt, err := cl... | go | func ossGetObject(ctx context.Context, client *oss.Client, bucket, key string, startOffset, length int64, writer io.Writer, etag string) error {
if length < 0 && length != -1 {
logger.LogIf(ctx, fmt.Errorf("Invalid argument"))
return ossToObjectError(fmt.Errorf("Invalid argument"), bucket, key)
}
bkt, err := cl... | [
"func",
"ossGetObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"*",
"oss",
".",
"Client",
",",
"bucket",
",",
"key",
"string",
",",
"startOffset",
",",
"length",
"int64",
",",
"writer",
"io",
".",
"Writer",
",",
"etag",
"string",
")",
"e... | // ossGetObject reads an object on OSS. Supports additional
// parameters like offset and length which are synonymous with
// HTTP Range requests.
//
// startOffset indicates the starting read location of the object.
// length indicates the total length of the object. | [
"ossGetObject",
"reads",
"an",
"object",
"on",
"OSS",
".",
"Supports",
"additional",
"parameters",
"like",
"offset",
"and",
"length",
"which",
"are",
"synonymous",
"with",
"HTTP",
"Range",
"requests",
".",
"startOffset",
"indicates",
"the",
"starting",
"read",
"... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L520-L549 |
125,503 | minio/minio | cmd/gateway/oss/gateway-oss.go | GetObject | func (l *ossObjects) GetObject(ctx context.Context, bucket, key string, startOffset, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
return ossGetObject(ctx, l.Client, bucket, key, startOffset, length, writer, etag)
} | go | func (l *ossObjects) GetObject(ctx context.Context, bucket, key string, startOffset, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
return ossGetObject(ctx, l.Client, bucket, key, startOffset, length, writer, etag)
} | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"GetObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"key",
"string",
",",
"startOffset",
",",
"length",
"int64",
",",
"writer",
"io",
".",
"Writer",
",",
"etag",
"string",
",",
"opts",
"mini... | // GetObject reads an object on OSS. Supports additional
// parameters like offset and length which are synonymous with
// HTTP Range requests.
//
// startOffset indicates the starting read location of the object.
// length indicates the total length of the object. | [
"GetObject",
"reads",
"an",
"object",
"on",
"OSS",
".",
"Supports",
"additional",
"parameters",
"like",
"offset",
"and",
"length",
"which",
"are",
"synonymous",
"with",
"HTTP",
"Range",
"requests",
".",
"startOffset",
"indicates",
"the",
"starting",
"read",
"loc... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L582-L584 |
125,504 | minio/minio | cmd/gateway/oss/gateway-oss.go | ossGetObjectInfo | func ossGetObjectInfo(ctx context.Context, client *oss.Client, bucket, object string) (objInfo minio.ObjectInfo, err error) {
bkt, err := client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return objInfo, ossToObjectError(err, bucket, object)
}
header, err := bkt.GetObjectDetailedMeta(object)
if err... | go | func ossGetObjectInfo(ctx context.Context, client *oss.Client, bucket, object string) (objInfo minio.ObjectInfo, err error) {
bkt, err := client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return objInfo, ossToObjectError(err, bucket, object)
}
header, err := bkt.GetObjectDetailedMeta(object)
if err... | [
"func",
"ossGetObjectInfo",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"*",
"oss",
".",
"Client",
",",
"bucket",
",",
"object",
"string",
")",
"(",
"objInfo",
"minio",
".",
"ObjectInfo",
",",
"err",
"error",
")",
"{",
"bkt",
",",
"err",
":="... | // ossGetObjectInfo reads object info and replies back ObjectInfo. | [
"ossGetObjectInfo",
"reads",
"object",
"info",
"and",
"replies",
"back",
"ObjectInfo",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L600-L629 |
125,505 | minio/minio | cmd/gateway/oss/gateway-oss.go | ossPutObject | func ossPutObject(ctx context.Context, client *oss.Client, bucket, object string, data *hash.Reader, metadata map[string]string) (objInfo minio.ObjectInfo, err error) {
bkt, err := client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return objInfo, ossToObjectError(err, bucket, object)
}
// Build OSS ... | go | func ossPutObject(ctx context.Context, client *oss.Client, bucket, object string, data *hash.Reader, metadata map[string]string) (objInfo minio.ObjectInfo, err error) {
bkt, err := client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return objInfo, ossToObjectError(err, bucket, object)
}
// Build OSS ... | [
"func",
"ossPutObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"*",
"oss",
".",
"Client",
",",
"bucket",
",",
"object",
"string",
",",
"data",
"*",
"hash",
".",
"Reader",
",",
"metadata",
"map",
"[",
"string",
"]",
"string",
")",
"(",
... | // ossPutObject creates a new object with the incoming data. | [
"ossPutObject",
"creates",
"a",
"new",
"object",
"with",
"the",
"incoming",
"data",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L637-L657 |
125,506 | minio/minio | cmd/gateway/oss/gateway-oss.go | PutObject | func (l *ossObjects) PutObject(ctx context.Context, bucket, object string, r *minio.PutObjReader, opts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
data := r.Reader
return ossPutObject(ctx, l.Client, bucket, object, data, opts.UserDefined)
} | go | func (l *ossObjects) PutObject(ctx context.Context, bucket, object string, r *minio.PutObjReader, opts minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
data := r.Reader
return ossPutObject(ctx, l.Client, bucket, object, data, opts.UserDefined)
} | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"PutObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"r",
"*",
"minio",
".",
"PutObjReader",
",",
"opts",
"minio",
".",
"ObjectOptions",
")",
"(",
"objInfo",
"minio",
... | // PutObject creates a new object with the incoming data. | [
"PutObject",
"creates",
"a",
"new",
"object",
"with",
"the",
"incoming",
"data",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L660-L664 |
125,507 | minio/minio | cmd/gateway/oss/gateway-oss.go | DeleteObject | func (l *ossObjects) DeleteObject(ctx context.Context, bucket, object string) error {
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err, bucket, object)
}
err = bkt.DeleteObject(object)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err,... | go | func (l *ossObjects) DeleteObject(ctx context.Context, bucket, object string) error {
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err, bucket, object)
}
err = bkt.DeleteObject(object)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err,... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"DeleteObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
")",
"error",
"{",
"bkt",
",",
"err",
":=",
"l",
".",
"Client",
".",
"Bucket",
"(",
"bucket",
")",
"\n",
"if",
... | // DeleteObject deletes a blob in bucket. | [
"DeleteObject",
"deletes",
"a",
"blob",
"in",
"bucket",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L698-L711 |
125,508 | minio/minio | cmd/gateway/oss/gateway-oss.go | fromOSSClientListMultipartsInfo | func fromOSSClientListMultipartsInfo(lmur oss.ListMultipartUploadResult) minio.ListMultipartsInfo {
uploads := make([]minio.MultipartInfo, len(lmur.Uploads))
for i, um := range lmur.Uploads {
uploads[i] = minio.MultipartInfo{
Object: um.Key,
UploadID: um.UploadID,
Initiated: um.Initiated,
}
}
comm... | go | func fromOSSClientListMultipartsInfo(lmur oss.ListMultipartUploadResult) minio.ListMultipartsInfo {
uploads := make([]minio.MultipartInfo, len(lmur.Uploads))
for i, um := range lmur.Uploads {
uploads[i] = minio.MultipartInfo{
Object: um.Key,
UploadID: um.UploadID,
Initiated: um.Initiated,
}
}
comm... | [
"func",
"fromOSSClientListMultipartsInfo",
"(",
"lmur",
"oss",
".",
"ListMultipartUploadResult",
")",
"minio",
".",
"ListMultipartsInfo",
"{",
"uploads",
":=",
"make",
"(",
"[",
"]",
"minio",
".",
"MultipartInfo",
",",
"len",
"(",
"lmur",
".",
"Uploads",
")",
... | // fromOSSClientListMultipartsInfo converts oss ListMultipartUploadResult to ListMultipartsInfo | [
"fromOSSClientListMultipartsInfo",
"converts",
"oss",
"ListMultipartUploadResult",
"to",
"ListMultipartsInfo"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L714-L739 |
125,509 | minio/minio | cmd/gateway/oss/gateway-oss.go | NewMultipartUpload | func (l *ossObjects) NewMultipartUpload(ctx context.Context, bucket, object string, o minio.ObjectOptions) (uploadID string, err error) {
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return uploadID, ossToObjectError(err, bucket, object)
}
// Build OSS metadata
opts, err := appen... | go | func (l *ossObjects) NewMultipartUpload(ctx context.Context, bucket, object string, o minio.ObjectOptions) (uploadID string, err error) {
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return uploadID, ossToObjectError(err, bucket, object)
}
// Build OSS metadata
opts, err := appen... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"NewMultipartUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
"string",
",",
"o",
"minio",
".",
"ObjectOptions",
")",
"(",
"uploadID",
"string",
",",
"err",
"error",
")",
"{",
"bkt",
... | // NewMultipartUpload upload object in multiple parts. | [
"NewMultipartUpload",
"upload",
"object",
"in",
"multiple",
"parts",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L760-L780 |
125,510 | minio/minio | cmd/gateway/oss/gateway-oss.go | PutObjectPart | func (l *ossObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID string, partID int, r *minio.PutObjReader, opts minio.ObjectOptions) (pi minio.PartInfo, err error) {
data := r.Reader
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return pi, ossToObjectError(err, bucke... | go | func (l *ossObjects) PutObjectPart(ctx context.Context, bucket, object, uploadID string, partID int, r *minio.PutObjReader, opts minio.ObjectOptions) (pi minio.PartInfo, err error) {
data := r.Reader
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return pi, ossToObjectError(err, bucke... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"PutObjectPart",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
",",
"uploadID",
"string",
",",
"partID",
"int",
",",
"r",
"*",
"minio",
".",
"PutObjReader",
",",
"opts",
"minio",
".",
"Ob... | // PutObjectPart puts a part of object in bucket. | [
"PutObjectPart",
"puts",
"a",
"part",
"of",
"object",
"in",
"bucket",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L783-L809 |
125,511 | minio/minio | cmd/gateway/oss/gateway-oss.go | fromOSSClientListPartsInfo | func fromOSSClientListPartsInfo(lupr oss.ListUploadedPartsResult, partNumberMarker int) minio.ListPartsInfo {
parts := make([]minio.PartInfo, len(lupr.UploadedParts))
for i, up := range lupr.UploadedParts {
parts[i] = minio.PartInfo{
PartNumber: up.PartNumber,
LastModified: up.LastModified,
ETag: ... | go | func fromOSSClientListPartsInfo(lupr oss.ListUploadedPartsResult, partNumberMarker int) minio.ListPartsInfo {
parts := make([]minio.PartInfo, len(lupr.UploadedParts))
for i, up := range lupr.UploadedParts {
parts[i] = minio.PartInfo{
PartNumber: up.PartNumber,
LastModified: up.LastModified,
ETag: ... | [
"func",
"fromOSSClientListPartsInfo",
"(",
"lupr",
"oss",
".",
"ListUploadedPartsResult",
",",
"partNumberMarker",
"int",
")",
"minio",
".",
"ListPartsInfo",
"{",
"parts",
":=",
"make",
"(",
"[",
"]",
"minio",
".",
"PartInfo",
",",
"len",
"(",
"lupr",
".",
"... | // fromOSSClientListPartsInfo converts OSS ListUploadedPartsResult to ListPartsInfo | [
"fromOSSClientListPartsInfo",
"converts",
"OSS",
"ListUploadedPartsResult",
"to",
"ListPartsInfo"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L820-L842 |
125,512 | minio/minio | cmd/gateway/oss/gateway-oss.go | AbortMultipartUpload | func (l *ossObjects) AbortMultipartUpload(ctx context.Context, bucket, object, uploadID string) error {
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err, bucket, object)
}
err = bkt.AbortMultipartUpload(oss.InitiateMultipartUploadResult{
Bucket: bucket,... | go | func (l *ossObjects) AbortMultipartUpload(ctx context.Context, bucket, object, uploadID string) error {
bkt, err := l.Client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err, bucket, object)
}
err = bkt.AbortMultipartUpload(oss.InitiateMultipartUploadResult{
Bucket: bucket,... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"AbortMultipartUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
",",
"uploadID",
"string",
")",
"error",
"{",
"bkt",
",",
"err",
":=",
"l",
".",
"Client",
".",
"Bucket",
"(",
"bucke... | // AbortMultipartUpload aborts a ongoing multipart upload. | [
"AbortMultipartUpload",
"aborts",
"a",
"ongoing",
"multipart",
"upload",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L905-L922 |
125,513 | minio/minio | cmd/gateway/oss/gateway-oss.go | CompleteMultipartUpload | func (l *ossObjects) CompleteMultipartUpload(ctx context.Context, bucket, object, uploadID string, uploadedParts []minio.CompletePart, opts minio.ObjectOptions) (oi minio.ObjectInfo, err error) {
client := l.Client
bkt, err := client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return oi, ossToObjectErr... | go | func (l *ossObjects) CompleteMultipartUpload(ctx context.Context, bucket, object, uploadID string, uploadedParts []minio.CompletePart, opts minio.ObjectOptions) (oi minio.ObjectInfo, err error) {
client := l.Client
bkt, err := client.Bucket(bucket)
if err != nil {
logger.LogIf(ctx, err)
return oi, ossToObjectErr... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"CompleteMultipartUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"object",
",",
"uploadID",
"string",
",",
"uploadedParts",
"[",
"]",
"minio",
".",
"CompletePart",
",",
"opts",
"minio",
".",
"O... | // CompleteMultipartUpload completes ongoing multipart upload and finalizes object. | [
"CompleteMultipartUpload",
"completes",
"ongoing",
"multipart",
"upload",
"and",
"finalizes",
"object",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L925-L991 |
125,514 | minio/minio | cmd/gateway/oss/gateway-oss.go | GetBucketPolicy | func (l *ossObjects) GetBucketPolicy(ctx context.Context, bucket string) (*policy.Policy, error) {
result, err := l.Client.GetBucketACL(bucket)
if err != nil {
logger.LogIf(ctx, err)
return nil, ossToObjectError(err)
}
var readOnly, readWrite bool
switch result.ACL {
case string(oss.ACLPrivate):
// By defa... | go | func (l *ossObjects) GetBucketPolicy(ctx context.Context, bucket string) (*policy.Policy, error) {
result, err := l.Client.GetBucketACL(bucket)
if err != nil {
logger.LogIf(ctx, err)
return nil, ossToObjectError(err)
}
var readOnly, readWrite bool
switch result.ACL {
case string(oss.ACLPrivate):
// By defa... | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"GetBucketPolicy",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
")",
"(",
"*",
"policy",
".",
"Policy",
",",
"error",
")",
"{",
"result",
",",
"err",
":=",
"l",
".",
"Client",
".",
"GetBuck... | // GetBucketPolicy will get policy on bucket. | [
"GetBucketPolicy",
"will",
"get",
"policy",
"on",
"bucket",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L1042-L1095 |
125,515 | minio/minio | cmd/gateway/oss/gateway-oss.go | DeleteBucketPolicy | func (l *ossObjects) DeleteBucketPolicy(ctx context.Context, bucket string) error {
err := l.Client.SetBucketACL(bucket, oss.ACLPrivate)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err, bucket)
}
return nil
} | go | func (l *ossObjects) DeleteBucketPolicy(ctx context.Context, bucket string) error {
err := l.Client.SetBucketACL(bucket, oss.ACLPrivate)
if err != nil {
logger.LogIf(ctx, err)
return ossToObjectError(err, bucket)
}
return nil
} | [
"func",
"(",
"l",
"*",
"ossObjects",
")",
"DeleteBucketPolicy",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
")",
"error",
"{",
"err",
":=",
"l",
".",
"Client",
".",
"SetBucketACL",
"(",
"bucket",
",",
"oss",
".",
"ACLPrivate",
")",
... | // DeleteBucketPolicy deletes all policies on bucket. | [
"DeleteBucketPolicy",
"deletes",
"all",
"policies",
"on",
"bucket",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/oss/gateway-oss.go#L1098-L1105 |
125,516 | minio/minio | pkg/policy/condition/name.go | IsValid | func (n name) IsValid() bool {
for _, supn := range supportedConditions {
if n == supn {
return true
}
}
return false
} | go | func (n name) IsValid() bool {
for _, supn := range supportedConditions {
if n == supn {
return true
}
}
return false
} | [
"func",
"(",
"n",
"name",
")",
"IsValid",
"(",
")",
"bool",
"{",
"for",
"_",
",",
"supn",
":=",
"range",
"supportedConditions",
"{",
"if",
"n",
"==",
"supn",
"{",
"return",
"true",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"false",
"\n",
"}"
] | // IsValid - checks if name is valid or not. | [
"IsValid",
"-",
"checks",
"if",
"name",
"is",
"valid",
"or",
"not",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/name.go#L56-L64 |
125,517 | minio/minio | pkg/policy/condition/name.go | MarshalJSON | func (n name) MarshalJSON() ([]byte, error) {
if !n.IsValid() {
return nil, fmt.Errorf("invalid name %v", n)
}
return json.Marshal(string(n))
} | go | func (n name) MarshalJSON() ([]byte, error) {
if !n.IsValid() {
return nil, fmt.Errorf("invalid name %v", n)
}
return json.Marshal(string(n))
} | [
"func",
"(",
"n",
"name",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"!",
"n",
".",
"IsValid",
"(",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"n",
")",
"\n",
"}",
"\n... | // MarshalJSON - encodes name to JSON data. | [
"MarshalJSON",
"-",
"encodes",
"name",
"to",
"JSON",
"data",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/name.go#L67-L73 |
125,518 | minio/minio | pkg/policy/condition/name.go | UnmarshalJSON | func (n *name) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err != nil {
return err
}
parsedName, err := parseName(s)
if err != nil {
return err
}
*n = parsedName
return nil
} | go | func (n *name) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err != nil {
return err
}
parsedName, err := parseName(s)
if err != nil {
return err
}
*n = parsedName
return nil
} | [
"func",
"(",
"n",
"*",
"name",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"var",
"s",
"string",
"\n",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"&",
"s",
")",
";",
"err",
"!=",
"nil",
"{",
"retu... | // UnmarshalJSON - decodes JSON data to condition name. | [
"UnmarshalJSON",
"-",
"decodes",
"JSON",
"data",
"to",
"condition",
"name",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/name.go#L76-L89 |
125,519 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | isGWObject | func isGWObject(objName string) bool {
isEncrypted := strings.Contains(objName, defaultMinioGWPrefix)
if !isEncrypted {
return true
}
// ignore temp part.meta files
if strings.Contains(objName, gwpartMetaJSON) {
return false
}
pfxSlice := strings.Split(objName, slashSeparator)
var i1, i2 int
for i := len(... | go | func isGWObject(objName string) bool {
isEncrypted := strings.Contains(objName, defaultMinioGWPrefix)
if !isEncrypted {
return true
}
// ignore temp part.meta files
if strings.Contains(objName, gwpartMetaJSON) {
return false
}
pfxSlice := strings.Split(objName, slashSeparator)
var i1, i2 int
for i := len(... | [
"func",
"isGWObject",
"(",
"objName",
"string",
")",
"bool",
"{",
"isEncrypted",
":=",
"strings",
".",
"Contains",
"(",
"objName",
",",
"defaultMinioGWPrefix",
")",
"\n",
"if",
"!",
"isEncrypted",
"{",
"return",
"true",
"\n",
"}",
"\n",
"// ignore temp part.me... | // isGWObject returns true if it is a custom object | [
"isGWObject",
"returns",
"true",
"if",
"it",
"is",
"a",
"custom",
"object"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L158-L184 |
125,520 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | isPrefix | func (l *s3EncObjects) isPrefix(ctx context.Context, bucket, prefix string, fetchOwner bool, startAfter string) bool {
var continuationToken, delimiter string
for {
loi, e := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, fetchOwner, startAfter)
if e != nil {
return false
... | go | func (l *s3EncObjects) isPrefix(ctx context.Context, bucket, prefix string, fetchOwner bool, startAfter string) bool {
var continuationToken, delimiter string
for {
loi, e := l.s3Objects.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, 1000, fetchOwner, startAfter)
if e != nil {
return false
... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"isPrefix",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
"string",
",",
"fetchOwner",
"bool",
",",
"startAfter",
"string",
")",
"bool",
"{",
"var",
"continuationToken",
",",
"delimiter",
"... | // isPrefix returns true if prefix exists and is not an incomplete multipart upload entry | [
"isPrefix",
"returns",
"true",
"if",
"prefix",
"exists",
"and",
"is",
"not",
"an",
"incomplete",
"multipart",
"upload",
"entry"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L187-L207 |
125,521 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | GetObject | func (l *s3EncObjects) GetObject(ctx context.Context, bucket string, key string, startOffset int64, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
return l.getObject(ctx, bucket, key, startOffset, length, writer, etag, opts)
} | go | func (l *s3EncObjects) GetObject(ctx context.Context, bucket string, key string, startOffset int64, length int64, writer io.Writer, etag string, opts minio.ObjectOptions) error {
return l.getObject(ctx, bucket, key, startOffset, length, writer, etag, opts)
} | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"GetObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
",",
"key",
"string",
",",
"startOffset",
"int64",
",",
"length",
"int64",
",",
"writer",
"io",
".",
"Writer",
",",
"etag",
"string",... | // GetObject reads an object from S3. Supports additional
// parameters like offset and length which are synonymous with
// HTTP Range requests. | [
"GetObject",
"reads",
"an",
"object",
"from",
"S3",
".",
"Supports",
"additional",
"parameters",
"like",
"offset",
"and",
"length",
"which",
"are",
"synonymous",
"with",
"HTTP",
"Range",
"requests",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L212-L214 |
125,522 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | getGWMetadata | func (l *s3EncObjects) getGWMetadata(ctx context.Context, bucket, metaFileName string) (m gwMetaV1, err error) {
oi, err1 := l.s3Objects.GetObjectInfo(ctx, bucket, metaFileName, minio.ObjectOptions{})
if err1 != nil {
return m, err1
}
var buffer bytes.Buffer
err = l.s3Objects.GetObject(ctx, bucket, metaFileName,... | go | func (l *s3EncObjects) getGWMetadata(ctx context.Context, bucket, metaFileName string) (m gwMetaV1, err error) {
oi, err1 := l.s3Objects.GetObjectInfo(ctx, bucket, metaFileName, minio.ObjectOptions{})
if err1 != nil {
return m, err1
}
var buffer bytes.Buffer
err = l.s3Objects.GetObject(ctx, bucket, metaFileName,... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"getGWMetadata",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"metaFileName",
"string",
")",
"(",
"m",
"gwMetaV1",
",",
"err",
"error",
")",
"{",
"oi",
",",
"err1",
":=",
"l",
".",
"s3Objects",
... | // getDaremetadata fetches dare.meta from s3 backend and marshals into a structured format. | [
"getDaremetadata",
"fetches",
"dare",
".",
"meta",
"from",
"s3",
"backend",
"and",
"marshals",
"into",
"a",
"structured",
"format",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L222-L233 |
125,523 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | writeGWMetadata | func (l *s3EncObjects) writeGWMetadata(ctx context.Context, bucket, metaFileName string, m gwMetaV1, o minio.ObjectOptions) error {
reader, err := getGWMetadata(ctx, bucket, metaFileName, m)
if err != nil {
logger.LogIf(ctx, err)
return err
}
_, err = l.s3Objects.PutObject(ctx, bucket, metaFileName, reader, o)
... | go | func (l *s3EncObjects) writeGWMetadata(ctx context.Context, bucket, metaFileName string, m gwMetaV1, o minio.ObjectOptions) error {
reader, err := getGWMetadata(ctx, bucket, metaFileName, m)
if err != nil {
logger.LogIf(ctx, err)
return err
}
_, err = l.s3Objects.PutObject(ctx, bucket, metaFileName, reader, o)
... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"writeGWMetadata",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"metaFileName",
"string",
",",
"m",
"gwMetaV1",
",",
"o",
"minio",
".",
"ObjectOptions",
")",
"error",
"{",
"reader",
",",
"err",
":... | // writes dare metadata to the s3 backend | [
"writes",
"dare",
"metadata",
"to",
"the",
"s3",
"backend"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L236-L244 |
125,524 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | getTmpDareMetaPath | func getTmpDareMetaPath(object, uploadID string) string {
return path.Join(getGWMetaPath(object), uploadID, gwdareMetaJSON)
} | go | func getTmpDareMetaPath(object, uploadID string) string {
return path.Join(getGWMetaPath(object), uploadID, gwdareMetaJSON)
} | [
"func",
"getTmpDareMetaPath",
"(",
"object",
",",
"uploadID",
"string",
")",
"string",
"{",
"return",
"path",
".",
"Join",
"(",
"getGWMetaPath",
"(",
"object",
")",
",",
"uploadID",
",",
"gwdareMetaJSON",
")",
"\n",
"}"
] | // returns path of temporary metadata json file for the upload | [
"returns",
"path",
"of",
"temporary",
"metadata",
"json",
"file",
"for",
"the",
"upload"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L247-L249 |
125,525 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | getPartMetaPath | func getPartMetaPath(object, uploadID string, partID int) string {
return path.Join(object, defaultMinioGWPrefix, uploadID, strconv.Itoa(partID), gwpartMetaJSON)
} | go | func getPartMetaPath(object, uploadID string, partID int) string {
return path.Join(object, defaultMinioGWPrefix, uploadID, strconv.Itoa(partID), gwpartMetaJSON)
} | [
"func",
"getPartMetaPath",
"(",
"object",
",",
"uploadID",
"string",
",",
"partID",
"int",
")",
"string",
"{",
"return",
"path",
".",
"Join",
"(",
"object",
",",
"defaultMinioGWPrefix",
",",
"uploadID",
",",
"strconv",
".",
"Itoa",
"(",
"partID",
")",
",",... | // returns path of temporary part metadata file for multipart uploads | [
"returns",
"path",
"of",
"temporary",
"part",
"metadata",
"file",
"for",
"multipart",
"uploads"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L257-L259 |
125,526 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | deleteGWMetadata | func (l *s3EncObjects) deleteGWMetadata(ctx context.Context, bucket, metaFileName string) error {
return l.s3Objects.DeleteObject(ctx, bucket, metaFileName)
} | go | func (l *s3EncObjects) deleteGWMetadata(ctx context.Context, bucket, metaFileName string) error {
return l.s3Objects.DeleteObject(ctx, bucket, metaFileName)
} | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"deleteGWMetadata",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"metaFileName",
"string",
")",
"error",
"{",
"return",
"l",
".",
"s3Objects",
".",
"DeleteObject",
"(",
"ctx",
",",
"bucket",
",",
... | // deletes the custom dare metadata file saved at the backend | [
"deletes",
"the",
"custom",
"dare",
"metadata",
"file",
"saved",
"at",
"the",
"backend"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L262-L264 |
125,527 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | GetObjectInfo | func (l *s3EncObjects) GetObjectInfo(ctx context.Context, bucket string, object string, o minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
var opts minio.ObjectOptions
if minio.GlobalGatewaySSE.SSEC() {
opts = o
}
gwMeta, err := l.getGWMetadata(ctx, bucket, getDareMetaPath(object))
if err != nil {
... | go | func (l *s3EncObjects) GetObjectInfo(ctx context.Context, bucket string, object string, o minio.ObjectOptions) (objInfo minio.ObjectInfo, err error) {
var opts minio.ObjectOptions
if minio.GlobalGatewaySSE.SSEC() {
opts = o
}
gwMeta, err := l.getGWMetadata(ctx, bucket, getDareMetaPath(object))
if err != nil {
... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"GetObjectInfo",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
",",
"object",
"string",
",",
"o",
"minio",
".",
"ObjectOptions",
")",
"(",
"objInfo",
"minio",
".",
"ObjectInfo",
",",
"err",
"e... | // GetObjectInfo reads object info and replies back ObjectInfo
// For custom gateway encrypted large objects, the ObjectInfo is retrieved from the dare.meta file. | [
"GetObjectInfo",
"reads",
"object",
"info",
"and",
"replies",
"back",
"ObjectInfo",
"For",
"custom",
"gateway",
"encrypted",
"large",
"objects",
"the",
"ObjectInfo",
"is",
"retrieved",
"from",
"the",
"dare",
".",
"meta",
"file",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L340-L351 |
125,528 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | DeleteObject | func (l *s3EncObjects) DeleteObject(ctx context.Context, bucket string, object string) error {
// Get dare meta json
if _, err := l.getGWMetadata(ctx, bucket, getDareMetaPath(object)); err != nil {
return l.s3Objects.DeleteObject(ctx, bucket, object)
}
// delete encrypted object
l.s3Objects.DeleteObject(ctx, bu... | go | func (l *s3EncObjects) DeleteObject(ctx context.Context, bucket string, object string) error {
// Get dare meta json
if _, err := l.getGWMetadata(ctx, bucket, getDareMetaPath(object)); err != nil {
return l.s3Objects.DeleteObject(ctx, bucket, object)
}
// delete encrypted object
l.s3Objects.DeleteObject(ctx, bu... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"DeleteObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
",",
"object",
"string",
")",
"error",
"{",
"// Get dare meta json",
"if",
"_",
",",
"err",
":=",
"l",
".",
"getGWMetadata",
"(",
... | // DeleteObject deletes a blob in bucket
// For custom gateway encrypted large objects, cleans up encrypted content and metadata files
// from the backend. | [
"DeleteObject",
"deletes",
"a",
"blob",
"in",
"bucket",
"For",
"custom",
"gateway",
"encrypted",
"large",
"objects",
"cleans",
"up",
"encrypted",
"content",
"and",
"metadata",
"files",
"from",
"the",
"backend",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L386-L395 |
125,529 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | NewMultipartUpload | func (l *s3EncObjects) NewMultipartUpload(ctx context.Context, bucket string, object string, o minio.ObjectOptions) (uploadID string, err error) {
var sseOpts encrypt.ServerSide
if o.ServerSideEncryption == nil {
return l.s3Objects.NewMultipartUpload(ctx, bucket, object, minio.ObjectOptions{UserDefined: o.UserDefin... | go | func (l *s3EncObjects) NewMultipartUpload(ctx context.Context, bucket string, object string, o minio.ObjectOptions) (uploadID string, err error) {
var sseOpts encrypt.ServerSide
if o.ServerSideEncryption == nil {
return l.s3Objects.NewMultipartUpload(ctx, bucket, object, minio.ObjectOptions{UserDefined: o.UserDefin... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"NewMultipartUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
"string",
",",
"object",
"string",
",",
"o",
"minio",
".",
"ObjectOptions",
")",
"(",
"uploadID",
"string",
",",
"err",
"error",
")",
... | // NewMultipartUpload uploads object in multiple parts | [
"NewMultipartUpload",
"uploads",
"object",
"in",
"multiple",
"parts"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L413-L437 |
125,530 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | getTmpGWMetaPath | func getTmpGWMetaPath(object, uploadID string) string {
return path.Join(object, defaultMinioGWPrefix, uploadID)
} | go | func getTmpGWMetaPath(object, uploadID string) string {
return path.Join(object, defaultMinioGWPrefix, uploadID)
} | [
"func",
"getTmpGWMetaPath",
"(",
"object",
",",
"uploadID",
"string",
")",
"string",
"{",
"return",
"path",
".",
"Join",
"(",
"object",
",",
"defaultMinioGWPrefix",
",",
"uploadID",
")",
"\n",
"}"
] | // getTmpGWMetaPath returns the prefix under which uploads in progress are stored on backend | [
"getTmpGWMetaPath",
"returns",
"the",
"prefix",
"under",
"which",
"uploads",
"in",
"progress",
"are",
"stored",
"on",
"backend"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L668-L670 |
125,531 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | cleanupStaleEncMultipartUploads | func (l *s3EncObjects) cleanupStaleEncMultipartUploads(ctx context.Context, cleanupInterval, expiry time.Duration, doneCh chan struct{}) {
ticker := time.NewTicker(cleanupInterval)
defer ticker.Stop()
for {
select {
case <-doneCh:
return
case <-ticker.C:
l.cleanupStaleEncMultipartUploadsOnGW(ctx, expiry... | go | func (l *s3EncObjects) cleanupStaleEncMultipartUploads(ctx context.Context, cleanupInterval, expiry time.Duration, doneCh chan struct{}) {
ticker := time.NewTicker(cleanupInterval)
defer ticker.Stop()
for {
select {
case <-doneCh:
return
case <-ticker.C:
l.cleanupStaleEncMultipartUploadsOnGW(ctx, expiry... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"cleanupStaleEncMultipartUploads",
"(",
"ctx",
"context",
".",
"Context",
",",
"cleanupInterval",
",",
"expiry",
"time",
".",
"Duration",
",",
"doneCh",
"chan",
"struct",
"{",
"}",
")",
"{",
"ticker",
":=",
"time",... | // Clean-up the stale incomplete encrypted multipart uploads. Should be run in a Go routine. | [
"Clean",
"-",
"up",
"the",
"stale",
"incomplete",
"encrypted",
"multipart",
"uploads",
".",
"Should",
"be",
"run",
"in",
"a",
"Go",
"routine",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L683-L695 |
125,532 | minio/minio | cmd/gateway/s3/gateway-s3-sse.go | cleanupStaleEncMultipartUploadsOnGW | func (l *s3EncObjects) cleanupStaleEncMultipartUploadsOnGW(ctx context.Context, expiry time.Duration) {
for {
buckets, err := l.s3Objects.ListBuckets(ctx)
if err != nil {
break
}
for _, b := range buckets {
expParts := l.getStalePartsForBucket(ctx, b.Name, expiry)
for k := range expParts {
l.s3Obj... | go | func (l *s3EncObjects) cleanupStaleEncMultipartUploadsOnGW(ctx context.Context, expiry time.Duration) {
for {
buckets, err := l.s3Objects.ListBuckets(ctx)
if err != nil {
break
}
for _, b := range buckets {
expParts := l.getStalePartsForBucket(ctx, b.Name, expiry)
for k := range expParts {
l.s3Obj... | [
"func",
"(",
"l",
"*",
"s3EncObjects",
")",
"cleanupStaleEncMultipartUploadsOnGW",
"(",
"ctx",
"context",
".",
"Context",
",",
"expiry",
"time",
".",
"Duration",
")",
"{",
"for",
"{",
"buckets",
",",
"err",
":=",
"l",
".",
"s3Objects",
".",
"ListBuckets",
... | // cleanupStaleMultipartUploads removes old custom encryption multipart uploads on backend | [
"cleanupStaleMultipartUploads",
"removes",
"old",
"custom",
"encryption",
"multipart",
"uploads",
"on",
"backend"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3-sse.go#L698-L711 |
125,533 | minio/minio | cmd/lock-rest-client.go | isHostUp | func (client *lockRESTClient) isHostUp() bool {
client.lockSync.Lock()
defer client.lockSync.Unlock()
if client.connected {
return true
}
select {
case <-client.timer.C:
client.connected = true
client.timer = nil
return true
default:
}
return false
} | go | func (client *lockRESTClient) isHostUp() bool {
client.lockSync.Lock()
defer client.lockSync.Unlock()
if client.connected {
return true
}
select {
case <-client.timer.C:
client.connected = true
client.timer = nil
return true
default:
}
return false
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"isHostUp",
"(",
")",
"bool",
"{",
"client",
".",
"lockSync",
".",
"Lock",
"(",
")",
"\n",
"defer",
"client",
".",
"lockSync",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"client",
".",
"connected",
"{",
... | // check if the host is up or if it is fine
// to make a call to the lock rest server. | [
"check",
"if",
"the",
"host",
"is",
"up",
"or",
"if",
"it",
"is",
"fine",
"to",
"make",
"a",
"call",
"to",
"the",
"lock",
"rest",
"server",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L60-L75 |
125,534 | minio/minio | cmd/lock-rest-client.go | markHostDown | func (client *lockRESTClient) markHostDown() {
client.lockSync.Lock()
defer client.lockSync.Unlock()
if !client.connected {
return
}
client.connected = false
client.timer = time.NewTimer(defaultRetryUnit * 5)
} | go | func (client *lockRESTClient) markHostDown() {
client.lockSync.Lock()
defer client.lockSync.Unlock()
if !client.connected {
return
}
client.connected = false
client.timer = time.NewTimer(defaultRetryUnit * 5)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"markHostDown",
"(",
")",
"{",
"client",
".",
"lockSync",
".",
"Lock",
"(",
")",
"\n",
"defer",
"client",
".",
"lockSync",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"!",
"client",
".",
"connected",
"{",
... | // Mark the host as down if there is a Network error. | [
"Mark",
"the",
"host",
"as",
"down",
"if",
"there",
"is",
"a",
"Network",
"error",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L78-L87 |
125,535 | minio/minio | cmd/lock-rest-client.go | restCall | func (client *lockRESTClient) restCall(call string, args dsync.LockArgs) (reply bool, err error) {
reader := bytes.NewBuffer(make([]byte, 0, 2048))
err = gob.NewEncoder(reader).Encode(args)
if err != nil {
return false, err
}
respBody, err := client.call(call, nil, reader, -1)
if err != nil {
return false, e... | go | func (client *lockRESTClient) restCall(call string, args dsync.LockArgs) (reply bool, err error) {
reader := bytes.NewBuffer(make([]byte, 0, 2048))
err = gob.NewEncoder(reader).Encode(args)
if err != nil {
return false, err
}
respBody, err := client.call(call, nil, reader, -1)
if err != nil {
return false, e... | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"restCall",
"(",
"call",
"string",
",",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"reader",
":=",
"bytes",
".",
"NewBuffer",
"(",
"make",
"(",
"[",
"... | // restCall makes a call to the lock REST server. | [
"restCall",
"makes",
"a",
"call",
"to",
"the",
"lock",
"REST",
"server",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L133-L160 |
125,536 | minio/minio | cmd/lock-rest-client.go | RLock | func (client *lockRESTClient) RLock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodRLock, args)
} | go | func (client *lockRESTClient) RLock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodRLock, args)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"RLock",
"(",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"client",
".",
"restCall",
"(",
"lockRESTMethodRLock",
",",
"args",
")",
"\n",
"}"
] | // RLock calls read lock REST API. | [
"RLock",
"calls",
"read",
"lock",
"REST",
"API",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L163-L165 |
125,537 | minio/minio | cmd/lock-rest-client.go | Lock | func (client *lockRESTClient) Lock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodLock, args)
} | go | func (client *lockRESTClient) Lock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodLock, args)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"Lock",
"(",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"client",
".",
"restCall",
"(",
"lockRESTMethodLock",
",",
"args",
")",
"\n",
"}"
] | // Lock calls lock REST API. | [
"Lock",
"calls",
"lock",
"REST",
"API",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L168-L170 |
125,538 | minio/minio | cmd/lock-rest-client.go | RUnlock | func (client *lockRESTClient) RUnlock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodRUnlock, args)
} | go | func (client *lockRESTClient) RUnlock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodRUnlock, args)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"RUnlock",
"(",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"client",
".",
"restCall",
"(",
"lockRESTMethodRUnlock",
",",
"args",
")",
"\n",
"}"
... | // RUnlock calls read unlock REST API. | [
"RUnlock",
"calls",
"read",
"unlock",
"REST",
"API",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L173-L175 |
125,539 | minio/minio | cmd/lock-rest-client.go | Unlock | func (client *lockRESTClient) Unlock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodUnlock, args)
} | go | func (client *lockRESTClient) Unlock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodUnlock, args)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"Unlock",
"(",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"client",
".",
"restCall",
"(",
"lockRESTMethodUnlock",
",",
"args",
")",
"\n",
"}"
] | // Unlock calls write unlock RPC. | [
"Unlock",
"calls",
"write",
"unlock",
"RPC",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L178-L180 |
125,540 | minio/minio | cmd/lock-rest-client.go | ForceUnlock | func (client *lockRESTClient) ForceUnlock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodForceUnlock, args)
} | go | func (client *lockRESTClient) ForceUnlock(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodForceUnlock, args)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"ForceUnlock",
"(",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"client",
".",
"restCall",
"(",
"lockRESTMethodForceUnlock",
",",
"args",
")",
"\n"... | // ForceUnlock calls force unlock RPC. | [
"ForceUnlock",
"calls",
"force",
"unlock",
"RPC",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L183-L185 |
125,541 | minio/minio | cmd/lock-rest-client.go | Expired | func (client *lockRESTClient) Expired(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodExpired, args)
} | go | func (client *lockRESTClient) Expired(args dsync.LockArgs) (reply bool, err error) {
return client.restCall(lockRESTMethodExpired, args)
} | [
"func",
"(",
"client",
"*",
"lockRESTClient",
")",
"Expired",
"(",
"args",
"dsync",
".",
"LockArgs",
")",
"(",
"reply",
"bool",
",",
"err",
"error",
")",
"{",
"return",
"client",
".",
"restCall",
"(",
"lockRESTMethodExpired",
",",
"args",
")",
"\n",
"}"
... | // Expired calls expired RPC. | [
"Expired",
"calls",
"expired",
"RPC",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L188-L190 |
125,542 | minio/minio | cmd/lock-rest-client.go | newlockRESTClient | func newlockRESTClient(peer *xnet.Host) *lockRESTClient {
scheme := "http"
if globalIsSSL {
scheme = "https"
}
serverURL := &url.URL{
Scheme: scheme,
Host: peer.String(),
Path: lockRESTPath,
}
var tlsConfig *tls.Config
if globalIsSSL {
tlsConfig = &tls.Config{
ServerName: peer.Name,
RootCA... | go | func newlockRESTClient(peer *xnet.Host) *lockRESTClient {
scheme := "http"
if globalIsSSL {
scheme = "https"
}
serverURL := &url.URL{
Scheme: scheme,
Host: peer.String(),
Path: lockRESTPath,
}
var tlsConfig *tls.Config
if globalIsSSL {
tlsConfig = &tls.Config{
ServerName: peer.Name,
RootCA... | [
"func",
"newlockRESTClient",
"(",
"peer",
"*",
"xnet",
".",
"Host",
")",
"*",
"lockRESTClient",
"{",
"scheme",
":=",
"\"",
"\"",
"\n",
"if",
"globalIsSSL",
"{",
"scheme",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"serverURL",
":=",
"&",
"url",
".",
"URL",
... | // Returns a lock rest client. | [
"Returns",
"a",
"lock",
"rest",
"client",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/lock-rest-client.go#L193-L223 |
125,543 | minio/minio | pkg/net/host.go | String | func (host Host) String() string {
if !host.IsPortSet {
return host.Name
}
return net.JoinHostPort(host.Name, host.Port.String())
} | go | func (host Host) String() string {
if !host.IsPortSet {
return host.Name
}
return net.JoinHostPort(host.Name, host.Port.String())
} | [
"func",
"(",
"host",
"Host",
")",
"String",
"(",
")",
"string",
"{",
"if",
"!",
"host",
".",
"IsPortSet",
"{",
"return",
"host",
".",
"Name",
"\n",
"}",
"\n\n",
"return",
"net",
".",
"JoinHostPort",
"(",
"host",
".",
"Name",
",",
"host",
".",
"Port... | // String - returns string representation of Host. | [
"String",
"-",
"returns",
"string",
"representation",
"of",
"Host",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/net/host.go#L42-L48 |
125,544 | minio/minio | pkg/net/host.go | Equal | func (host Host) Equal(compHost Host) bool {
return host.String() == compHost.String()
} | go | func (host Host) Equal(compHost Host) bool {
return host.String() == compHost.String()
} | [
"func",
"(",
"host",
"Host",
")",
"Equal",
"(",
"compHost",
"Host",
")",
"bool",
"{",
"return",
"host",
".",
"String",
"(",
")",
"==",
"compHost",
".",
"String",
"(",
")",
"\n",
"}"
] | // Equal - checks whether given host is equal or not. | [
"Equal",
"-",
"checks",
"whether",
"given",
"host",
"is",
"equal",
"or",
"not",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/net/host.go#L51-L53 |
125,545 | minio/minio | pkg/net/host.go | UnmarshalJSON | func (host *Host) UnmarshalJSON(data []byte) (err error) {
var s string
if err = json.Unmarshal(data, &s); err != nil {
return err
}
// Allow empty string
if s == "" {
*host = Host{}
return nil
}
var h *Host
if h, err = ParseHost(s); err != nil {
return err
}
*host = *h
return nil
} | go | func (host *Host) UnmarshalJSON(data []byte) (err error) {
var s string
if err = json.Unmarshal(data, &s); err != nil {
return err
}
// Allow empty string
if s == "" {
*host = Host{}
return nil
}
var h *Host
if h, err = ParseHost(s); err != nil {
return err
}
*host = *h
return nil
} | [
"func",
"(",
"host",
"*",
"Host",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"(",
"err",
"error",
")",
"{",
"var",
"s",
"string",
"\n",
"if",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"data",
",",
"&",
"s",
")",
";",
"err",
"!="... | // UnmarshalJSON - parses data into Host. | [
"UnmarshalJSON",
"-",
"parses",
"data",
"into",
"Host",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/net/host.go#L61-L80 |
125,546 | minio/minio | pkg/net/host.go | ParseHost | func ParseHost(s string) (*Host, error) {
isValidHost := func(host string) bool {
if host == "" {
return false
}
if ip := net.ParseIP(host); ip != nil {
return true
}
// host is not a valid IPv4 or IPv6 address
// host may be a hostname
// refer https://en.wikipedia.org/wiki/Hostname#Restrictions... | go | func ParseHost(s string) (*Host, error) {
isValidHost := func(host string) bool {
if host == "" {
return false
}
if ip := net.ParseIP(host); ip != nil {
return true
}
// host is not a valid IPv4 or IPv6 address
// host may be a hostname
// refer https://en.wikipedia.org/wiki/Hostname#Restrictions... | [
"func",
"ParseHost",
"(",
"s",
"string",
")",
"(",
"*",
"Host",
",",
"error",
")",
"{",
"isValidHost",
":=",
"func",
"(",
"host",
"string",
")",
"bool",
"{",
"if",
"host",
"==",
"\"",
"\"",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"if",
"ip",
"... | // ParseHost - parses string into Host | [
"ParseHost",
"-",
"parses",
"string",
"into",
"Host"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/net/host.go#L83-L145 |
125,547 | minio/minio | cmd/xl-v1-common.go | isObject | func (xl xlObjects) isObject(bucket, prefix string) (ok bool) {
var errs = make([]error, len(xl.getDisks()))
var wg sync.WaitGroup
for index, disk := range xl.getDisks() {
if disk == nil {
continue
}
wg.Add(1)
go func(index int, disk StorageAPI) {
defer wg.Done()
// Check if 'prefix' is an object on... | go | func (xl xlObjects) isObject(bucket, prefix string) (ok bool) {
var errs = make([]error, len(xl.getDisks()))
var wg sync.WaitGroup
for index, disk := range xl.getDisks() {
if disk == nil {
continue
}
wg.Add(1)
go func(index int, disk StorageAPI) {
defer wg.Done()
// Check if 'prefix' is an object on... | [
"func",
"(",
"xl",
"xlObjects",
")",
"isObject",
"(",
"bucket",
",",
"prefix",
"string",
")",
"(",
"ok",
"bool",
")",
"{",
"var",
"errs",
"=",
"make",
"(",
"[",
"]",
"error",
",",
"len",
"(",
"xl",
".",
"getDisks",
"(",
")",
")",
")",
"\n",
"va... | // isObject - returns `true` if the prefix is an object i.e if
// `xl.json` exists at the leaf, false otherwise. | [
"isObject",
"-",
"returns",
"true",
"if",
"the",
"prefix",
"is",
"an",
"object",
"i",
".",
"e",
"if",
"xl",
".",
"json",
"exists",
"at",
"the",
"leaf",
"false",
"otherwise",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-common.go#L55-L87 |
125,548 | minio/minio | cmd/xl-v1-utils.go | reduceQuorumErrs | func reduceQuorumErrs(ctx context.Context, errs []error, ignoredErrs []error, quorum int, quorumErr error) error {
maxCount, maxErr := reduceErrs(errs, ignoredErrs)
if maxCount >= quorum {
return maxErr
}
return quorumErr
} | go | func reduceQuorumErrs(ctx context.Context, errs []error, ignoredErrs []error, quorum int, quorumErr error) error {
maxCount, maxErr := reduceErrs(errs, ignoredErrs)
if maxCount >= quorum {
return maxErr
}
return quorumErr
} | [
"func",
"reduceQuorumErrs",
"(",
"ctx",
"context",
".",
"Context",
",",
"errs",
"[",
"]",
"error",
",",
"ignoredErrs",
"[",
"]",
"error",
",",
"quorum",
"int",
",",
"quorumErr",
"error",
")",
"error",
"{",
"maxCount",
",",
"maxErr",
":=",
"reduceErrs",
"... | // reduceQuorumErrs behaves like reduceErrs by only for returning
// values of maximally occurring errors validated against a generic
// quorum number that can be read or write quorum depending on usage. | [
"reduceQuorumErrs",
"behaves",
"like",
"reduceErrs",
"by",
"only",
"for",
"returning",
"values",
"of",
"maximally",
"occurring",
"errors",
"validated",
"against",
"a",
"generic",
"quorum",
"number",
"that",
"can",
"be",
"read",
"or",
"write",
"quorum",
"depending"... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L66-L72 |
125,549 | minio/minio | cmd/xl-v1-utils.go | reduceReadQuorumErrs | func reduceReadQuorumErrs(ctx context.Context, errs []error, ignoredErrs []error, readQuorum int) (maxErr error) {
return reduceQuorumErrs(ctx, errs, ignoredErrs, readQuorum, errXLReadQuorum)
} | go | func reduceReadQuorumErrs(ctx context.Context, errs []error, ignoredErrs []error, readQuorum int) (maxErr error) {
return reduceQuorumErrs(ctx, errs, ignoredErrs, readQuorum, errXLReadQuorum)
} | [
"func",
"reduceReadQuorumErrs",
"(",
"ctx",
"context",
".",
"Context",
",",
"errs",
"[",
"]",
"error",
",",
"ignoredErrs",
"[",
"]",
"error",
",",
"readQuorum",
"int",
")",
"(",
"maxErr",
"error",
")",
"{",
"return",
"reduceQuorumErrs",
"(",
"ctx",
",",
... | // reduceReadQuorumErrs behaves like reduceErrs but only for returning
// values of maximally occurring errors validated against readQuorum. | [
"reduceReadQuorumErrs",
"behaves",
"like",
"reduceErrs",
"but",
"only",
"for",
"returning",
"values",
"of",
"maximally",
"occurring",
"errors",
"validated",
"against",
"readQuorum",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L76-L78 |
125,550 | minio/minio | cmd/xl-v1-utils.go | reduceWriteQuorumErrs | func reduceWriteQuorumErrs(ctx context.Context, errs []error, ignoredErrs []error, writeQuorum int) (maxErr error) {
return reduceQuorumErrs(ctx, errs, ignoredErrs, writeQuorum, errXLWriteQuorum)
} | go | func reduceWriteQuorumErrs(ctx context.Context, errs []error, ignoredErrs []error, writeQuorum int) (maxErr error) {
return reduceQuorumErrs(ctx, errs, ignoredErrs, writeQuorum, errXLWriteQuorum)
} | [
"func",
"reduceWriteQuorumErrs",
"(",
"ctx",
"context",
".",
"Context",
",",
"errs",
"[",
"]",
"error",
",",
"ignoredErrs",
"[",
"]",
"error",
",",
"writeQuorum",
"int",
")",
"(",
"maxErr",
"error",
")",
"{",
"return",
"reduceQuorumErrs",
"(",
"ctx",
",",
... | // reduceWriteQuorumErrs behaves like reduceErrs but only for returning
// values of maximally occurring errors validated against writeQuorum. | [
"reduceWriteQuorumErrs",
"behaves",
"like",
"reduceErrs",
"but",
"only",
"for",
"returning",
"values",
"of",
"maximally",
"occurring",
"errors",
"validated",
"against",
"writeQuorum",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L82-L84 |
125,551 | minio/minio | cmd/xl-v1-utils.go | xlMetaV1UnmarshalJSON | func xlMetaV1UnmarshalJSON(ctx context.Context, xlMetaBuf []byte) (xlMeta xlMetaV1, e error) {
var json = jsoniter.ConfigCompatibleWithStandardLibrary
e = json.Unmarshal(xlMetaBuf, &xlMeta)
return xlMeta, e
} | go | func xlMetaV1UnmarshalJSON(ctx context.Context, xlMetaBuf []byte) (xlMeta xlMetaV1, e error) {
var json = jsoniter.ConfigCompatibleWithStandardLibrary
e = json.Unmarshal(xlMetaBuf, &xlMeta)
return xlMeta, e
} | [
"func",
"xlMetaV1UnmarshalJSON",
"(",
"ctx",
"context",
".",
"Context",
",",
"xlMetaBuf",
"[",
"]",
"byte",
")",
"(",
"xlMeta",
"xlMetaV1",
",",
"e",
"error",
")",
"{",
"var",
"json",
"=",
"jsoniter",
".",
"ConfigCompatibleWithStandardLibrary",
"\n",
"e",
"=... | // Constructs XLMetaV1 using `gjson` lib to retrieve each field. | [
"Constructs",
"XLMetaV1",
"using",
"gjson",
"lib",
"to",
"retrieve",
"each",
"field",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L169-L173 |
125,552 | minio/minio | cmd/xl-v1-utils.go | readXLMetaParts | func readXLMetaParts(ctx context.Context, disk StorageAPI, bucket string, object string) ([]ObjectPartInfo, map[string]string, error) {
// Reads entire `xl.json`.
xlMetaBuf, err := disk.ReadAll(bucket, path.Join(object, xlMetaJSONFile))
if err != nil {
logger.LogIf(ctx, err)
return nil, nil, err
}
// obtain x... | go | func readXLMetaParts(ctx context.Context, disk StorageAPI, bucket string, object string) ([]ObjectPartInfo, map[string]string, error) {
// Reads entire `xl.json`.
xlMetaBuf, err := disk.ReadAll(bucket, path.Join(object, xlMetaJSONFile))
if err != nil {
logger.LogIf(ctx, err)
return nil, nil, err
}
// obtain x... | [
"func",
"readXLMetaParts",
"(",
"ctx",
"context",
".",
"Context",
",",
"disk",
"StorageAPI",
",",
"bucket",
"string",
",",
"object",
"string",
")",
"(",
"[",
"]",
"ObjectPartInfo",
",",
"map",
"[",
"string",
"]",
"string",
",",
"error",
")",
"{",
"// Rea... | // read xl.json from the given disk, parse and return xlV1MetaV1.Parts. | [
"read",
"xl",
".",
"json",
"from",
"the",
"given",
"disk",
"parse",
"and",
"return",
"xlV1MetaV1",
".",
"Parts",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L176-L189 |
125,553 | minio/minio | cmd/xl-v1-utils.go | readXLMetaStat | func readXLMetaStat(ctx context.Context, disk StorageAPI, bucket string, object string) (si statInfo, mp map[string]string, e error) {
// Reads entire `xl.json`.
xlMetaBuf, err := disk.ReadAll(bucket, path.Join(object, xlMetaJSONFile))
if err != nil {
logger.LogIf(ctx, err)
return si, nil, err
}
// obtain ver... | go | func readXLMetaStat(ctx context.Context, disk StorageAPI, bucket string, object string) (si statInfo, mp map[string]string, e error) {
// Reads entire `xl.json`.
xlMetaBuf, err := disk.ReadAll(bucket, path.Join(object, xlMetaJSONFile))
if err != nil {
logger.LogIf(ctx, err)
return si, nil, err
}
// obtain ver... | [
"func",
"readXLMetaStat",
"(",
"ctx",
"context",
".",
"Context",
",",
"disk",
"StorageAPI",
",",
"bucket",
"string",
",",
"object",
"string",
")",
"(",
"si",
"statInfo",
",",
"mp",
"map",
"[",
"string",
"]",
"string",
",",
"e",
"error",
")",
"{",
"// R... | // read xl.json from the given disk and parse xlV1Meta.Stat and xlV1Meta.Meta using gjson. | [
"read",
"xl",
".",
"json",
"from",
"the",
"given",
"disk",
"and",
"parse",
"xlV1Meta",
".",
"Stat",
"and",
"xlV1Meta",
".",
"Meta",
"using",
"gjson",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L192-L225 |
125,554 | minio/minio | cmd/xl-v1-utils.go | readXLMeta | func readXLMeta(ctx context.Context, disk StorageAPI, bucket string, object string) (xlMeta xlMetaV1, err error) {
// Reads entire `xl.json`.
xlMetaBuf, err := disk.ReadAll(bucket, path.Join(object, xlMetaJSONFile))
if err != nil {
if err != errFileNotFound && err != errVolumeNotFound {
logger.GetReqInfo(ctx).A... | go | func readXLMeta(ctx context.Context, disk StorageAPI, bucket string, object string) (xlMeta xlMetaV1, err error) {
// Reads entire `xl.json`.
xlMetaBuf, err := disk.ReadAll(bucket, path.Join(object, xlMetaJSONFile))
if err != nil {
if err != errFileNotFound && err != errVolumeNotFound {
logger.GetReqInfo(ctx).A... | [
"func",
"readXLMeta",
"(",
"ctx",
"context",
".",
"Context",
",",
"disk",
"StorageAPI",
",",
"bucket",
"string",
",",
"object",
"string",
")",
"(",
"xlMeta",
"xlMetaV1",
",",
"err",
"error",
")",
"{",
"// Reads entire `xl.json`.",
"xlMetaBuf",
",",
"err",
":... | // readXLMeta reads `xl.json` and returns back XL metadata structure. | [
"readXLMeta",
"reads",
"xl",
".",
"json",
"and",
"returns",
"back",
"XL",
"metadata",
"structure",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L228-L250 |
125,555 | minio/minio | cmd/xl-v1-utils.go | readAllXLMetadata | func readAllXLMetadata(ctx context.Context, disks []StorageAPI, bucket, object string) ([]xlMetaV1, []error) {
errs := make([]error, len(disks))
metadataArray := make([]xlMetaV1, len(disks))
var wg = &sync.WaitGroup{}
// Read `xl.json` parallelly across disks.
for index, disk := range disks {
if disk == nil {
... | go | func readAllXLMetadata(ctx context.Context, disks []StorageAPI, bucket, object string) ([]xlMetaV1, []error) {
errs := make([]error, len(disks))
metadataArray := make([]xlMetaV1, len(disks))
var wg = &sync.WaitGroup{}
// Read `xl.json` parallelly across disks.
for index, disk := range disks {
if disk == nil {
... | [
"func",
"readAllXLMetadata",
"(",
"ctx",
"context",
".",
"Context",
",",
"disks",
"[",
"]",
"StorageAPI",
",",
"bucket",
",",
"object",
"string",
")",
"(",
"[",
"]",
"xlMetaV1",
",",
"[",
"]",
"error",
")",
"{",
"errs",
":=",
"make",
"(",
"[",
"]",
... | // Reads all `xl.json` metadata as a xlMetaV1 slice.
// Returns error slice indicating the failed metadata reads. | [
"Reads",
"all",
"xl",
".",
"json",
"metadata",
"as",
"a",
"xlMetaV1",
"slice",
".",
"Returns",
"error",
"slice",
"indicating",
"the",
"failed",
"metadata",
"reads",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L254-L282 |
125,556 | minio/minio | cmd/xl-v1-utils.go | shufflePartsMetadata | func shufflePartsMetadata(partsMetadata []xlMetaV1, distribution []int) (shuffledPartsMetadata []xlMetaV1) {
if distribution == nil {
return partsMetadata
}
shuffledPartsMetadata = make([]xlMetaV1, len(partsMetadata))
// Shuffle slice xl metadata for expected distribution.
for index := range partsMetadata {
bl... | go | func shufflePartsMetadata(partsMetadata []xlMetaV1, distribution []int) (shuffledPartsMetadata []xlMetaV1) {
if distribution == nil {
return partsMetadata
}
shuffledPartsMetadata = make([]xlMetaV1, len(partsMetadata))
// Shuffle slice xl metadata for expected distribution.
for index := range partsMetadata {
bl... | [
"func",
"shufflePartsMetadata",
"(",
"partsMetadata",
"[",
"]",
"xlMetaV1",
",",
"distribution",
"[",
"]",
"int",
")",
"(",
"shuffledPartsMetadata",
"[",
"]",
"xlMetaV1",
")",
"{",
"if",
"distribution",
"==",
"nil",
"{",
"return",
"partsMetadata",
"\n",
"}",
... | // Return shuffled partsMetadata depending on distribution. | [
"Return",
"shuffled",
"partsMetadata",
"depending",
"on",
"distribution",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L285-L296 |
125,557 | minio/minio | cmd/xl-v1-utils.go | shuffleDisks | func shuffleDisks(disks []StorageAPI, distribution []int) (shuffledDisks []StorageAPI) {
if distribution == nil {
return disks
}
shuffledDisks = make([]StorageAPI, len(disks))
// Shuffle disks for expected distribution.
for index := range disks {
blockIndex := distribution[index]
shuffledDisks[blockIndex-1] ... | go | func shuffleDisks(disks []StorageAPI, distribution []int) (shuffledDisks []StorageAPI) {
if distribution == nil {
return disks
}
shuffledDisks = make([]StorageAPI, len(disks))
// Shuffle disks for expected distribution.
for index := range disks {
blockIndex := distribution[index]
shuffledDisks[blockIndex-1] ... | [
"func",
"shuffleDisks",
"(",
"disks",
"[",
"]",
"StorageAPI",
",",
"distribution",
"[",
"]",
"int",
")",
"(",
"shuffledDisks",
"[",
"]",
"StorageAPI",
")",
"{",
"if",
"distribution",
"==",
"nil",
"{",
"return",
"disks",
"\n",
"}",
"\n",
"shuffledDisks",
... | // shuffleDisks - shuffle input disks slice depending on the
// erasure distribution. Return shuffled slice of disks with
// their expected distribution. | [
"shuffleDisks",
"-",
"shuffle",
"input",
"disks",
"slice",
"depending",
"on",
"the",
"erasure",
"distribution",
".",
"Return",
"shuffled",
"slice",
"of",
"disks",
"with",
"their",
"expected",
"distribution",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L301-L312 |
125,558 | minio/minio | cmd/xl-v1-utils.go | evalDisks | func evalDisks(disks []StorageAPI, errs []error) []StorageAPI {
if len(errs) != len(disks) {
logger.LogIf(context.Background(), errors.New("unexpected disks/errors slice length"))
return nil
}
newDisks := make([]StorageAPI, len(disks))
for index := range errs {
if errs[index] == nil {
newDisks[index] = dis... | go | func evalDisks(disks []StorageAPI, errs []error) []StorageAPI {
if len(errs) != len(disks) {
logger.LogIf(context.Background(), errors.New("unexpected disks/errors slice length"))
return nil
}
newDisks := make([]StorageAPI, len(disks))
for index := range errs {
if errs[index] == nil {
newDisks[index] = dis... | [
"func",
"evalDisks",
"(",
"disks",
"[",
"]",
"StorageAPI",
",",
"errs",
"[",
"]",
"error",
")",
"[",
"]",
"StorageAPI",
"{",
"if",
"len",
"(",
"errs",
")",
"!=",
"len",
"(",
"disks",
")",
"{",
"logger",
".",
"LogIf",
"(",
"context",
".",
"Backgroun... | // evalDisks - returns a new slice of disks where nil is set if
// the corresponding error in errs slice is not nil | [
"evalDisks",
"-",
"returns",
"a",
"new",
"slice",
"of",
"disks",
"where",
"nil",
"is",
"set",
"if",
"the",
"corresponding",
"error",
"in",
"errs",
"slice",
"is",
"not",
"nil"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L316-L330 |
125,559 | minio/minio | cmd/xl-v1-utils.go | calculatePartSizeFromIdx | func calculatePartSizeFromIdx(ctx context.Context, totalSize int64, partSize int64, partIndex int) (currPartSize int64, err error) {
if totalSize < -1 {
logger.LogIf(ctx, errInvalidArgument)
return 0, errInvalidArgument
}
if partSize == 0 {
logger.LogIf(ctx, errPartSizeZero)
return 0, errPartSizeZero
}
if ... | go | func calculatePartSizeFromIdx(ctx context.Context, totalSize int64, partSize int64, partIndex int) (currPartSize int64, err error) {
if totalSize < -1 {
logger.LogIf(ctx, errInvalidArgument)
return 0, errInvalidArgument
}
if partSize == 0 {
logger.LogIf(ctx, errPartSizeZero)
return 0, errPartSizeZero
}
if ... | [
"func",
"calculatePartSizeFromIdx",
"(",
"ctx",
"context",
".",
"Context",
",",
"totalSize",
"int64",
",",
"partSize",
"int64",
",",
"partIndex",
"int",
")",
"(",
"currPartSize",
"int64",
",",
"err",
"error",
")",
"{",
"if",
"totalSize",
"<",
"-",
"1",
"{"... | // calculatePartSizeFromIdx calculates the part size according to input index.
// returns error if totalSize is -1, partSize is 0, partIndex is 0. | [
"calculatePartSizeFromIdx",
"calculates",
"the",
"part",
"size",
"according",
"to",
"input",
"index",
".",
"returns",
"error",
"if",
"totalSize",
"is",
"-",
"1",
"partSize",
"is",
"0",
"partIndex",
"is",
"0",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/xl-v1-utils.go#L340-L371 |
125,560 | minio/minio | pkg/iam/validator/validators.go | Add | func (list *Validators) Add(provider Validator) error {
list.Lock()
defer list.Unlock()
if _, ok := list.providers[provider.ID()]; ok {
return fmt.Errorf("provider %v already exists", provider.ID())
}
list.providers[provider.ID()] = provider
return nil
} | go | func (list *Validators) Add(provider Validator) error {
list.Lock()
defer list.Unlock()
if _, ok := list.providers[provider.ID()]; ok {
return fmt.Errorf("provider %v already exists", provider.ID())
}
list.providers[provider.ID()] = provider
return nil
} | [
"func",
"(",
"list",
"*",
"Validators",
")",
"Add",
"(",
"provider",
"Validator",
")",
"error",
"{",
"list",
".",
"Lock",
"(",
")",
"\n",
"defer",
"list",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"_",
",",
"ok",
":=",
"list",
".",
"providers",
"[",
... | // Add - adds unique provider to provider list. | [
"Add",
"-",
"adds",
"unique",
"provider",
"to",
"provider",
"list",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/iam/validator/validators.go#L52-L62 |
125,561 | minio/minio | pkg/iam/validator/validators.go | List | func (list *Validators) List() []ID {
list.RLock()
defer list.RUnlock()
keys := []ID{}
for k := range list.providers {
keys = append(keys, k)
}
return keys
} | go | func (list *Validators) List() []ID {
list.RLock()
defer list.RUnlock()
keys := []ID{}
for k := range list.providers {
keys = append(keys, k)
}
return keys
} | [
"func",
"(",
"list",
"*",
"Validators",
")",
"List",
"(",
")",
"[",
"]",
"ID",
"{",
"list",
".",
"RLock",
"(",
")",
"\n",
"defer",
"list",
".",
"RUnlock",
"(",
")",
"\n\n",
"keys",
":=",
"[",
"]",
"ID",
"{",
"}",
"\n",
"for",
"k",
":=",
"rang... | // List - returns available provider IDs. | [
"List",
"-",
"returns",
"available",
"provider",
"IDs",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/iam/validator/validators.go#L65-L75 |
125,562 | minio/minio | pkg/iam/validator/validators.go | Get | func (list *Validators) Get(id ID) (p Validator, err error) {
list.RLock()
defer list.RUnlock()
var ok bool
if p, ok = list.providers[id]; !ok {
return nil, fmt.Errorf("provider %v doesn't exist", id)
}
return p, nil
} | go | func (list *Validators) Get(id ID) (p Validator, err error) {
list.RLock()
defer list.RUnlock()
var ok bool
if p, ok = list.providers[id]; !ok {
return nil, fmt.Errorf("provider %v doesn't exist", id)
}
return p, nil
} | [
"func",
"(",
"list",
"*",
"Validators",
")",
"Get",
"(",
"id",
"ID",
")",
"(",
"p",
"Validator",
",",
"err",
"error",
")",
"{",
"list",
".",
"RLock",
"(",
")",
"\n",
"defer",
"list",
".",
"RUnlock",
"(",
")",
"\n",
"var",
"ok",
"bool",
"\n",
"i... | // Get - returns the provider for the given providerID, if not found
// returns an error. | [
"Get",
"-",
"returns",
"the",
"provider",
"for",
"the",
"given",
"providerID",
"if",
"not",
"found",
"returns",
"an",
"error",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/iam/validator/validators.go#L79-L87 |
125,563 | minio/minio | cmd/crypto/kms.go | WriteTo | func (c Context) WriteTo(w io.Writer) (n int64, err error) {
sortedKeys := make(sort.StringSlice, 0, len(c))
for k := range c {
sortedKeys = append(sortedKeys, k)
}
sort.Sort(sortedKeys)
nn, err := io.WriteString(w, "{")
if err != nil {
return n + int64(nn), err
}
n += int64(nn)
for i, k := range sortedKe... | go | func (c Context) WriteTo(w io.Writer) (n int64, err error) {
sortedKeys := make(sort.StringSlice, 0, len(c))
for k := range c {
sortedKeys = append(sortedKeys, k)
}
sort.Sort(sortedKeys)
nn, err := io.WriteString(w, "{")
if err != nil {
return n + int64(nn), err
}
n += int64(nn)
for i, k := range sortedKe... | [
"func",
"(",
"c",
"Context",
")",
"WriteTo",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"sortedKeys",
":=",
"make",
"(",
"sort",
".",
"StringSlice",
",",
"0",
",",
"len",
"(",
"c",
")",
")",
"\n",
"for... | // WriteTo writes the context in a canonical from to w.
// It returns the number of bytes and the first error
// encounter during writing to w, if any.
//
// WriteTo sorts the context keys and writes the sorted
// key-value pairs as canonical JSON object to w. | [
"WriteTo",
"writes",
"the",
"context",
"in",
"a",
"canonical",
"from",
"to",
"w",
".",
"It",
"returns",
"the",
"number",
"of",
"bytes",
"and",
"the",
"first",
"error",
"encounter",
"during",
"writing",
"to",
"w",
"if",
"any",
".",
"WriteTo",
"sorts",
"th... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/crypto/kms.go#L42-L68 |
125,564 | minio/minio | cmd/config-dir.go | mkdirAllIgnorePerm | func mkdirAllIgnorePerm(path string) error {
err := os.MkdirAll(path, 0700)
if err != nil {
// It is possible in kubernetes like deployments this directory
// is already mounted and is not writable, ignore any write errors.
if os.IsPermission(err) {
err = nil
}
}
return err
} | go | func mkdirAllIgnorePerm(path string) error {
err := os.MkdirAll(path, 0700)
if err != nil {
// It is possible in kubernetes like deployments this directory
// is already mounted and is not writable, ignore any write errors.
if os.IsPermission(err) {
err = nil
}
}
return err
} | [
"func",
"mkdirAllIgnorePerm",
"(",
"path",
"string",
")",
"error",
"{",
"err",
":=",
"os",
".",
"MkdirAll",
"(",
"path",
",",
"0700",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"// It is possible in kubernetes like deployments this directory",
"// is already mounted ... | // Attempts to create all directories, ignores any permission denied errors. | [
"Attempts",
"to",
"create",
"all",
"directories",
"ignores",
"any",
"permission",
"denied",
"errors",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/config-dir.go#L85-L95 |
125,565 | minio/minio | cmd/server-startup-msg.go | getFormatStr | func getFormatStr(strLen int, padding int) string {
formatStr := fmt.Sprintf("%ds", strLen+padding)
return "%" + formatStr
} | go | func getFormatStr(strLen int, padding int) string {
formatStr := fmt.Sprintf("%ds", strLen+padding)
return "%" + formatStr
} | [
"func",
"getFormatStr",
"(",
"strLen",
"int",
",",
"padding",
"int",
")",
"string",
"{",
"formatStr",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strLen",
"+",
"padding",
")",
"\n",
"return",
"\"",
"\"",
"+",
"formatStr",
"\n",
"}"
] | // generates format string depending on the string length and padding. | [
"generates",
"format",
"string",
"depending",
"on",
"the",
"string",
"length",
"and",
"padding",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L43-L46 |
125,566 | minio/minio | cmd/server-startup-msg.go | isNotIPv4 | func isNotIPv4(host string) bool {
h, _, err := net.SplitHostPort(host)
if err != nil {
h = host
}
ip := net.ParseIP(h)
ok := ip.To4() != nil // This is always true of IP is IPv4
// Returns true if input is not IPv4.
return !ok
} | go | func isNotIPv4(host string) bool {
h, _, err := net.SplitHostPort(host)
if err != nil {
h = host
}
ip := net.ParseIP(h)
ok := ip.To4() != nil // This is always true of IP is IPv4
// Returns true if input is not IPv4.
return !ok
} | [
"func",
"isNotIPv4",
"(",
"host",
"string",
")",
"bool",
"{",
"h",
",",
"_",
",",
"err",
":=",
"net",
".",
"SplitHostPort",
"(",
"host",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"h",
"=",
"host",
"\n",
"}",
"\n",
"ip",
":=",
"net",
".",
"Parse... | // Returns true if input is not IPv4, false if it is. | [
"Returns",
"true",
"if",
"input",
"is",
"not",
"IPv4",
"false",
"if",
"it",
"is",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L81-L91 |
125,567 | minio/minio | cmd/server-startup-msg.go | stripStandardPorts | func stripStandardPorts(apiEndpoints []string) (newAPIEndpoints []string) {
newAPIEndpoints = make([]string, len(apiEndpoints))
// Check all API endpoints for standard ports and strip them.
for i, apiEndpoint := range apiEndpoints {
u, err := xnet.ParseURL(apiEndpoint)
if err != nil {
newAPIEndpoints[i] = api... | go | func stripStandardPorts(apiEndpoints []string) (newAPIEndpoints []string) {
newAPIEndpoints = make([]string, len(apiEndpoints))
// Check all API endpoints for standard ports and strip them.
for i, apiEndpoint := range apiEndpoints {
u, err := xnet.ParseURL(apiEndpoint)
if err != nil {
newAPIEndpoints[i] = api... | [
"func",
"stripStandardPorts",
"(",
"apiEndpoints",
"[",
"]",
"string",
")",
"(",
"newAPIEndpoints",
"[",
"]",
"string",
")",
"{",
"newAPIEndpoints",
"=",
"make",
"(",
"[",
"]",
"string",
",",
"len",
"(",
"apiEndpoints",
")",
")",
"\n",
"// Check all API endp... | // strip api endpoints list with standard ports such as
// port "80" and "443" before displaying on the startup
// banner. Returns a new list of API endpoints. | [
"strip",
"api",
"endpoints",
"list",
"with",
"standard",
"ports",
"such",
"as",
"port",
"80",
"and",
"443",
"before",
"displaying",
"on",
"the",
"startup",
"banner",
".",
"Returns",
"a",
"new",
"list",
"of",
"API",
"endpoints",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L96-L112 |
125,568 | minio/minio | cmd/server-startup-msg.go | printEventNotifiers | func printEventNotifiers() {
arns := globalNotificationSys.GetARNList()
if len(arns) == 0 {
return
}
arnMsg := colorBlue("SQS ARNs: ")
for _, arn := range arns {
arnMsg += colorBold(fmt.Sprintf(getFormatStr(len(arn), 1), arn))
}
logger.StartupMessage(arnMsg)
} | go | func printEventNotifiers() {
arns := globalNotificationSys.GetARNList()
if len(arns) == 0 {
return
}
arnMsg := colorBlue("SQS ARNs: ")
for _, arn := range arns {
arnMsg += colorBold(fmt.Sprintf(getFormatStr(len(arn), 1), arn))
}
logger.StartupMessage(arnMsg)
} | [
"func",
"printEventNotifiers",
"(",
")",
"{",
"arns",
":=",
"globalNotificationSys",
".",
"GetARNList",
"(",
")",
"\n",
"if",
"len",
"(",
"arns",
")",
"==",
"0",
"{",
"return",
"\n",
"}",
"\n\n",
"arnMsg",
":=",
"colorBlue",
"(",
"\"",
"\"",
")",
"\n",... | // Prints bucket notification configurations. | [
"Prints",
"bucket",
"notification",
"configurations",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L142-L154 |
125,569 | minio/minio | cmd/server-startup-msg.go | printCLIAccessMsg | func printCLIAccessMsg(endPoint string, alias string) {
// Get saved credentials.
cred := globalServerConfig.GetCredential()
// Configure 'mc', following block prints platform specific information for minio client.
if isTerminal() {
logger.StartupMessage(colorBlue("\nCommand-line Access: ") + mcQuickStartGuide)
... | go | func printCLIAccessMsg(endPoint string, alias string) {
// Get saved credentials.
cred := globalServerConfig.GetCredential()
// Configure 'mc', following block prints platform specific information for minio client.
if isTerminal() {
logger.StartupMessage(colorBlue("\nCommand-line Access: ") + mcQuickStartGuide)
... | [
"func",
"printCLIAccessMsg",
"(",
"endPoint",
"string",
",",
"alias",
"string",
")",
"{",
"// Get saved credentials.",
"cred",
":=",
"globalServerConfig",
".",
"GetCredential",
"(",
")",
"\n\n",
"// Configure 'mc', following block prints platform specific information for minio ... | // Prints startup message for command line access. Prints link to our documentation
// and custom platform specific message. | [
"Prints",
"startup",
"message",
"for",
"command",
"line",
"access",
".",
"Prints",
"link",
"to",
"our",
"documentation",
"and",
"custom",
"platform",
"specific",
"message",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L158-L173 |
125,570 | minio/minio | cmd/server-startup-msg.go | printObjectAPIMsg | func printObjectAPIMsg() {
logger.StartupMessage(colorBlue("\nObject API (Amazon S3 compatible):"))
logger.StartupMessage(colorBlue(" Go: ") + fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide))
logger.StartupMessage(colorBlue(" Java: ") + fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6... | go | func printObjectAPIMsg() {
logger.StartupMessage(colorBlue("\nObject API (Amazon S3 compatible):"))
logger.StartupMessage(colorBlue(" Go: ") + fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide))
logger.StartupMessage(colorBlue(" Java: ") + fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6... | [
"func",
"printObjectAPIMsg",
"(",
")",
"{",
"logger",
".",
"StartupMessage",
"(",
"colorBlue",
"(",
"\"",
"\\n",
"\"",
")",
")",
"\n",
"logger",
".",
"StartupMessage",
"(",
"colorBlue",
"(",
"\"",
"\"",
")",
"+",
"fmt",
".",
"Sprintf",
"(",
"getFormatStr... | // Prints startup message for Object API acces, prints link to our SDK documentation. | [
"Prints",
"startup",
"message",
"for",
"Object",
"API",
"acces",
"prints",
"link",
"to",
"our",
"SDK",
"documentation",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L176-L183 |
125,571 | minio/minio | cmd/server-startup-msg.go | printStorageInfo | func printStorageInfo(storageInfo StorageInfo) {
if msg := getStorageInfoMsg(storageInfo); msg != "" {
logger.StartupMessage(msg)
}
} | go | func printStorageInfo(storageInfo StorageInfo) {
if msg := getStorageInfoMsg(storageInfo); msg != "" {
logger.StartupMessage(msg)
}
} | [
"func",
"printStorageInfo",
"(",
"storageInfo",
"StorageInfo",
")",
"{",
"if",
"msg",
":=",
"getStorageInfoMsg",
"(",
"storageInfo",
")",
";",
"msg",
"!=",
"\"",
"\"",
"{",
"logger",
".",
"StartupMessage",
"(",
"msg",
")",
"\n",
"}",
"\n",
"}"
] | // Prints startup message of storage capacity and erasure information. | [
"Prints",
"startup",
"message",
"of",
"storage",
"capacity",
"and",
"erasure",
"information",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L196-L200 |
125,572 | minio/minio | cmd/server-startup-msg.go | getCertificateChainMsg | func getCertificateChainMsg(certs []*x509.Certificate) string {
msg := colorBlue("\nCertificate expiry info:\n")
totalCerts := len(certs)
var expiringCerts int
for i := totalCerts - 1; i >= 0; i-- {
cert := certs[i]
if cert.NotAfter.Before(UTCNow().Add(globalMinioCertExpireWarnDays)) {
expiringCerts++
msg... | go | func getCertificateChainMsg(certs []*x509.Certificate) string {
msg := colorBlue("\nCertificate expiry info:\n")
totalCerts := len(certs)
var expiringCerts int
for i := totalCerts - 1; i >= 0; i-- {
cert := certs[i]
if cert.NotAfter.Before(UTCNow().Add(globalMinioCertExpireWarnDays)) {
expiringCerts++
msg... | [
"func",
"getCertificateChainMsg",
"(",
"certs",
"[",
"]",
"*",
"x509",
".",
"Certificate",
")",
"string",
"{",
"msg",
":=",
"colorBlue",
"(",
"\"",
"\\n",
"\\n",
"\"",
")",
"\n",
"totalCerts",
":=",
"len",
"(",
"certs",
")",
"\n",
"var",
"expiringCerts",... | // Prints certificate expiry date warning | [
"Prints",
"certificate",
"expiry",
"date",
"warning"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/server-startup-msg.go#L210-L225 |
125,573 | minio/minio | cmd/storage-errors.go | Error | func (h hashMismatchError) Error() string {
return fmt.Sprintf(
"Bitrot verification mismatch - expected %v, received %v",
h.expected, h.computed)
} | go | func (h hashMismatchError) Error() string {
return fmt.Sprintf(
"Bitrot verification mismatch - expected %v, received %v",
h.expected, h.computed)
} | [
"func",
"(",
"h",
"hashMismatchError",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"h",
".",
"expected",
",",
"h",
".",
"computed",
")",
"\n",
"}"
] | // error method for the hashMismatchError | [
"error",
"method",
"for",
"the",
"hashMismatchError"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/storage-errors.go#L102-L106 |
125,574 | minio/minio | cmd/sts-errors.go | writeSTSErrorResponse | func writeSTSErrorResponse(w http.ResponseWriter, err STSError) {
// Generate error response.
stsErrorResponse := getSTSErrorResponse(err, w.Header().Get(responseRequestIDKey))
encodedErrorResponse := encodeResponse(stsErrorResponse)
writeResponse(w, err.HTTPStatusCode, encodedErrorResponse, mimeXML)
} | go | func writeSTSErrorResponse(w http.ResponseWriter, err STSError) {
// Generate error response.
stsErrorResponse := getSTSErrorResponse(err, w.Header().Get(responseRequestIDKey))
encodedErrorResponse := encodeResponse(stsErrorResponse)
writeResponse(w, err.HTTPStatusCode, encodedErrorResponse, mimeXML)
} | [
"func",
"writeSTSErrorResponse",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"err",
"STSError",
")",
"{",
"// Generate error response.",
"stsErrorResponse",
":=",
"getSTSErrorResponse",
"(",
"err",
",",
"w",
".",
"Header",
"(",
")",
".",
"Get",
"(",
"responseR... | // writeSTSErrorRespone writes error headers | [
"writeSTSErrorRespone",
"writes",
"error",
"headers"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/sts-errors.go#L25-L30 |
125,575 | minio/minio | cmd/sts-errors.go | getSTSErrorResponse | func getSTSErrorResponse(err STSError, requestID string) STSErrorResponse {
errRsp := STSErrorResponse{}
errRsp.Error.Code = err.Code
errRsp.Error.Message = err.Description
errRsp.RequestID = requestID
return errRsp
} | go | func getSTSErrorResponse(err STSError, requestID string) STSErrorResponse {
errRsp := STSErrorResponse{}
errRsp.Error.Code = err.Code
errRsp.Error.Message = err.Description
errRsp.RequestID = requestID
return errRsp
} | [
"func",
"getSTSErrorResponse",
"(",
"err",
"STSError",
",",
"requestID",
"string",
")",
"STSErrorResponse",
"{",
"errRsp",
":=",
"STSErrorResponse",
"{",
"}",
"\n",
"errRsp",
".",
"Error",
".",
"Code",
"=",
"err",
".",
"Code",
"\n",
"errRsp",
".",
"Error",
... | // getSTSErrorResponse gets in standard error and
// provides a encodable populated response values | [
"getSTSErrorResponse",
"gets",
"in",
"standard",
"error",
"and",
"provides",
"a",
"encodable",
"populated",
"response",
"values"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/sts-errors.go#L129-L135 |
125,576 | minio/minio | cmd/tree-walk.go | doTreeWalk | func doTreeWalk(ctx context.Context, bucket, prefixDir, entryPrefixMatch, marker string, recursive bool, listDir ListDirFunc, resultCh chan TreeWalkResult, endWalkCh chan struct{}, isEnd bool) error {
// Example:
// if prefixDir="one/two/three/" and marker="four/five.txt" treeWalk is recursively
// called with prefi... | go | func doTreeWalk(ctx context.Context, bucket, prefixDir, entryPrefixMatch, marker string, recursive bool, listDir ListDirFunc, resultCh chan TreeWalkResult, endWalkCh chan struct{}, isEnd bool) error {
// Example:
// if prefixDir="one/two/three/" and marker="four/five.txt" treeWalk is recursively
// called with prefi... | [
"func",
"doTreeWalk",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefixDir",
",",
"entryPrefixMatch",
",",
"marker",
"string",
",",
"recursive",
"bool",
",",
"listDir",
"ListDirFunc",
",",
"resultCh",
"chan",
"TreeWalkResult",
",",
"endWalkCh",
... | // treeWalk walks directory tree recursively pushing TreeWalkResult into the channel as and when it encounters files. | [
"treeWalk",
"walks",
"directory",
"tree",
"recursively",
"pushing",
"TreeWalkResult",
"into",
"the",
"channel",
"as",
"and",
"when",
"it",
"encounters",
"files",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/tree-walk.go#L62-L150 |
125,577 | minio/minio | cmd/tree-walk.go | startTreeWalk | func startTreeWalk(ctx context.Context, bucket, prefix, marker string, recursive bool, listDir ListDirFunc, endWalkCh chan struct{}) chan TreeWalkResult {
// Example 1
// If prefix is "one/two/three/" and marker is "one/two/three/four/five.txt"
// treeWalk is called with prefixDir="one/two/three/" and marker="four/f... | go | func startTreeWalk(ctx context.Context, bucket, prefix, marker string, recursive bool, listDir ListDirFunc, endWalkCh chan struct{}) chan TreeWalkResult {
// Example 1
// If prefix is "one/two/three/" and marker is "one/two/three/four/five.txt"
// treeWalk is called with prefixDir="one/two/three/" and marker="four/f... | [
"func",
"startTreeWalk",
"(",
"ctx",
"context",
".",
"Context",
",",
"bucket",
",",
"prefix",
",",
"marker",
"string",
",",
"recursive",
"bool",
",",
"listDir",
"ListDirFunc",
",",
"endWalkCh",
"chan",
"struct",
"{",
"}",
")",
"chan",
"TreeWalkResult",
"{",
... | // Initiate a new treeWalk in a goroutine. | [
"Initiate",
"a",
"new",
"treeWalk",
"in",
"a",
"goroutine",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/tree-walk.go#L153-L179 |
125,578 | minio/minio | pkg/s3select/select.go | Open | func (s3Select *S3Select) Open(getReader func(offset, length int64) (io.ReadCloser, error)) error {
switch s3Select.Input.format {
case csvFormat:
rc, err := getReader(0, -1)
if err != nil {
return err
}
s3Select.progressReader, err = newProgressReader(rc, s3Select.Input.CompressionType)
if err != nil {... | go | func (s3Select *S3Select) Open(getReader func(offset, length int64) (io.ReadCloser, error)) error {
switch s3Select.Input.format {
case csvFormat:
rc, err := getReader(0, -1)
if err != nil {
return err
}
s3Select.progressReader, err = newProgressReader(rc, s3Select.Input.CompressionType)
if err != nil {... | [
"func",
"(",
"s3Select",
"*",
"S3Select",
")",
"Open",
"(",
"getReader",
"func",
"(",
"offset",
",",
"length",
"int64",
")",
"(",
"io",
".",
"ReadCloser",
",",
"error",
")",
")",
"error",
"{",
"switch",
"s3Select",
".",
"Input",
".",
"format",
"{",
"... | // Open - opens S3 object by using callback for SQL selection query.
// Currently CSV, JSON and Apache Parquet formats are supported. | [
"Open",
"-",
"opens",
"S3",
"object",
"by",
"using",
"callback",
"for",
"SQL",
"selection",
"query",
".",
"Currently",
"CSV",
"JSON",
"and",
"Apache",
"Parquet",
"formats",
"are",
"supported",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/s3select/select.go#L265-L304 |
125,579 | minio/minio | pkg/s3select/select.go | Evaluate | func (s3Select *S3Select) Evaluate(w http.ResponseWriter) {
getProgressFunc := s3Select.getProgress
if !s3Select.Progress.Enabled {
getProgressFunc = nil
}
writer := newMessageWriter(w, getProgressFunc)
var inputRecord sql.Record
var outputRecord sql.Record
var err error
var data []byte
sendRecord := func()... | go | func (s3Select *S3Select) Evaluate(w http.ResponseWriter) {
getProgressFunc := s3Select.getProgress
if !s3Select.Progress.Enabled {
getProgressFunc = nil
}
writer := newMessageWriter(w, getProgressFunc)
var inputRecord sql.Record
var outputRecord sql.Record
var err error
var data []byte
sendRecord := func()... | [
"func",
"(",
"s3Select",
"*",
"S3Select",
")",
"Evaluate",
"(",
"w",
"http",
".",
"ResponseWriter",
")",
"{",
"getProgressFunc",
":=",
"s3Select",
".",
"getProgress",
"\n",
"if",
"!",
"s3Select",
".",
"Progress",
".",
"Enabled",
"{",
"getProgressFunc",
"=",
... | // Evaluate - filters and sends records read from opened reader as per select statement to http response writer. | [
"Evaluate",
"-",
"filters",
"and",
"sends",
"records",
"read",
"from",
"opened",
"reader",
"as",
"per",
"select",
"statement",
"to",
"http",
"response",
"writer",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/s3select/select.go#L328-L417 |
125,580 | minio/minio | pkg/s3select/select.go | NewS3Select | func NewS3Select(r io.Reader) (*S3Select, error) {
s3Select := &S3Select{}
if err := xml.NewDecoder(r).Decode(s3Select); err != nil {
return nil, err
}
return s3Select, nil
} | go | func NewS3Select(r io.Reader) (*S3Select, error) {
s3Select := &S3Select{}
if err := xml.NewDecoder(r).Decode(s3Select); err != nil {
return nil, err
}
return s3Select, nil
} | [
"func",
"NewS3Select",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"*",
"S3Select",
",",
"error",
")",
"{",
"s3Select",
":=",
"&",
"S3Select",
"{",
"}",
"\n",
"if",
"err",
":=",
"xml",
".",
"NewDecoder",
"(",
"r",
")",
".",
"Decode",
"(",
"s3Select",
... | // NewS3Select - creates new S3Select by given request XML reader. | [
"NewS3Select",
"-",
"creates",
"new",
"S3Select",
"by",
"given",
"request",
"XML",
"reader",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/s3select/select.go#L425-L432 |
125,581 | minio/minio | cmd/gateway-main.go | RegisterGatewayCommand | func RegisterGatewayCommand(cmd cli.Command) error {
cmd.Flags = append(append(cmd.Flags, append(cmd.Flags, serverFlags...)...), globalFlags...)
gatewayCmd.Subcommands = append(gatewayCmd.Subcommands, cmd)
return nil
} | go | func RegisterGatewayCommand(cmd cli.Command) error {
cmd.Flags = append(append(cmd.Flags, append(cmd.Flags, serverFlags...)...), globalFlags...)
gatewayCmd.Subcommands = append(gatewayCmd.Subcommands, cmd)
return nil
} | [
"func",
"RegisterGatewayCommand",
"(",
"cmd",
"cli",
".",
"Command",
")",
"error",
"{",
"cmd",
".",
"Flags",
"=",
"append",
"(",
"append",
"(",
"cmd",
".",
"Flags",
",",
"append",
"(",
"cmd",
".",
"Flags",
",",
"serverFlags",
"...",
")",
"...",
")",
... | // RegisterGatewayCommand registers a new command for gateway. | [
"RegisterGatewayCommand",
"registers",
"a",
"new",
"command",
"for",
"gateway",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway-main.go#L50-L54 |
125,582 | minio/minio | cmd/gateway-main.go | ParseGatewayEndpoint | func ParseGatewayEndpoint(arg string) (endPoint string, secure bool, err error) {
schemeSpecified := len(strings.Split(arg, "://")) > 1
if !schemeSpecified {
// Default connection will be "secure".
arg = "https://" + arg
}
u, err := url.Parse(arg)
if err != nil {
return "", false, err
}
switch u.Scheme {... | go | func ParseGatewayEndpoint(arg string) (endPoint string, secure bool, err error) {
schemeSpecified := len(strings.Split(arg, "://")) > 1
if !schemeSpecified {
// Default connection will be "secure".
arg = "https://" + arg
}
u, err := url.Parse(arg)
if err != nil {
return "", false, err
}
switch u.Scheme {... | [
"func",
"ParseGatewayEndpoint",
"(",
"arg",
"string",
")",
"(",
"endPoint",
"string",
",",
"secure",
"bool",
",",
"err",
"error",
")",
"{",
"schemeSpecified",
":=",
"len",
"(",
"strings",
".",
"Split",
"(",
"arg",
",",
"\"",
"\"",
")",
")",
">",
"1",
... | // ParseGatewayEndpoint - Return endpoint. | [
"ParseGatewayEndpoint",
"-",
"Return",
"endpoint",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway-main.go#L57-L77 |
125,583 | minio/minio | cmd/gateway-main.go | ValidateGatewayArguments | func ValidateGatewayArguments(serverAddr, endpointAddr string) error {
if err := CheckLocalServerAddr(serverAddr); err != nil {
return err
}
if endpointAddr != "" {
// Reject the endpoint if it points to the gateway handler itself.
sameTarget, err := sameLocalAddrs(endpointAddr, serverAddr)
if err != nil {
... | go | func ValidateGatewayArguments(serverAddr, endpointAddr string) error {
if err := CheckLocalServerAddr(serverAddr); err != nil {
return err
}
if endpointAddr != "" {
// Reject the endpoint if it points to the gateway handler itself.
sameTarget, err := sameLocalAddrs(endpointAddr, serverAddr)
if err != nil {
... | [
"func",
"ValidateGatewayArguments",
"(",
"serverAddr",
",",
"endpointAddr",
"string",
")",
"error",
"{",
"if",
"err",
":=",
"CheckLocalServerAddr",
"(",
"serverAddr",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"endpointAddr",
... | // ValidateGatewayArguments - Validate gateway arguments. | [
"ValidateGatewayArguments",
"-",
"Validate",
"gateway",
"arguments",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway-main.go#L80-L96 |
125,584 | minio/minio | cmd/tree-walk-pool.go | NewTreeWalkPool | func NewTreeWalkPool(timeout time.Duration) *TreeWalkPool {
tPool := &TreeWalkPool{
pool: make(map[listParams][]treeWalk),
timeOut: timeout,
lock: &sync.Mutex{},
}
return tPool
} | go | func NewTreeWalkPool(timeout time.Duration) *TreeWalkPool {
tPool := &TreeWalkPool{
pool: make(map[listParams][]treeWalk),
timeOut: timeout,
lock: &sync.Mutex{},
}
return tPool
} | [
"func",
"NewTreeWalkPool",
"(",
"timeout",
"time",
".",
"Duration",
")",
"*",
"TreeWalkPool",
"{",
"tPool",
":=",
"&",
"TreeWalkPool",
"{",
"pool",
":",
"make",
"(",
"map",
"[",
"listParams",
"]",
"[",
"]",
"treeWalk",
")",
",",
"timeOut",
":",
"timeout"... | // NewTreeWalkPool - initialize new tree walk pool. | [
"NewTreeWalkPool",
"-",
"initialize",
"new",
"tree",
"walk",
"pool",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/tree-walk-pool.go#L63-L70 |
125,585 | minio/minio | cmd/tree-walk-pool.go | Release | func (t TreeWalkPool) Release(params listParams) (resultCh chan TreeWalkResult, endWalkCh chan struct{}) {
t.lock.Lock()
defer t.lock.Unlock()
walks, ok := t.pool[params] // Pick the valid walks.
if ok {
if len(walks) > 0 {
// Pop out the first valid walk entry.
walk := walks[0]
walks = walks[1:]
if l... | go | func (t TreeWalkPool) Release(params listParams) (resultCh chan TreeWalkResult, endWalkCh chan struct{}) {
t.lock.Lock()
defer t.lock.Unlock()
walks, ok := t.pool[params] // Pick the valid walks.
if ok {
if len(walks) > 0 {
// Pop out the first valid walk entry.
walk := walks[0]
walks = walks[1:]
if l... | [
"func",
"(",
"t",
"TreeWalkPool",
")",
"Release",
"(",
"params",
"listParams",
")",
"(",
"resultCh",
"chan",
"TreeWalkResult",
",",
"endWalkCh",
"chan",
"struct",
"{",
"}",
")",
"{",
"t",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"... | // Release - selects a treeWalk from the pool based on the input
// listParams, removes it from the pool, and returns the TreeWalkResult
// channel.
// Returns nil if listParams does not have an asccociated treeWalk. | [
"Release",
"-",
"selects",
"a",
"treeWalk",
"from",
"the",
"pool",
"based",
"on",
"the",
"input",
"listParams",
"removes",
"it",
"from",
"the",
"pool",
"and",
"returns",
"the",
"TreeWalkResult",
"channel",
".",
"Returns",
"nil",
"if",
"listParams",
"does",
"... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/tree-walk-pool.go#L76-L96 |
125,586 | minio/minio | cmd/object-handlers-common.go | ifModifiedSince | func ifModifiedSince(objTime time.Time, givenTime time.Time) bool {
// The Date-Modified header truncates sub-second precision, so
// use mtime < t+1s instead of mtime <= t to check for unmodified.
return objTime.After(givenTime.Add(1 * time.Second))
} | go | func ifModifiedSince(objTime time.Time, givenTime time.Time) bool {
// The Date-Modified header truncates sub-second precision, so
// use mtime < t+1s instead of mtime <= t to check for unmodified.
return objTime.After(givenTime.Add(1 * time.Second))
} | [
"func",
"ifModifiedSince",
"(",
"objTime",
"time",
".",
"Time",
",",
"givenTime",
"time",
".",
"Time",
")",
"bool",
"{",
"// The Date-Modified header truncates sub-second precision, so",
"// use mtime < t+1s instead of mtime <= t to check for unmodified.",
"return",
"objTime",
... | // returns true if object was modified after givenTime. | [
"returns",
"true",
"if",
"object",
"was",
"modified",
"after",
"givenTime",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/object-handlers-common.go#L228-L232 |
125,587 | minio/minio | cmd/object-handlers-common.go | deleteObject | func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer, bucket, object string, r *http.Request) (err error) {
deleteObject := obj.DeleteObject
if cache != nil {
deleteObject = cache.DeleteObject
}
// Proceed to delete the object.
if err = deleteObject(ctx, bucket, object); err != nil {
... | go | func deleteObject(ctx context.Context, obj ObjectLayer, cache CacheObjectLayer, bucket, object string, r *http.Request) (err error) {
deleteObject := obj.DeleteObject
if cache != nil {
deleteObject = cache.DeleteObject
}
// Proceed to delete the object.
if err = deleteObject(ctx, bucket, object); err != nil {
... | [
"func",
"deleteObject",
"(",
"ctx",
"context",
".",
"Context",
",",
"obj",
"ObjectLayer",
",",
"cache",
"CacheObjectLayer",
",",
"bucket",
",",
"object",
"string",
",",
"r",
"*",
"http",
".",
"Request",
")",
"(",
"err",
"error",
")",
"{",
"deleteObject",
... | // deleteObject is a convenient wrapper to delete an object, this
// is a common function to be called from object handlers and
// web handlers. | [
"deleteObject",
"is",
"a",
"convenient",
"wrapper",
"to",
"delete",
"an",
"object",
"this",
"is",
"a",
"common",
"function",
"to",
"be",
"called",
"from",
"object",
"handlers",
"and",
"web",
"handlers",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/object-handlers-common.go#L249-L272 |
125,588 | minio/minio | cmd/signature-v4.go | getCanonicalHeaders | func getCanonicalHeaders(signedHeaders http.Header) string {
var headers []string
vals := make(http.Header)
for k, vv := range signedHeaders {
headers = append(headers, strings.ToLower(k))
vals[strings.ToLower(k)] = vv
}
sort.Strings(headers)
var buf bytes.Buffer
for _, k := range headers {
buf.WriteStrin... | go | func getCanonicalHeaders(signedHeaders http.Header) string {
var headers []string
vals := make(http.Header)
for k, vv := range signedHeaders {
headers = append(headers, strings.ToLower(k))
vals[strings.ToLower(k)] = vv
}
sort.Strings(headers)
var buf bytes.Buffer
for _, k := range headers {
buf.WriteStrin... | [
"func",
"getCanonicalHeaders",
"(",
"signedHeaders",
"http",
".",
"Header",
")",
"string",
"{",
"var",
"headers",
"[",
"]",
"string",
"\n",
"vals",
":=",
"make",
"(",
"http",
".",
"Header",
")",
"\n",
"for",
"k",
",",
"vv",
":=",
"range",
"signedHeaders"... | // getCanonicalHeaders generate a list of request headers with their values | [
"getCanonicalHeaders",
"generate",
"a",
"list",
"of",
"request",
"headers",
"with",
"their",
"values"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4.go#L57-L79 |
125,589 | minio/minio | cmd/signature-v4.go | getSignedHeaders | func getSignedHeaders(signedHeaders http.Header) string {
var headers []string
for k := range signedHeaders {
headers = append(headers, strings.ToLower(k))
}
sort.Strings(headers)
return strings.Join(headers, ";")
} | go | func getSignedHeaders(signedHeaders http.Header) string {
var headers []string
for k := range signedHeaders {
headers = append(headers, strings.ToLower(k))
}
sort.Strings(headers)
return strings.Join(headers, ";")
} | [
"func",
"getSignedHeaders",
"(",
"signedHeaders",
"http",
".",
"Header",
")",
"string",
"{",
"var",
"headers",
"[",
"]",
"string",
"\n",
"for",
"k",
":=",
"range",
"signedHeaders",
"{",
"headers",
"=",
"append",
"(",
"headers",
",",
"strings",
".",
"ToLowe... | // getSignedHeaders generate a string i.e alphabetically sorted, semicolon-separated list of lowercase request header names | [
"getSignedHeaders",
"generate",
"a",
"string",
"i",
".",
"e",
"alphabetically",
"sorted",
"semicolon",
"-",
"separated",
"list",
"of",
"lowercase",
"request",
"header",
"names"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4.go#L82-L89 |
125,590 | minio/minio | cmd/signature-v4.go | getSignature | func getSignature(signingKey []byte, stringToSign string) string {
return hex.EncodeToString(sumHMAC(signingKey, []byte(stringToSign)))
} | go | func getSignature(signingKey []byte, stringToSign string) string {
return hex.EncodeToString(sumHMAC(signingKey, []byte(stringToSign)))
} | [
"func",
"getSignature",
"(",
"signingKey",
"[",
"]",
"byte",
",",
"stringToSign",
"string",
")",
"string",
"{",
"return",
"hex",
".",
"EncodeToString",
"(",
"sumHMAC",
"(",
"signingKey",
",",
"[",
"]",
"byte",
"(",
"stringToSign",
")",
")",
")",
"\n",
"}... | // getSignature final signature in hexadecimal form. | [
"getSignature",
"final",
"signature",
"in",
"hexadecimal",
"form",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4.go#L145-L147 |
125,591 | minio/minio | cmd/signature-v4.go | doesPolicySignatureMatch | func doesPolicySignatureMatch(formValues http.Header) APIErrorCode {
// For SignV2 - Signature field will be valid
if _, ok := formValues["Signature"]; ok {
return doesPolicySignatureV2Match(formValues)
}
return doesPolicySignatureV4Match(formValues)
} | go | func doesPolicySignatureMatch(formValues http.Header) APIErrorCode {
// For SignV2 - Signature field will be valid
if _, ok := formValues["Signature"]; ok {
return doesPolicySignatureV2Match(formValues)
}
return doesPolicySignatureV4Match(formValues)
} | [
"func",
"doesPolicySignatureMatch",
"(",
"formValues",
"http",
".",
"Header",
")",
"APIErrorCode",
"{",
"// For SignV2 - Signature field will be valid",
"if",
"_",
",",
"ok",
":=",
"formValues",
"[",
"\"",
"\"",
"]",
";",
"ok",
"{",
"return",
"doesPolicySignatureV2M... | // Check to see if Policy is signed correctly. | [
"Check",
"to",
"see",
"if",
"Policy",
"is",
"signed",
"correctly",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4.go#L150-L156 |
125,592 | minio/minio | cmd/signature-v4.go | compareSignatureV4 | func compareSignatureV4(sig1, sig2 string) bool {
// The CTC using []byte(str) works because the hex encoding
// is unique for a sequence of bytes. See also compareSignatureV2.
return subtle.ConstantTimeCompare([]byte(sig1), []byte(sig2)) == 1
} | go | func compareSignatureV4(sig1, sig2 string) bool {
// The CTC using []byte(str) works because the hex encoding
// is unique for a sequence of bytes. See also compareSignatureV2.
return subtle.ConstantTimeCompare([]byte(sig1), []byte(sig2)) == 1
} | [
"func",
"compareSignatureV4",
"(",
"sig1",
",",
"sig2",
"string",
")",
"bool",
"{",
"// The CTC using []byte(str) works because the hex encoding",
"// is unique for a sequence of bytes. See also compareSignatureV2.",
"return",
"subtle",
".",
"ConstantTimeCompare",
"(",
"[",
"]",
... | // compareSignatureV4 returns true if and only if both signatures
// are equal. The signatures are expected to be HEX encoded strings
// according to the AWS S3 signature V4 spec. | [
"compareSignatureV4",
"returns",
"true",
"if",
"and",
"only",
"if",
"both",
"signatures",
"are",
"equal",
".",
"The",
"signatures",
"are",
"expected",
"to",
"be",
"HEX",
"encoded",
"strings",
"according",
"to",
"the",
"AWS",
"S3",
"signature",
"V4",
"spec",
... | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4.go#L161-L165 |
125,593 | minio/minio | cmd/api-headers.go | setCommonHeaders | func setCommonHeaders(w http.ResponseWriter) {
w.Header().Set("Server", "MinIO/"+ReleaseTag)
// Set `x-amz-bucket-region` only if region is set on the server
// by default minio uses an empty region.
if region := globalServerConfig.GetRegion(); region != "" {
w.Header().Set("X-Amz-Bucket-Region", region)
}
w.He... | go | func setCommonHeaders(w http.ResponseWriter) {
w.Header().Set("Server", "MinIO/"+ReleaseTag)
// Set `x-amz-bucket-region` only if region is set on the server
// by default minio uses an empty region.
if region := globalServerConfig.GetRegion(); region != "" {
w.Header().Set("X-Amz-Bucket-Region", region)
}
w.He... | [
"func",
"setCommonHeaders",
"(",
"w",
"http",
".",
"ResponseWriter",
")",
"{",
"w",
".",
"Header",
"(",
")",
".",
"Set",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"ReleaseTag",
")",
"\n",
"// Set `x-amz-bucket-region` only if region is set on the server",
"// by de... | // Write http common headers | [
"Write",
"http",
"common",
"headers"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-headers.go#L38-L49 |
125,594 | minio/minio | cmd/api-headers.go | encodeResponse | func encodeResponse(response interface{}) []byte {
var bytesBuffer bytes.Buffer
bytesBuffer.WriteString(xml.Header)
e := xml.NewEncoder(&bytesBuffer)
e.Encode(response)
return bytesBuffer.Bytes()
} | go | func encodeResponse(response interface{}) []byte {
var bytesBuffer bytes.Buffer
bytesBuffer.WriteString(xml.Header)
e := xml.NewEncoder(&bytesBuffer)
e.Encode(response)
return bytesBuffer.Bytes()
} | [
"func",
"encodeResponse",
"(",
"response",
"interface",
"{",
"}",
")",
"[",
"]",
"byte",
"{",
"var",
"bytesBuffer",
"bytes",
".",
"Buffer",
"\n",
"bytesBuffer",
".",
"WriteString",
"(",
"xml",
".",
"Header",
")",
"\n",
"e",
":=",
"xml",
".",
"NewEncoder"... | // Encodes the response headers into XML format. | [
"Encodes",
"the",
"response",
"headers",
"into",
"XML",
"format",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-headers.go#L52-L58 |
125,595 | minio/minio | cmd/api-headers.go | encodeResponseJSON | func encodeResponseJSON(response interface{}) []byte {
var bytesBuffer bytes.Buffer
e := json.NewEncoder(&bytesBuffer)
e.Encode(response)
return bytesBuffer.Bytes()
} | go | func encodeResponseJSON(response interface{}) []byte {
var bytesBuffer bytes.Buffer
e := json.NewEncoder(&bytesBuffer)
e.Encode(response)
return bytesBuffer.Bytes()
} | [
"func",
"encodeResponseJSON",
"(",
"response",
"interface",
"{",
"}",
")",
"[",
"]",
"byte",
"{",
"var",
"bytesBuffer",
"bytes",
".",
"Buffer",
"\n",
"e",
":=",
"json",
".",
"NewEncoder",
"(",
"&",
"bytesBuffer",
")",
"\n",
"e",
".",
"Encode",
"(",
"re... | // Encodes the response headers into JSON format. | [
"Encodes",
"the",
"response",
"headers",
"into",
"JSON",
"format",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-headers.go#L61-L66 |
125,596 | minio/minio | cmd/api-headers.go | setObjectHeaders | func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSpec) (err error) {
// set common headers
setCommonHeaders(w)
// Set last modified time.
lastModified := objInfo.ModTime.UTC().Format(http.TimeFormat)
w.Header().Set("Last-Modified", lastModified)
// Set Etag if available.
if objInfo... | go | func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSpec) (err error) {
// set common headers
setCommonHeaders(w)
// Set last modified time.
lastModified := objInfo.ModTime.UTC().Format(http.TimeFormat)
w.Header().Set("Last-Modified", lastModified)
// Set Etag if available.
if objInfo... | [
"func",
"setObjectHeaders",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"objInfo",
"ObjectInfo",
",",
"rs",
"*",
"HTTPRangeSpec",
")",
"(",
"err",
"error",
")",
"{",
"// set common headers",
"setCommonHeaders",
"(",
"w",
")",
"\n\n",
"// Set last modified time."... | // Write object header | [
"Write",
"object",
"header"
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-headers.go#L69-L134 |
125,597 | minio/minio | pkg/trie/trie.go | newNode | func newNode() *Node {
return &Node{
exists: false,
value: nil,
child: make(map[rune]*Node),
}
} | go | func newNode() *Node {
return &Node{
exists: false,
value: nil,
child: make(map[rune]*Node),
}
} | [
"func",
"newNode",
"(",
")",
"*",
"Node",
"{",
"return",
"&",
"Node",
"{",
"exists",
":",
"false",
",",
"value",
":",
"nil",
",",
"child",
":",
"make",
"(",
"map",
"[",
"rune",
"]",
"*",
"Node",
")",
",",
"}",
"\n",
"}"
] | // newNode create a new trie node. | [
"newNode",
"create",
"a",
"new",
"trie",
"node",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/trie/trie.go#L29-L35 |
125,598 | minio/minio | pkg/trie/trie.go | Insert | func (t *Trie) Insert(key string) {
curNode := t.root
for _, v := range key {
if curNode.child[v] == nil {
curNode.child[v] = newNode()
}
curNode = curNode.child[v]
}
if !curNode.exists {
// increment when new rune child is added.
t.size++
curNode.exists = true
}
// value is stored for retrieval i... | go | func (t *Trie) Insert(key string) {
curNode := t.root
for _, v := range key {
if curNode.child[v] == nil {
curNode.child[v] = newNode()
}
curNode = curNode.child[v]
}
if !curNode.exists {
// increment when new rune child is added.
t.size++
curNode.exists = true
}
// value is stored for retrieval i... | [
"func",
"(",
"t",
"*",
"Trie",
")",
"Insert",
"(",
"key",
"string",
")",
"{",
"curNode",
":=",
"t",
".",
"root",
"\n",
"for",
"_",
",",
"v",
":=",
"range",
"key",
"{",
"if",
"curNode",
".",
"child",
"[",
"v",
"]",
"==",
"nil",
"{",
"curNode",
... | // Insert insert a key. | [
"Insert",
"insert",
"a",
"key",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/trie/trie.go#L49-L65 |
125,599 | minio/minio | pkg/trie/trie.go | PrefixMatch | func (t *Trie) PrefixMatch(key string) []interface{} {
node, _ := t.findNode(key)
if node != nil {
return t.Walk(node)
}
return []interface{}{}
} | go | func (t *Trie) PrefixMatch(key string) []interface{} {
node, _ := t.findNode(key)
if node != nil {
return t.Walk(node)
}
return []interface{}{}
} | [
"func",
"(",
"t",
"*",
"Trie",
")",
"PrefixMatch",
"(",
"key",
"string",
")",
"[",
"]",
"interface",
"{",
"}",
"{",
"node",
",",
"_",
":=",
"t",
".",
"findNode",
"(",
"key",
")",
"\n",
"if",
"node",
"!=",
"nil",
"{",
"return",
"t",
".",
"Walk",... | // PrefixMatch - prefix match. | [
"PrefixMatch",
"-",
"prefix",
"match",
"."
] | 4b858b562a0887e10bfd0414dc87e68f1af31c3a | https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/trie/trie.go#L68-L74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.