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,600
minio/minio
pkg/trie/trie.go
Walk
func (t *Trie) Walk(node *Node) (ret []interface{}) { if node.exists { ret = append(ret, node.value) } for _, v := range node.child { ret = append(ret, t.Walk(v)...) } return }
go
func (t *Trie) Walk(node *Node) (ret []interface{}) { if node.exists { ret = append(ret, node.value) } for _, v := range node.child { ret = append(ret, t.Walk(v)...) } return }
[ "func", "(", "t", "*", "Trie", ")", "Walk", "(", "node", "*", "Node", ")", "(", "ret", "[", "]", "interface", "{", "}", ")", "{", "if", "node", ".", "exists", "{", "ret", "=", "append", "(", "ret", ",", "node", ".", "value", ")", "\n", "}", ...
// Walk the tree.
[ "Walk", "the", "tree", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/trie/trie.go#L77-L85
125,601
minio/minio
pkg/trie/trie.go
findNode
func (t *Trie) findNode(key string) (node *Node, index int) { curNode := t.root f := false for k, v := range key { if f { index = k f = false } if curNode.child[v] == nil { return nil, index } curNode = curNode.child[v] if curNode.exists { f = true } } if curNode.exists { index = len(k...
go
func (t *Trie) findNode(key string) (node *Node, index int) { curNode := t.root f := false for k, v := range key { if f { index = k f = false } if curNode.child[v] == nil { return nil, index } curNode = curNode.child[v] if curNode.exists { f = true } } if curNode.exists { index = len(k...
[ "func", "(", "t", "*", "Trie", ")", "findNode", "(", "key", "string", ")", "(", "node", "*", "Node", ",", "index", "int", ")", "{", "curNode", ":=", "t", ".", "root", "\n", "f", ":=", "false", "\n", "for", "k", ",", "v", ":=", "range", "key", ...
// find nodes corresponding to key.
[ "find", "nodes", "corresponding", "to", "key", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/trie/trie.go#L88-L110
125,602
minio/minio
pkg/lock/lock.go
IsClosed
func (r *RLockedFile) IsClosed() bool { r.mutex.Lock() defer r.mutex.Unlock() return r.refs == 0 }
go
func (r *RLockedFile) IsClosed() bool { r.mutex.Lock() defer r.mutex.Unlock() return r.refs == 0 }
[ "func", "(", "r", "*", "RLockedFile", ")", "IsClosed", "(", ")", "bool", "{", "r", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "mutex", ".", "Unlock", "(", ")", "\n", "return", "r", ".", "refs", "==", "0", "\n", "}" ]
// IsClosed - Check if the rlocked file is already closed.
[ "IsClosed", "-", "Check", "if", "the", "rlocked", "file", "is", "already", "closed", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/lock/lock.go#L42-L46
125,603
minio/minio
pkg/lock/lock.go
IncLockRef
func (r *RLockedFile) IncLockRef() { r.mutex.Lock() r.refs++ r.mutex.Unlock() }
go
func (r *RLockedFile) IncLockRef() { r.mutex.Lock() r.refs++ r.mutex.Unlock() }
[ "func", "(", "r", "*", "RLockedFile", ")", "IncLockRef", "(", ")", "{", "r", ".", "mutex", ".", "Lock", "(", ")", "\n", "r", ".", "refs", "++", "\n", "r", ".", "mutex", ".", "Unlock", "(", ")", "\n", "}" ]
// IncLockRef - is used by called to indicate lock refs.
[ "IncLockRef", "-", "is", "used", "by", "called", "to", "indicate", "lock", "refs", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/lock/lock.go#L49-L53
125,604
minio/minio
pkg/lock/lock.go
Close
func (r *RLockedFile) Close() (err error) { r.mutex.Lock() defer r.mutex.Unlock() if r.refs == 0 { return os.ErrInvalid } r.refs-- if r.refs == 0 { err = r.File.Close() } return err }
go
func (r *RLockedFile) Close() (err error) { r.mutex.Lock() defer r.mutex.Unlock() if r.refs == 0 { return os.ErrInvalid } r.refs-- if r.refs == 0 { err = r.File.Close() } return err }
[ "func", "(", "r", "*", "RLockedFile", ")", "Close", "(", ")", "(", "err", "error", ")", "{", "r", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "r", ".", "mutex", ".", "Unlock", "(", ")", "\n\n", "if", "r", ".", "refs", "==", "0", "{", ...
// Close - this closer implements a special closer // closes the underlying fd only when the refs // reach zero.
[ "Close", "-", "this", "closer", "implements", "a", "special", "closer", "closes", "the", "underlying", "fd", "only", "when", "the", "refs", "reach", "zero", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/lock/lock.go#L58-L72
125,605
minio/minio
pkg/lock/lock.go
RLockedOpenFile
func RLockedOpenFile(path string) (*RLockedFile, error) { lkFile, err := LockedOpenFile(path, os.O_RDONLY, 0666) if err != nil { return nil, err } return newRLockedFile(lkFile) }
go
func RLockedOpenFile(path string) (*RLockedFile, error) { lkFile, err := LockedOpenFile(path, os.O_RDONLY, 0666) if err != nil { return nil, err } return newRLockedFile(lkFile) }
[ "func", "RLockedOpenFile", "(", "path", "string", ")", "(", "*", "RLockedFile", ",", "error", ")", "{", "lkFile", ",", "err", ":=", "LockedOpenFile", "(", "path", ",", "os", ".", "O_RDONLY", ",", "0666", ")", "\n", "if", "err", "!=", "nil", "{", "ret...
// RLockedOpenFile - returns a wrapped read locked file, if the file // doesn't exist at path returns an error.
[ "RLockedOpenFile", "-", "returns", "a", "wrapped", "read", "locked", "file", "if", "the", "file", "doesn", "t", "exist", "at", "path", "returns", "an", "error", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/lock/lock.go#L88-L96
125,606
minio/minio
cmd/api-resources.go
getListObjectsV1Args
func getListObjectsV1Args(values url.Values) (prefix, marker, delimiter string, maxkeys int, encodingType string, errCode APIErrorCode) { errCode = ErrNone if values.Get("max-keys") != "" { var err error if maxkeys, err = strconv.Atoi(values.Get("max-keys")); err != nil { errCode = ErrInvalidMaxKeys return...
go
func getListObjectsV1Args(values url.Values) (prefix, marker, delimiter string, maxkeys int, encodingType string, errCode APIErrorCode) { errCode = ErrNone if values.Get("max-keys") != "" { var err error if maxkeys, err = strconv.Atoi(values.Get("max-keys")); err != nil { errCode = ErrInvalidMaxKeys return...
[ "func", "getListObjectsV1Args", "(", "values", "url", ".", "Values", ")", "(", "prefix", ",", "marker", ",", "delimiter", "string", ",", "maxkeys", "int", ",", "encodingType", "string", ",", "errCode", "APIErrorCode", ")", "{", "errCode", "=", "ErrNone", "\n...
// Parse bucket url queries
[ "Parse", "bucket", "url", "queries" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-resources.go#L25-L43
125,607
minio/minio
cmd/api-resources.go
getListObjectsV2Args
func getListObjectsV2Args(values url.Values) (prefix, token, startAfter, delimiter string, fetchOwner bool, maxkeys int, encodingType string, errCode APIErrorCode) { errCode = ErrNone // The continuation-token cannot be empty. if val, ok := values["continuation-token"]; ok { if len(val[0]) == 0 { errCode = Err...
go
func getListObjectsV2Args(values url.Values) (prefix, token, startAfter, delimiter string, fetchOwner bool, maxkeys int, encodingType string, errCode APIErrorCode) { errCode = ErrNone // The continuation-token cannot be empty. if val, ok := values["continuation-token"]; ok { if len(val[0]) == 0 { errCode = Err...
[ "func", "getListObjectsV2Args", "(", "values", "url", ".", "Values", ")", "(", "prefix", ",", "token", ",", "startAfter", ",", "delimiter", "string", ",", "fetchOwner", "bool", ",", "maxkeys", "int", ",", "encodingType", "string", ",", "errCode", "APIErrorCode...
// Parse bucket url queries for ListObjects V2.
[ "Parse", "bucket", "url", "queries", "for", "ListObjects", "V2", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-resources.go#L46-L74
125,608
minio/minio
cmd/api-resources.go
getBucketMultipartResources
func getBucketMultipartResources(values url.Values) (prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int, encodingType string, errCode APIErrorCode) { errCode = ErrNone if values.Get("max-uploads") != "" { var err error if maxUploads, err = strconv.Atoi(values.Get("max-uploads")); err != nil { ...
go
func getBucketMultipartResources(values url.Values) (prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int, encodingType string, errCode APIErrorCode) { errCode = ErrNone if values.Get("max-uploads") != "" { var err error if maxUploads, err = strconv.Atoi(values.Get("max-uploads")); err != nil { ...
[ "func", "getBucketMultipartResources", "(", "values", "url", ".", "Values", ")", "(", "prefix", ",", "keyMarker", ",", "uploadIDMarker", ",", "delimiter", "string", ",", "maxUploads", "int", ",", "encodingType", "string", ",", "errCode", "APIErrorCode", ")", "{"...
// Parse bucket url queries for ?uploads
[ "Parse", "bucket", "url", "queries", "for", "?uploads" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-resources.go#L77-L96
125,609
minio/minio
cmd/api-resources.go
getObjectResources
func getObjectResources(values url.Values) (uploadID string, partNumberMarker, maxParts int, encodingType string, errCode APIErrorCode) { var err error errCode = ErrNone if values.Get("max-parts") != "" { if maxParts, err = strconv.Atoi(values.Get("max-parts")); err != nil { errCode = ErrInvalidMaxParts ret...
go
func getObjectResources(values url.Values) (uploadID string, partNumberMarker, maxParts int, encodingType string, errCode APIErrorCode) { var err error errCode = ErrNone if values.Get("max-parts") != "" { if maxParts, err = strconv.Atoi(values.Get("max-parts")); err != nil { errCode = ErrInvalidMaxParts ret...
[ "func", "getObjectResources", "(", "values", "url", ".", "Values", ")", "(", "uploadID", "string", ",", "partNumberMarker", ",", "maxParts", "int", ",", "encodingType", "string", ",", "errCode", "APIErrorCode", ")", "{", "var", "err", "error", "\n", "errCode",...
// Parse object url queries
[ "Parse", "object", "url", "queries" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/api-resources.go#L99-L122
125,610
minio/minio
cmd/http/close.go
DrainBody
func DrainBody(respBody io.ReadCloser) { // Callers should close resp.Body when done reading from it. // If resp.Body is not closed, the Client's underlying RoundTripper // (typically Transport) may not be able to re-use a persistent TCP // connection to the server for a subsequent "keep-alive" request. if respBod...
go
func DrainBody(respBody io.ReadCloser) { // Callers should close resp.Body when done reading from it. // If resp.Body is not closed, the Client's underlying RoundTripper // (typically Transport) may not be able to re-use a persistent TCP // connection to the server for a subsequent "keep-alive" request. if respBod...
[ "func", "DrainBody", "(", "respBody", "io", ".", "ReadCloser", ")", "{", "// Callers should close resp.Body when done reading from it.", "// If resp.Body is not closed, the Client's underlying RoundTripper", "// (typically Transport) may not be able to re-use a persistent TCP", "// connectio...
// DrainBody close non nil response with any response Body. // convenient wrapper to drain any remaining data on response body. // // Subsequently this allows golang http RoundTripper // to re-use the same connection for future requests.
[ "DrainBody", "close", "non", "nil", "response", "with", "any", "response", "Body", ".", "convenient", "wrapper", "to", "drain", "any", "remaining", "data", "on", "response", "body", ".", "Subsequently", "this", "allows", "golang", "http", "RoundTripper", "to", ...
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/http/close.go#L29-L42
125,611
minio/minio
pkg/event/target/redis.go
Validate
func (r RedisArgs) Validate() error { if !r.Enable { return nil } if r.Format != "" { f := strings.ToLower(r.Format) if f != event.NamespaceFormat && f != event.AccessFormat { return fmt.Errorf("unrecognized format") } } if r.Key == "" { return fmt.Errorf("empty key") } return nil }
go
func (r RedisArgs) Validate() error { if !r.Enable { return nil } if r.Format != "" { f := strings.ToLower(r.Format) if f != event.NamespaceFormat && f != event.AccessFormat { return fmt.Errorf("unrecognized format") } } if r.Key == "" { return fmt.Errorf("empty key") } return nil }
[ "func", "(", "r", "RedisArgs", ")", "Validate", "(", ")", "error", "{", "if", "!", "r", ".", "Enable", "{", "return", "nil", "\n", "}", "\n\n", "if", "r", ".", "Format", "!=", "\"", "\"", "{", "f", ":=", "strings", ".", "ToLower", "(", "r", "."...
// Validate RedisArgs fields
[ "Validate", "RedisArgs", "fields" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/target/redis.go#L41-L58
125,612
minio/minio
pkg/event/target/redis.go
NewRedisTarget
func NewRedisTarget(id string, args RedisArgs) (*RedisTarget, error) { pool := &redis.Pool{ MaxIdle: 3, IdleTimeout: 2 * 60 * time.Second, Dial: func() (redis.Conn, error) { conn, err := redis.Dial("tcp", args.Addr.String()) if err != nil { return nil, err } if args.Password == "" { retu...
go
func NewRedisTarget(id string, args RedisArgs) (*RedisTarget, error) { pool := &redis.Pool{ MaxIdle: 3, IdleTimeout: 2 * 60 * time.Second, Dial: func() (redis.Conn, error) { conn, err := redis.Dial("tcp", args.Addr.String()) if err != nil { return nil, err } if args.Password == "" { retu...
[ "func", "NewRedisTarget", "(", "id", "string", ",", "args", "RedisArgs", ")", "(", "*", "RedisTarget", ",", "error", ")", "{", "pool", ":=", "&", "redis", ".", "Pool", "{", "MaxIdle", ":", "3", ",", "IdleTimeout", ":", "2", "*", "60", "*", "time", ...
// NewRedisTarget - creates new Redis target.
[ "NewRedisTarget", "-", "creates", "new", "Redis", "target", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/target/redis.go#L127-L186
125,613
minio/minio
cmd/web-handlers.go
ServerInfo
func (web *webAPIHandlers) ServerInfo(r *http.Request, args *WebGenericArgs, reply *ServerInfoRep) error { _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } host, err := os.Hostname() if err != nil { host = "" } memstats := &runtime.MemStats{} runtime.ReadMemSt...
go
func (web *webAPIHandlers) ServerInfo(r *http.Request, args *WebGenericArgs, reply *ServerInfoRep) error { _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } host, err := os.Hostname() if err != nil { host = "" } memstats := &runtime.MemStats{} runtime.ReadMemSt...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "ServerInfo", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "WebGenericArgs", ",", "reply", "*", "ServerInfoRep", ")", "error", "{", "_", ",", "owner", ",", "authErr", ":=", "webRequestAuthenticate...
// ServerInfo - get server info.
[ "ServerInfo", "-", "get", "server", "info", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L76-L116
125,614
minio/minio
cmd/web-handlers.go
StorageInfo
func (web *webAPIHandlers) StorageInfo(r *http.Request, args *WebGenericArgs, reply *StorageInfoRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } _, _, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } reply.Stor...
go
func (web *webAPIHandlers) StorageInfo(r *http.Request, args *WebGenericArgs, reply *StorageInfoRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } _, _, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } reply.Stor...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "StorageInfo", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "WebGenericArgs", ",", "reply", "*", "StorageInfoRep", ")", "error", "{", "objectAPI", ":=", "web", ".", "ObjectAPI", "(", ")", "\n", ...
// StorageInfo - web call to gather storage usage statistics.
[ "StorageInfo", "-", "web", "call", "to", "gather", "storage", "usage", "statistics", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L125-L137
125,615
minio/minio
cmd/web-handlers.go
MakeBucket
func (web *webAPIHandlers) MakeBucket(r *http.Request, args *MakeBucketArgs, reply *WebGenericRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } //...
go
func (web *webAPIHandlers) MakeBucket(r *http.Request, args *MakeBucketArgs, reply *WebGenericRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } //...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "MakeBucket", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "MakeBucketArgs", ",", "reply", "*", "WebGenericRep", ")", "error", "{", "objectAPI", ":=", "web", ".", "ObjectAPI", "(", ")", "\n", ...
// MakeBucket - creates a new bucket.
[ "MakeBucket", "-", "creates", "a", "new", "bucket", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L145-L197
125,616
minio/minio
cmd/web-handlers.go
DeleteBucket
func (web *webAPIHandlers) DeleteBucket(r *http.Request, args *RemoveBucketArgs, reply *WebGenericRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } ...
go
func (web *webAPIHandlers) DeleteBucket(r *http.Request, args *RemoveBucketArgs, reply *WebGenericRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } ...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "DeleteBucket", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "RemoveBucketArgs", ",", "reply", "*", "WebGenericRep", ")", "error", "{", "objectAPI", ":=", "web", ".", "ObjectAPI", "(", ")", "\n"...
// DeleteBucket - removes a bucket, must be empty.
[ "DeleteBucket", "-", "removes", "a", "bucket", "must", "be", "empty", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L205-L277
125,617
minio/minio
cmd/web-handlers.go
ListBuckets
func (web *webAPIHandlers) ListBuckets(r *http.Request, args *WebGenericArgs, reply *ListBucketsRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } listBuckets := objectAPI.ListBuckets if web.CacheAPI() != nil { listBuckets = web.CacheAPI().ListBuckets ...
go
func (web *webAPIHandlers) ListBuckets(r *http.Request, args *WebGenericArgs, reply *ListBucketsRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } listBuckets := objectAPI.ListBuckets if web.CacheAPI() != nil { listBuckets = web.CacheAPI().ListBuckets ...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "ListBuckets", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "WebGenericArgs", ",", "reply", "*", "ListBucketsRep", ")", "error", "{", "objectAPI", ":=", "web", ".", "ObjectAPI", "(", ")", "\n", ...
// ListBuckets - list buckets api.
[ "ListBuckets", "-", "list", "buckets", "api", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L294-L367
125,618
minio/minio
cmd/web-handlers.go
Login
func (web *webAPIHandlers) Login(r *http.Request, args *LoginArgs, reply *LoginRep) error { token, err := authenticateWeb(args.Username, args.Password) if err != nil { return toJSONError(err) } reply.Token = token reply.UIVersion = browser.UIVersion return nil }
go
func (web *webAPIHandlers) Login(r *http.Request, args *LoginArgs, reply *LoginRep) error { token, err := authenticateWeb(args.Username, args.Password) if err != nil { return toJSONError(err) } reply.Token = token reply.UIVersion = browser.UIVersion return nil }
[ "func", "(", "web", "*", "webAPIHandlers", ")", "Login", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "LoginArgs", ",", "reply", "*", "LoginRep", ")", "error", "{", "token", ",", "err", ":=", "authenticateWeb", "(", "args", ".", "Username",...
// Login - user login handler.
[ "Login", "-", "user", "login", "handler", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L733-L742
125,619
minio/minio
cmd/web-handlers.go
SetAuth
func (web *webAPIHandlers) SetAuth(r *http.Request, args *SetAuthArgs, reply *SetAuthReply) error { _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } // If creds are set through ENV disallow changing credentials. if globalIsEnvCreds || globalWORMEnabled || !owner |...
go
func (web *webAPIHandlers) SetAuth(r *http.Request, args *SetAuthArgs, reply *SetAuthReply) error { _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } // If creds are set through ENV disallow changing credentials. if globalIsEnvCreds || globalWORMEnabled || !owner |...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "SetAuth", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "SetAuthArgs", ",", "reply", "*", "SetAuthReply", ")", "error", "{", "_", ",", "owner", ",", "authErr", ":=", "webRequestAuthenticate", "(...
// SetAuth - Set accessKey and secretKey credentials.
[ "SetAuth", "-", "Set", "accessKey", "and", "secretKey", "credentials", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L783-L821
125,620
minio/minio
cmd/web-handlers.go
GetAuth
func (web *webAPIHandlers) GetAuth(r *http.Request, args *WebGenericArgs, reply *GetAuthReply) error { _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } if !owner { return toJSONError(errAccessDenied) } creds := globalServerConfig.GetCredential() reply.AccessKey...
go
func (web *webAPIHandlers) GetAuth(r *http.Request, args *WebGenericArgs, reply *GetAuthReply) error { _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } if !owner { return toJSONError(errAccessDenied) } creds := globalServerConfig.GetCredential() reply.AccessKey...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "GetAuth", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "WebGenericArgs", ",", "reply", "*", "GetAuthReply", ")", "error", "{", "_", ",", "owner", ",", "authErr", ":=", "webRequestAuthenticate", ...
// GetAuth - return accessKey and secretKey credentials.
[ "GetAuth", "-", "return", "accessKey", "and", "secretKey", "credentials", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L831-L844
125,621
minio/minio
cmd/web-handlers.go
GetBucketPolicy
func (web *webAPIHandlers) GetBucketPolicy(r *http.Request, args *GetBucketPolicyArgs, reply *GetBucketPolicyRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(...
go
func (web *webAPIHandlers) GetBucketPolicy(r *http.Request, args *GetBucketPolicyArgs, reply *GetBucketPolicyRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "GetBucketPolicy", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "GetBucketPolicyArgs", ",", "reply", "*", "GetBucketPolicyRep", ")", "error", "{", "objectAPI", ":=", "web", ".", "ObjectAPI", "(", ...
// GetBucketPolicy - get bucket policy for the requested prefix.
[ "GetBucketPolicy", "-", "get", "bucket", "policy", "for", "the", "requested", "prefix", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1435-L1509
125,622
minio/minio
cmd/web-handlers.go
ListAllBucketPolicies
func (web *webAPIHandlers) ListAllBucketPolicies(r *http.Request, args *ListAllBucketPoliciesArgs, reply *ListAllBucketPoliciesRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return...
go
func (web *webAPIHandlers) ListAllBucketPolicies(r *http.Request, args *ListAllBucketPoliciesArgs, reply *ListAllBucketPoliciesRep) error { objectAPI := web.ObjectAPI() if objectAPI == nil { return toJSONError(errServerNotInitialized) } _, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "ListAllBucketPolicies", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "ListAllBucketPoliciesArgs", ",", "reply", "*", "ListAllBucketPoliciesRep", ")", "error", "{", "objectAPI", ":=", "web", ".", "Obj...
// ListAllBucketPolicies - get all bucket policy.
[ "ListAllBucketPolicies", "-", "get", "all", "bucket", "policy", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1530-L1600
125,623
minio/minio
cmd/web-handlers.go
PresignedGet
func (web *webAPIHandlers) PresignedGet(r *http.Request, args *PresignedGetArgs, reply *PresignedGetRep) error { claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } var creds auth.Credentials if !owner { var ok bool creds, ok = globalIAMSys.GetUser(claims.Sub...
go
func (web *webAPIHandlers) PresignedGet(r *http.Request, args *PresignedGetArgs, reply *PresignedGetRep) error { claims, owner, authErr := webRequestAuthenticate(r) if authErr != nil { return toJSONError(authErr) } var creds auth.Credentials if !owner { var ok bool creds, ok = globalIAMSys.GetUser(claims.Sub...
[ "func", "(", "web", "*", "webAPIHandlers", ")", "PresignedGet", "(", "r", "*", "http", ".", "Request", ",", "args", "*", "PresignedGetArgs", ",", "reply", "*", "PresignedGetRep", ")", "error", "{", "claims", ",", "owner", ",", "authErr", ":=", "webRequestA...
// PresignedGET - returns presigned-Get url.
[ "PresignedGET", "-", "returns", "presigned", "-", "Get", "url", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1763-L1794
125,624
minio/minio
cmd/web-handlers.go
presignedGet
func presignedGet(host, bucket, object string, expiry int64, creds auth.Credentials, region string) string { accessKey := creds.AccessKey secretKey := creds.SecretKey date := UTCNow() dateStr := date.Format(iso8601Format) credential := fmt.Sprintf("%s/%s", accessKey, getScope(date, region)) var expiryStr = "604...
go
func presignedGet(host, bucket, object string, expiry int64, creds auth.Credentials, region string) string { accessKey := creds.AccessKey secretKey := creds.SecretKey date := UTCNow() dateStr := date.Format(iso8601Format) credential := fmt.Sprintf("%s/%s", accessKey, getScope(date, region)) var expiryStr = "604...
[ "func", "presignedGet", "(", "host", ",", "bucket", ",", "object", "string", ",", "expiry", "int64", ",", "creds", "auth", ".", "Credentials", ",", "region", "string", ")", "string", "{", "accessKey", ":=", "creds", ".", "AccessKey", "\n", "secretKey", ":=...
// Returns presigned url for GET method.
[ "Returns", "presigned", "url", "for", "GET", "method", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1797-L1830
125,625
minio/minio
cmd/web-handlers.go
toJSONError
func toJSONError(err error, params ...string) (jerr *json2.Error) { apiErr := toWebAPIError(err) jerr = &json2.Error{ Message: apiErr.Description, } switch apiErr.Code { // Reserved bucket name provided. case "AllAccessDisabled": if len(params) > 0 { jerr = &json2.Error{ Message: fmt.Sprintf("All acces...
go
func toJSONError(err error, params ...string) (jerr *json2.Error) { apiErr := toWebAPIError(err) jerr = &json2.Error{ Message: apiErr.Description, } switch apiErr.Code { // Reserved bucket name provided. case "AllAccessDisabled": if len(params) > 0 { jerr = &json2.Error{ Message: fmt.Sprintf("All acces...
[ "func", "toJSONError", "(", "err", "error", ",", "params", "...", "string", ")", "(", "jerr", "*", "json2", ".", "Error", ")", "{", "apiErr", ":=", "toWebAPIError", "(", "err", ")", "\n", "jerr", "=", "&", "json2", ".", "Error", "{", "Message", ":", ...
// toJSONError converts regular errors into more user friendly // and consumable error message for the browser UI.
[ "toJSONError", "converts", "regular", "errors", "into", "more", "user", "friendly", "and", "consumable", "error", "message", "for", "the", "browser", "UI", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1834-L1871
125,626
minio/minio
cmd/web-handlers.go
toWebAPIError
func toWebAPIError(err error) APIError { switch err { case errServerNotInitialized: return APIError{ Code: "XMinioServerNotInitialized", HTTPStatusCode: http.StatusServiceUnavailable, Description: err.Error(), } case errAuthentication, auth.ErrInvalidAccessKeyLength, auth.ErrInvalidSecretKe...
go
func toWebAPIError(err error) APIError { switch err { case errServerNotInitialized: return APIError{ Code: "XMinioServerNotInitialized", HTTPStatusCode: http.StatusServiceUnavailable, Description: err.Error(), } case errAuthentication, auth.ErrInvalidAccessKeyLength, auth.ErrInvalidSecretKe...
[ "func", "toWebAPIError", "(", "err", "error", ")", "APIError", "{", "switch", "err", "{", "case", "errServerNotInitialized", ":", "return", "APIError", "{", "Code", ":", "\"", "\"", ",", "HTTPStatusCode", ":", "http", ".", "StatusServiceUnavailable", ",", "Des...
// toWebAPIError - convert into error into APIError.
[ "toWebAPIError", "-", "convert", "into", "error", "into", "APIError", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1874-L1961
125,627
minio/minio
cmd/web-handlers.go
writeWebErrorResponse
func writeWebErrorResponse(w http.ResponseWriter, err error) { apiErr := toWebAPIError(err) w.WriteHeader(apiErr.HTTPStatusCode) w.Write([]byte(apiErr.Description)) }
go
func writeWebErrorResponse(w http.ResponseWriter, err error) { apiErr := toWebAPIError(err) w.WriteHeader(apiErr.HTTPStatusCode) w.Write([]byte(apiErr.Description)) }
[ "func", "writeWebErrorResponse", "(", "w", "http", ".", "ResponseWriter", ",", "err", "error", ")", "{", "apiErr", ":=", "toWebAPIError", "(", "err", ")", "\n", "w", ".", "WriteHeader", "(", "apiErr", ".", "HTTPStatusCode", ")", "\n", "w", ".", "Write", ...
// writeWebErrorResponse - set HTTP status code and write error description to the body.
[ "writeWebErrorResponse", "-", "set", "HTTP", "status", "code", "and", "write", "error", "description", "to", "the", "body", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/web-handlers.go#L1964-L1968
125,628
minio/minio
pkg/policy/resourceset.go
bucketResourceExists
func (resourceSet ResourceSet) bucketResourceExists() bool { for resource := range resourceSet { if resource.isBucketPattern() { return true } } return false }
go
func (resourceSet ResourceSet) bucketResourceExists() bool { for resource := range resourceSet { if resource.isBucketPattern() { return true } } return false }
[ "func", "(", "resourceSet", "ResourceSet", ")", "bucketResourceExists", "(", ")", "bool", "{", "for", "resource", ":=", "range", "resourceSet", "{", "if", "resource", ".", "isBucketPattern", "(", ")", "{", "return", "true", "\n", "}", "\n", "}", "\n\n", "r...
// bucketResourceExists - checks if at least one bucket resource exists in the set.
[ "bucketResourceExists", "-", "checks", "if", "at", "least", "one", "bucket", "resource", "exists", "in", "the", "set", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L31-L39
125,629
minio/minio
pkg/policy/resourceset.go
objectResourceExists
func (resourceSet ResourceSet) objectResourceExists() bool { for resource := range resourceSet { if resource.isObjectPattern() { return true } } return false }
go
func (resourceSet ResourceSet) objectResourceExists() bool { for resource := range resourceSet { if resource.isObjectPattern() { return true } } return false }
[ "func", "(", "resourceSet", "ResourceSet", ")", "objectResourceExists", "(", ")", "bool", "{", "for", "resource", ":=", "range", "resourceSet", "{", "if", "resource", ".", "isObjectPattern", "(", ")", "{", "return", "true", "\n", "}", "\n", "}", "\n\n", "r...
// objectResourceExists - checks if at least one object resource exists in the set.
[ "objectResourceExists", "-", "checks", "if", "at", "least", "one", "object", "resource", "exists", "in", "the", "set", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L42-L50
125,630
minio/minio
pkg/policy/resourceset.go
Intersection
func (resourceSet ResourceSet) Intersection(sset ResourceSet) ResourceSet { nset := NewResourceSet() for k := range resourceSet { if _, ok := sset[k]; ok { nset.Add(k) } } return nset }
go
func (resourceSet ResourceSet) Intersection(sset ResourceSet) ResourceSet { nset := NewResourceSet() for k := range resourceSet { if _, ok := sset[k]; ok { nset.Add(k) } } return nset }
[ "func", "(", "resourceSet", "ResourceSet", ")", "Intersection", "(", "sset", "ResourceSet", ")", "ResourceSet", "{", "nset", ":=", "NewResourceSet", "(", ")", "\n", "for", "k", ":=", "range", "resourceSet", "{", "if", "_", ",", "ok", ":=", "sset", "[", "...
// Intersection - returns resouces available in both ResourcsSet.
[ "Intersection", "-", "returns", "resouces", "available", "in", "both", "ResourcsSet", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L58-L67
125,631
minio/minio
pkg/policy/resourceset.go
MarshalJSON
func (resourceSet ResourceSet) MarshalJSON() ([]byte, error) { if len(resourceSet) == 0 { return nil, fmt.Errorf("empty resource set") } resources := []Resource{} for resource := range resourceSet { resources = append(resources, resource) } return json.Marshal(resources) }
go
func (resourceSet ResourceSet) MarshalJSON() ([]byte, error) { if len(resourceSet) == 0 { return nil, fmt.Errorf("empty resource set") } resources := []Resource{} for resource := range resourceSet { resources = append(resources, resource) } return json.Marshal(resources) }
[ "func", "(", "resourceSet", "ResourceSet", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "if", "len", "(", "resourceSet", ")", "==", "0", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", ...
// MarshalJSON - encodes ResourceSet to JSON data.
[ "MarshalJSON", "-", "encodes", "ResourceSet", "to", "JSON", "data", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L70-L81
125,632
minio/minio
pkg/policy/resourceset.go
Match
func (resourceSet ResourceSet) Match(resource string, conditionValues map[string][]string) bool { for r := range resourceSet { if r.Match(resource, conditionValues) { return true } } return false }
go
func (resourceSet ResourceSet) Match(resource string, conditionValues map[string][]string) bool { for r := range resourceSet { if r.Match(resource, conditionValues) { return true } } return false }
[ "func", "(", "resourceSet", "ResourceSet", ")", "Match", "(", "resource", "string", ",", "conditionValues", "map", "[", "string", "]", "[", "]", "string", ")", "bool", "{", "for", "r", ":=", "range", "resourceSet", "{", "if", "r", ".", "Match", "(", "r...
// Match - matches object name with anyone of resource pattern in resource set.
[ "Match", "-", "matches", "object", "name", "with", "anyone", "of", "resource", "pattern", "in", "resource", "set", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L84-L92
125,633
minio/minio
pkg/policy/resourceset.go
UnmarshalJSON
func (resourceSet *ResourceSet) UnmarshalJSON(data []byte) error { var sset set.StringSet if err := json.Unmarshal(data, &sset); err != nil { return err } *resourceSet = make(ResourceSet) for _, s := range sset.ToSlice() { resource, err := parseResource(s) if err != nil { return err } if _, found :=...
go
func (resourceSet *ResourceSet) UnmarshalJSON(data []byte) error { var sset set.StringSet if err := json.Unmarshal(data, &sset); err != nil { return err } *resourceSet = make(ResourceSet) for _, s := range sset.ToSlice() { resource, err := parseResource(s) if err != nil { return err } if _, found :=...
[ "func", "(", "resourceSet", "*", "ResourceSet", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "var", "sset", "set", ".", "StringSet", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "data", ",", "&", "sset", ")", ";"...
// UnmarshalJSON - decodes JSON data to ResourceSet.
[ "UnmarshalJSON", "-", "decodes", "JSON", "data", "to", "ResourceSet", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L105-L126
125,634
minio/minio
pkg/policy/resourceset.go
Validate
func (resourceSet ResourceSet) Validate(bucketName string) error { for resource := range resourceSet { if err := resource.Validate(bucketName); err != nil { return err } } return nil }
go
func (resourceSet ResourceSet) Validate(bucketName string) error { for resource := range resourceSet { if err := resource.Validate(bucketName); err != nil { return err } } return nil }
[ "func", "(", "resourceSet", "ResourceSet", ")", "Validate", "(", "bucketName", "string", ")", "error", "{", "for", "resource", ":=", "range", "resourceSet", "{", "if", "err", ":=", "resource", ".", "Validate", "(", "bucketName", ")", ";", "err", "!=", "nil...
// Validate - validates ResourceSet is for given bucket or not.
[ "Validate", "-", "validates", "ResourceSet", "is", "for", "given", "bucket", "or", "not", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L129-L137
125,635
minio/minio
pkg/policy/resourceset.go
NewResourceSet
func NewResourceSet(resources ...Resource) ResourceSet { resourceSet := make(ResourceSet) for _, resource := range resources { resourceSet.Add(resource) } return resourceSet }
go
func NewResourceSet(resources ...Resource) ResourceSet { resourceSet := make(ResourceSet) for _, resource := range resources { resourceSet.Add(resource) } return resourceSet }
[ "func", "NewResourceSet", "(", "resources", "...", "Resource", ")", "ResourceSet", "{", "resourceSet", ":=", "make", "(", "ResourceSet", ")", "\n", "for", "_", ",", "resource", ":=", "range", "resources", "{", "resourceSet", ".", "Add", "(", "resource", ")",...
// NewResourceSet - creates new resource set.
[ "NewResourceSet", "-", "creates", "new", "resource", "set", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/resourceset.go#L140-L147
125,636
minio/minio
pkg/mimedb/util/gen-db.go
convertDB
func convertDB(jsonFile string) (mimeDB, error) { // Structure of JSON data from mime-db project. type dbEntry struct { Source string `json:"source"` Compressible bool `json:"compresible"` Extensions []string `json:"extensions"` } // Access embedded "db.json" inside go-bindata. jsonDB, err := ...
go
func convertDB(jsonFile string) (mimeDB, error) { // Structure of JSON data from mime-db project. type dbEntry struct { Source string `json:"source"` Compressible bool `json:"compresible"` Extensions []string `json:"extensions"` } // Access embedded "db.json" inside go-bindata. jsonDB, err := ...
[ "func", "convertDB", "(", "jsonFile", "string", ")", "(", "mimeDB", ",", "error", ")", "{", "// Structure of JSON data from mime-db project.", "type", "dbEntry", "struct", "{", "Source", "string", "`json:\"source\"`", "\n", "Compressible", "bool", "`json:\"compresible\"...
// JSON data from gobindata and parse them into extDB.
[ "JSON", "data", "from", "gobindata", "and", "parse", "them", "into", "extDB", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/mimedb/util/gen-db.go#L72-L117
125,637
minio/minio
cmd/signature-v4-parser.go
getScope
func (c credentialHeader) getScope() string { return strings.Join([]string{ c.scope.date.Format(yyyymmdd), c.scope.region, c.scope.service, c.scope.request, }, "/") }
go
func (c credentialHeader) getScope() string { return strings.Join([]string{ c.scope.date.Format(yyyymmdd), c.scope.region, c.scope.service, c.scope.request, }, "/") }
[ "func", "(", "c", "credentialHeader", ")", "getScope", "(", ")", "string", "{", "return", "strings", ".", "Join", "(", "[", "]", "string", "{", "c", ".", "scope", ".", "date", ".", "Format", "(", "yyyymmdd", ")", ",", "c", ".", "scope", ".", "regio...
// Return scope string.
[ "Return", "scope", "string", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4-parser.go#L41-L48
125,638
minio/minio
cmd/signature-v4-parser.go
parseCredentialHeader
func parseCredentialHeader(credElement string, region string, stype serviceType) (ch credentialHeader, aec APIErrorCode) { creds := strings.SplitN(strings.TrimSpace(credElement), "=", 2) if len(creds) != 2 { return ch, ErrMissingFields } if creds[0] != "Credential" { return ch, ErrMissingCredTag } credElement...
go
func parseCredentialHeader(credElement string, region string, stype serviceType) (ch credentialHeader, aec APIErrorCode) { creds := strings.SplitN(strings.TrimSpace(credElement), "=", 2) if len(creds) != 2 { return ch, ErrMissingFields } if creds[0] != "Credential" { return ch, ErrMissingCredTag } credElement...
[ "func", "parseCredentialHeader", "(", "credElement", "string", ",", "region", "string", ",", "stype", "serviceType", ")", "(", "ch", "credentialHeader", ",", "aec", "APIErrorCode", ")", "{", "creds", ":=", "strings", ".", "SplitN", "(", "strings", ".", "TrimSp...
// parse credentialHeader string into its structured form.
[ "parse", "credentialHeader", "string", "into", "its", "structured", "form", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4-parser.go#L68-L119
125,639
minio/minio
cmd/signature-v4-parser.go
parseSignature
func parseSignature(signElement string) (string, APIErrorCode) { signFields := strings.Split(strings.TrimSpace(signElement), "=") if len(signFields) != 2 { return "", ErrMissingFields } if signFields[0] != "Signature" { return "", ErrMissingSignTag } if signFields[1] == "" { return "", ErrMissingFields } ...
go
func parseSignature(signElement string) (string, APIErrorCode) { signFields := strings.Split(strings.TrimSpace(signElement), "=") if len(signFields) != 2 { return "", ErrMissingFields } if signFields[0] != "Signature" { return "", ErrMissingSignTag } if signFields[1] == "" { return "", ErrMissingFields } ...
[ "func", "parseSignature", "(", "signElement", "string", ")", "(", "string", ",", "APIErrorCode", ")", "{", "signFields", ":=", "strings", ".", "Split", "(", "strings", ".", "TrimSpace", "(", "signElement", ")", ",", "\"", "\"", ")", "\n", "if", "len", "(...
// Parse signature from signature tag.
[ "Parse", "signature", "from", "signature", "tag", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4-parser.go#L122-L135
125,640
minio/minio
cmd/signature-v4-parser.go
parseSignedHeader
func parseSignedHeader(signedHdrElement string) ([]string, APIErrorCode) { signedHdrFields := strings.Split(strings.TrimSpace(signedHdrElement), "=") if len(signedHdrFields) != 2 { return nil, ErrMissingFields } if signedHdrFields[0] != "SignedHeaders" { return nil, ErrMissingSignHeadersTag } if signedHdrFiel...
go
func parseSignedHeader(signedHdrElement string) ([]string, APIErrorCode) { signedHdrFields := strings.Split(strings.TrimSpace(signedHdrElement), "=") if len(signedHdrFields) != 2 { return nil, ErrMissingFields } if signedHdrFields[0] != "SignedHeaders" { return nil, ErrMissingSignHeadersTag } if signedHdrFiel...
[ "func", "parseSignedHeader", "(", "signedHdrElement", "string", ")", "(", "[", "]", "string", ",", "APIErrorCode", ")", "{", "signedHdrFields", ":=", "strings", ".", "Split", "(", "strings", ".", "TrimSpace", "(", "signedHdrElement", ")", ",", "\"", "\"", ")...
// Parse slice of signed headers from signed headers tag.
[ "Parse", "slice", "of", "signed", "headers", "from", "signed", "headers", "tag", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4-parser.go#L138-L151
125,641
minio/minio
cmd/signature-v4-parser.go
parsePreSignV4
func parsePreSignV4(query url.Values, region string, stype serviceType) (psv preSignValues, aec APIErrorCode) { // verify whether the required query params exist. err := doesV4PresignParamsExist(query) if err != ErrNone { return psv, err } // Verify if the query algorithm is supported or not. if query.Get("X-A...
go
func parsePreSignV4(query url.Values, region string, stype serviceType) (psv preSignValues, aec APIErrorCode) { // verify whether the required query params exist. err := doesV4PresignParamsExist(query) if err != ErrNone { return psv, err } // Verify if the query algorithm is supported or not. if query.Get("X-A...
[ "func", "parsePreSignV4", "(", "query", "url", ".", "Values", ",", "region", "string", ",", "stype", "serviceType", ")", "(", "psv", "preSignValues", ",", "aec", "APIErrorCode", ")", "{", "// verify whether the required query params exist.", "err", ":=", "doesV4Pres...
// Parses all the presigned signature values into separate elements.
[ "Parses", "all", "the", "presigned", "signature", "values", "into", "separate", "elements", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/signature-v4-parser.go#L188-L245
125,642
minio/minio
cmd/logger/message/audit/entry.go
ToEntry
func ToEntry(w http.ResponseWriter, r *http.Request, api string, statusCode int, reqClaims map[string]interface{}) Entry { vars := mux.Vars(r) bucket := vars["bucket"] object := vars["object"] reqQuery := make(map[string]string) for k, v := range r.URL.Query() { reqQuery[k] = strings.Join(v, ",") } reqHeader ...
go
func ToEntry(w http.ResponseWriter, r *http.Request, api string, statusCode int, reqClaims map[string]interface{}) Entry { vars := mux.Vars(r) bucket := vars["bucket"] object := vars["object"] reqQuery := make(map[string]string) for k, v := range r.URL.Query() { reqQuery[k] = strings.Join(v, ",") } reqHeader ...
[ "func", "ToEntry", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "api", "string", ",", "statusCode", "int", ",", "reqClaims", "map", "[", "string", "]", "interface", "{", "}", ")", "Entry", "{", "vars", ":=", "m...
// ToEntry - constructs an audit entry object.
[ "ToEntry", "-", "constructs", "an", "audit", "entry", "object", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/logger/message/audit/entry.go#L53-L92
125,643
minio/minio
pkg/sys/stats_darwin.go
GetStats
func GetStats() (stats Stats, err error) { stats.TotalRAM, err = getHwMemsize() return stats, err }
go
func GetStats() (stats Stats, err error) { stats.TotalRAM, err = getHwMemsize() return stats, err }
[ "func", "GetStats", "(", ")", "(", "stats", "Stats", ",", "err", "error", ")", "{", "stats", ".", "TotalRAM", ",", "err", "=", "getHwMemsize", "(", ")", "\n", "return", "stats", ",", "err", "\n", "}" ]
// GetStats - return system statistics for macOS.
[ "GetStats", "-", "return", "system", "statistics", "for", "macOS", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/sys/stats_darwin.go#L42-L45
125,644
minio/minio
pkg/auth/credentials.go
IsExpired
func (cred Credentials) IsExpired() bool { if cred.Expiration.IsZero() || cred.Expiration == timeSentinel { return false } return cred.Expiration.Before(time.Now().UTC()) }
go
func (cred Credentials) IsExpired() bool { if cred.Expiration.IsZero() || cred.Expiration == timeSentinel { return false } return cred.Expiration.Before(time.Now().UTC()) }
[ "func", "(", "cred", "Credentials", ")", "IsExpired", "(", ")", "bool", "{", "if", "cred", ".", "Expiration", ".", "IsZero", "(", ")", "||", "cred", ".", "Expiration", "==", "timeSentinel", "{", "return", "false", "\n", "}", "\n\n", "return", "cred", "...
// IsExpired - returns whether Credential is expired or not.
[ "IsExpired", "-", "returns", "whether", "Credential", "is", "expired", "or", "not", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/auth/credentials.go#L81-L87
125,645
minio/minio
pkg/auth/credentials.go
IsValid
func (cred Credentials) IsValid() bool { // Verify credentials if its enabled or not set. if cred.Status == "enabled" || cred.Status == "" { return IsAccessKeyValid(cred.AccessKey) && IsSecretKeyValid(cred.SecretKey) && !cred.IsExpired() } return false }
go
func (cred Credentials) IsValid() bool { // Verify credentials if its enabled or not set. if cred.Status == "enabled" || cred.Status == "" { return IsAccessKeyValid(cred.AccessKey) && IsSecretKeyValid(cred.SecretKey) && !cred.IsExpired() } return false }
[ "func", "(", "cred", "Credentials", ")", "IsValid", "(", ")", "bool", "{", "// Verify credentials if its enabled or not set.", "if", "cred", ".", "Status", "==", "\"", "\"", "||", "cred", ".", "Status", "==", "\"", "\"", "{", "return", "IsAccessKeyValid", "(",...
// IsValid - returns whether credential is valid or not.
[ "IsValid", "-", "returns", "whether", "credential", "is", "valid", "or", "not", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/auth/credentials.go#L90-L96
125,646
minio/minio
pkg/auth/credentials.go
Equal
func (cred Credentials) Equal(ccred Credentials) bool { if !ccred.IsValid() { return false } return (cred.AccessKey == ccred.AccessKey && subtle.ConstantTimeCompare([]byte(cred.SecretKey), []byte(ccred.SecretKey)) == 1 && subtle.ConstantTimeCompare([]byte(cred.SessionToken), []byte(ccred.SessionToken)) == 1) }
go
func (cred Credentials) Equal(ccred Credentials) bool { if !ccred.IsValid() { return false } return (cred.AccessKey == ccred.AccessKey && subtle.ConstantTimeCompare([]byte(cred.SecretKey), []byte(ccred.SecretKey)) == 1 && subtle.ConstantTimeCompare([]byte(cred.SessionToken), []byte(ccred.SessionToken)) == 1) }
[ "func", "(", "cred", "Credentials", ")", "Equal", "(", "ccred", "Credentials", ")", "bool", "{", "if", "!", "ccred", ".", "IsValid", "(", ")", "{", "return", "false", "\n", "}", "\n", "return", "(", "cred", ".", "AccessKey", "==", "ccred", ".", "Acce...
// Equal - returns whether two credentials are equal or not.
[ "Equal", "-", "returns", "whether", "two", "credentials", "are", "equal", "or", "not", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/auth/credentials.go#L99-L105
125,647
minio/minio
pkg/auth/credentials.go
GetNewCredentialsWithMetadata
func GetNewCredentialsWithMetadata(m map[string]interface{}, tokenSecret string) (cred Credentials, err error) { readBytes := func(size int) (data []byte, err error) { data = make([]byte, size) var n int if n, err = rand.Read(data); err != nil { return nil, err } else if n != size { return nil, fmt.Error...
go
func GetNewCredentialsWithMetadata(m map[string]interface{}, tokenSecret string) (cred Credentials, err error) { readBytes := func(size int) (data []byte, err error) { data = make([]byte, size) var n int if n, err = rand.Read(data); err != nil { return nil, err } else if n != size { return nil, fmt.Error...
[ "func", "GetNewCredentialsWithMetadata", "(", "m", "map", "[", "string", "]", "interface", "{", "}", ",", "tokenSecret", "string", ")", "(", "cred", "Credentials", ",", "err", "error", ")", "{", "readBytes", ":=", "func", "(", "size", "int", ")", "(", "d...
// GetNewCredentialsWithMetadata generates and returns new credential with expiry.
[ "GetNewCredentialsWithMetadata", "generates", "and", "returns", "new", "credential", "with", "expiry", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/auth/credentials.go#L131-L180
125,648
minio/minio
pkg/auth/credentials.go
CreateCredentials
func CreateCredentials(accessKey, secretKey string) (cred Credentials, err error) { if !IsAccessKeyValid(accessKey) { return cred, ErrInvalidAccessKeyLength } if !IsSecretKeyValid(secretKey) { return cred, ErrInvalidSecretKeyLength } cred.AccessKey = accessKey cred.SecretKey = secretKey cred.Expiration = tim...
go
func CreateCredentials(accessKey, secretKey string) (cred Credentials, err error) { if !IsAccessKeyValid(accessKey) { return cred, ErrInvalidAccessKeyLength } if !IsSecretKeyValid(secretKey) { return cred, ErrInvalidSecretKeyLength } cred.AccessKey = accessKey cred.SecretKey = secretKey cred.Expiration = tim...
[ "func", "CreateCredentials", "(", "accessKey", ",", "secretKey", "string", ")", "(", "cred", "Credentials", ",", "err", "error", ")", "{", "if", "!", "IsAccessKeyValid", "(", "accessKey", ")", "{", "return", "cred", ",", "ErrInvalidAccessKeyLength", "\n", "}",...
// CreateCredentials returns new credential with the given access key and secret key. // Error is returned if given access key or secret key are invalid length.
[ "CreateCredentials", "returns", "new", "credential", "with", "the", "given", "access", "key", "and", "secret", "key", ".", "Error", "is", "returned", "if", "given", "access", "key", "or", "secret", "key", "are", "invalid", "length", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/auth/credentials.go#L189-L201
125,649
minio/minio
cmd/gateway/s3/gateway-s3.go
s3GatewayMain
func s3GatewayMain(ctx *cli.Context) { args := ctx.Args() if !ctx.Args().Present() { args = cli.Args{"https://s3.amazonaws.com"} } // Validate gateway arguments. logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), args.First()), "Invalid argument") // Start the gateway.. minio.StartGat...
go
func s3GatewayMain(ctx *cli.Context) { args := ctx.Args() if !ctx.Args().Present() { args = cli.Args{"https://s3.amazonaws.com"} } // Validate gateway arguments. logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), args.First()), "Invalid argument") // Start the gateway.. minio.StartGat...
[ "func", "s3GatewayMain", "(", "ctx", "*", "cli", ".", "Context", ")", "{", "args", ":=", "ctx", ".", "Args", "(", ")", "\n", "if", "!", "ctx", ".", "Args", "(", ")", ".", "Present", "(", ")", "{", "args", "=", "cli", ".", "Args", "{", "\"", "...
// Handler for 'minio gateway s3' command line.
[ "Handler", "for", "minio", "gateway", "s3", "command", "line", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L124-L135
125,650
minio/minio
cmd/gateway/s3/gateway-s3.go
randString
func randString(n int, src rand.Source, prefix string) string { b := make([]byte, n) // A rand.Int63() generates 63 random bits, enough for letterIdxMax letters! for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; { if remain == 0 { cache, remain = src.Int63(), letterIdxMax } if idx := int(cache...
go
func randString(n int, src rand.Source, prefix string) string { b := make([]byte, n) // A rand.Int63() generates 63 random bits, enough for letterIdxMax letters! for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; { if remain == 0 { cache, remain = src.Int63(), letterIdxMax } if idx := int(cache...
[ "func", "randString", "(", "n", "int", ",", "src", "rand", ".", "Source", ",", "prefix", "string", ")", "string", "{", "b", ":=", "make", "(", "[", "]", "byte", ",", "n", ")", "\n", "// A rand.Int63() generates 63 random bits, enough for letterIdxMax letters!", ...
// randString generates random names and prepends them with a known prefix.
[ "randString", "generates", "random", "names", "and", "prepends", "them", "with", "a", "known", "prefix", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L155-L170
125,651
minio/minio
cmd/gateway/s3/gateway-s3.go
newS3
func newS3(urlStr string) (*miniogo.Core, error) { if urlStr == "" { urlStr = "https://s3.amazonaws.com" } // Override default params if the host is provided endpoint, secure, err := minio.ParseGatewayEndpoint(urlStr) if err != nil { return nil, err } var creds *credentials.Credentials if isAmazonS3Endpoi...
go
func newS3(urlStr string) (*miniogo.Core, error) { if urlStr == "" { urlStr = "https://s3.amazonaws.com" } // Override default params if the host is provided endpoint, secure, err := minio.ParseGatewayEndpoint(urlStr) if err != nil { return nil, err } var creds *credentials.Credentials if isAmazonS3Endpoi...
[ "func", "newS3", "(", "urlStr", "string", ")", "(", "*", "miniogo", ".", "Core", ",", "error", ")", "{", "if", "urlStr", "==", "\"", "\"", "{", "urlStr", "=", "\"", "\"", "\n", "}", "\n\n", "// Override default params if the host is provided", "endpoint", ...
// newS3 - Initializes a new client by auto probing S3 server signature.
[ "newS3", "-", "Initializes", "a", "new", "client", "by", "auto", "probing", "S3", "server", "signature", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L208-L243
125,652
minio/minio
cmd/gateway/s3/gateway-s3.go
NewGatewayLayer
func (g *S3) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { // creds are ignored here, since S3 gateway implements chaining // all credentials. clnt, err := newS3(g.host) if err != nil { return nil, err } s := s3Objects{ Client: clnt, } // Enables single encyption of KMS is configured...
go
func (g *S3) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { // creds are ignored here, since S3 gateway implements chaining // all credentials. clnt, err := newS3(g.host) if err != nil { return nil, err } s := s3Objects{ Client: clnt, } // Enables single encyption of KMS is configured...
[ "func", "(", "g", "*", "S3", ")", "NewGatewayLayer", "(", "creds", "auth", ".", "Credentials", ")", "(", "minio", ".", "ObjectLayer", ",", "error", ")", "{", "// creds are ignored here, since S3 gateway implements chaining", "// all credentials.", "clnt", ",", "err"...
// NewGatewayLayer returns s3 ObjectLayer.
[ "NewGatewayLayer", "returns", "s3", "ObjectLayer", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L246-L268
125,653
minio/minio
cmd/gateway/s3/gateway-s3.go
StorageInfo
func (l *s3Objects) StorageInfo(ctx context.Context) (si minio.StorageInfo) { return si }
go
func (l *s3Objects) StorageInfo(ctx context.Context) (si minio.StorageInfo) { return si }
[ "func", "(", "l", "*", "s3Objects", ")", "StorageInfo", "(", "ctx", "context", ".", "Context", ")", "(", "si", "minio", ".", "StorageInfo", ")", "{", "return", "si", "\n", "}" ]
// StorageInfo is not relevant to S3 backend.
[ "StorageInfo", "is", "not", "relevant", "to", "S3", "backend", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L288-L290
125,654
minio/minio
cmd/gateway/s3/gateway-s3.go
MakeBucketWithLocation
func (l *s3Objects) MakeBucketWithLocation(ctx context.Context, bucket, location string) error { // Verify if bucket name is valid. // We are using a separate helper function here to validate bucket // names instead of IsValidBucketName() because there is a possibility // that certains users might have buckets whic...
go
func (l *s3Objects) MakeBucketWithLocation(ctx context.Context, bucket, location string) error { // Verify if bucket name is valid. // We are using a separate helper function here to validate bucket // names instead of IsValidBucketName() because there is a possibility // that certains users might have buckets whic...
[ "func", "(", "l", "*", "s3Objects", ")", "MakeBucketWithLocation", "(", "ctx", "context", ".", "Context", ",", "bucket", ",", "location", "string", ")", "error", "{", "// Verify if bucket name is valid.", "// We are using a separate helper function here to validate bucket",...
// MakeBucket creates a new container on S3 backend.
[ "MakeBucket", "creates", "a", "new", "container", "on", "S3", "backend", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L293-L310
125,655
minio/minio
cmd/gateway/s3/gateway-s3.go
ListBuckets
func (l *s3Objects) ListBuckets(ctx context.Context) ([]minio.BucketInfo, error) { buckets, err := l.Client.ListBuckets() if err != nil { return nil, minio.ErrorRespToObjectError(err) } b := make([]minio.BucketInfo, len(buckets)) for i, bi := range buckets { b[i] = minio.BucketInfo{ Name: bi.Name, Cr...
go
func (l *s3Objects) ListBuckets(ctx context.Context) ([]minio.BucketInfo, error) { buckets, err := l.Client.ListBuckets() if err != nil { return nil, minio.ErrorRespToObjectError(err) } b := make([]minio.BucketInfo, len(buckets)) for i, bi := range buckets { b[i] = minio.BucketInfo{ Name: bi.Name, Cr...
[ "func", "(", "l", "*", "s3Objects", ")", "ListBuckets", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "minio", ".", "BucketInfo", ",", "error", ")", "{", "buckets", ",", "err", ":=", "l", ".", "Client", ".", "ListBuckets", "(", ")", "\...
// ListBuckets lists all S3 buckets
[ "ListBuckets", "lists", "all", "S3", "buckets" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L334-L349
125,656
minio/minio
cmd/gateway/s3/gateway-s3.go
DeleteBucket
func (l *s3Objects) DeleteBucket(ctx context.Context, bucket string) error { err := l.Client.RemoveBucket(bucket) if err != nil { return minio.ErrorRespToObjectError(err, bucket) } return nil }
go
func (l *s3Objects) DeleteBucket(ctx context.Context, bucket string) error { err := l.Client.RemoveBucket(bucket) if err != nil { return minio.ErrorRespToObjectError(err, bucket) } return nil }
[ "func", "(", "l", "*", "s3Objects", ")", "DeleteBucket", "(", "ctx", "context", ".", "Context", ",", "bucket", "string", ")", "error", "{", "err", ":=", "l", ".", "Client", ".", "RemoveBucket", "(", "bucket", ")", "\n", "if", "err", "!=", "nil", "{",...
// DeleteBucket deletes a bucket on S3
[ "DeleteBucket", "deletes", "a", "bucket", "on", "S3" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L352-L358
125,657
minio/minio
cmd/gateway/s3/gateway-s3.go
ListObjects
func (l *s3Objects) ListObjects(ctx context.Context, bucket string, prefix string, marker string, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, e error) { result, err := l.Client.ListObjects(bucket, prefix, marker, delimiter, maxKeys) if err != nil { return loi, minio.ErrorRespToObjectError(err, bucket...
go
func (l *s3Objects) ListObjects(ctx context.Context, bucket string, prefix string, marker string, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, e error) { result, err := l.Client.ListObjects(bucket, prefix, marker, delimiter, maxKeys) if err != nil { return loi, minio.ErrorRespToObjectError(err, bucket...
[ "func", "(", "l", "*", "s3Objects", ")", "ListObjects", "(", "ctx", "context", ".", "Context", ",", "bucket", "string", ",", "prefix", "string", ",", "marker", "string", ",", "delimiter", "string", ",", "maxKeys", "int", ")", "(", "loi", "minio", ".", ...
// ListObjects lists all blobs in S3 bucket filtered by prefix
[ "ListObjects", "lists", "all", "blobs", "in", "S3", "bucket", "filtered", "by", "prefix" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L361-L368
125,658
minio/minio
cmd/gateway/s3/gateway-s3.go
GetObject
func (l *s3Objects) GetObject(ctx context.Context, bucket string, key string, startOffset int64, length int64, writer io.Writer, etag string, o minio.ObjectOptions) error { if length < 0 && length != -1 { return minio.ErrorRespToObjectError(minio.InvalidRange{}, bucket, key) } opts := miniogo.GetObjectOptions{} ...
go
func (l *s3Objects) GetObject(ctx context.Context, bucket string, key string, startOffset int64, length int64, writer io.Writer, etag string, o minio.ObjectOptions) error { if length < 0 && length != -1 { return minio.ErrorRespToObjectError(minio.InvalidRange{}, bucket, key) } opts := miniogo.GetObjectOptions{} ...
[ "func", "(", "l", "*", "s3Objects", ")", "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. // // startOffset indicates the starting read location of the object. // length indicates the total length of the object.
[ "GetObject", "reads", "an", "object", "from", "S3", ".", "Supports", "additional", "parameters", "like", "offset", "and", "length", "which", "are", "synonymous", "with", "HTTP", "Range", "requests", ".", "startOffset", "indicates", "the", "starting", "read", "lo...
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L412-L434
125,659
minio/minio
cmd/gateway/s3/gateway-s3.go
IsEncryptionSupported
func (l *s3Objects) IsEncryptionSupported() bool { return minio.GlobalKMS != nil || len(minio.GlobalGatewaySSE) > 0 }
go
func (l *s3Objects) IsEncryptionSupported() bool { return minio.GlobalKMS != nil || len(minio.GlobalGatewaySSE) > 0 }
[ "func", "(", "l", "*", "s3Objects", ")", "IsEncryptionSupported", "(", ")", "bool", "{", "return", "minio", ".", "GlobalKMS", "!=", "nil", "||", "len", "(", "minio", ".", "GlobalGatewaySSE", ")", ">", "0", "\n", "}" ]
// IsEncryptionSupported returns whether server side encryption is implemented for this layer.
[ "IsEncryptionSupported", "returns", "whether", "server", "side", "encryption", "is", "implemented", "for", "this", "layer", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/gateway/s3/gateway-s3.go#L634-L636
125,660
minio/minio
cmd/http/server.go
Start
func (srv *Server) Start() (err error) { // Take a copy of server fields. var tlsConfig *tls.Config if srv.TLSConfig != nil { tlsConfig = srv.TLSConfig.Clone() } readTimeout := srv.ReadTimeout writeTimeout := srv.WriteTimeout handler := srv.Handler // if srv.Handler holds non-synced state -> possible data race...
go
func (srv *Server) Start() (err error) { // Take a copy of server fields. var tlsConfig *tls.Config if srv.TLSConfig != nil { tlsConfig = srv.TLSConfig.Clone() } readTimeout := srv.ReadTimeout writeTimeout := srv.WriteTimeout handler := srv.Handler // if srv.Handler holds non-synced state -> possible data race...
[ "func", "(", "srv", "*", "Server", ")", "Start", "(", ")", "(", "err", "error", ")", "{", "// Take a copy of server fields.", "var", "tlsConfig", "*", "tls", ".", "Config", "\n", "if", "srv", ".", "TLSConfig", "!=", "nil", "{", "tlsConfig", "=", "srv", ...
// Start - start HTTP server
[ "Start", "-", "start", "HTTP", "server" ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/http/server.go#L86-L144
125,661
minio/minio
cmd/http/server.go
Shutdown
func (srv *Server) Shutdown() error { srv.listenerMutex.Lock() if srv.listener == nil { srv.listenerMutex.Unlock() return errors.New("server not initialized") } srv.listenerMutex.Unlock() if atomic.AddUint32(&srv.inShutdown, 1) > 1 { // shutdown in progress return errors.New("http server already in shutdo...
go
func (srv *Server) Shutdown() error { srv.listenerMutex.Lock() if srv.listener == nil { srv.listenerMutex.Unlock() return errors.New("server not initialized") } srv.listenerMutex.Unlock() if atomic.AddUint32(&srv.inShutdown, 1) > 1 { // shutdown in progress return errors.New("http server already in shutdo...
[ "func", "(", "srv", "*", "Server", ")", "Shutdown", "(", ")", "error", "{", "srv", ".", "listenerMutex", ".", "Lock", "(", ")", "\n", "if", "srv", ".", "listener", "==", "nil", "{", "srv", ".", "listenerMutex", ".", "Unlock", "(", ")", "\n", "retur...
// Shutdown - shuts down HTTP server.
[ "Shutdown", "-", "shuts", "down", "HTTP", "server", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/http/server.go#L147-L180
125,662
minio/minio
cmd/http/server.go
NewServer
func NewServer(addrs []string, handler http.Handler, getCert certs.GetCertificateFunc) *Server { var tlsConfig *tls.Config if getCert != nil { tlsConfig = &tls.Config{ // TLS hardening PreferServerCipherSuites: true, CipherSuites: defaultCipherSuites, CurvePreferences: secureCurves, ...
go
func NewServer(addrs []string, handler http.Handler, getCert certs.GetCertificateFunc) *Server { var tlsConfig *tls.Config if getCert != nil { tlsConfig = &tls.Config{ // TLS hardening PreferServerCipherSuites: true, CipherSuites: defaultCipherSuites, CurvePreferences: secureCurves, ...
[ "func", "NewServer", "(", "addrs", "[", "]", "string", ",", "handler", "http", ".", "Handler", ",", "getCert", "certs", ".", "GetCertificateFunc", ")", "*", "Server", "{", "var", "tlsConfig", "*", "tls", ".", "Config", "\n", "if", "getCert", "!=", "nil",...
// NewServer - creates new HTTP server using given arguments.
[ "NewServer", "-", "creates", "new", "HTTP", "server", "using", "given", "arguments", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/http/server.go#L205-L231
125,663
minio/minio
pkg/event/errors.go
IsEventError
func IsEventError(err error) bool { switch err.(type) { case ErrInvalidFilterName, *ErrInvalidFilterName: return true case ErrFilterNamePrefix, *ErrFilterNamePrefix: return true case ErrFilterNameSuffix, *ErrFilterNameSuffix: return true case ErrInvalidFilterValue, *ErrInvalidFilterValue: return true case...
go
func IsEventError(err error) bool { switch err.(type) { case ErrInvalidFilterName, *ErrInvalidFilterName: return true case ErrFilterNamePrefix, *ErrFilterNamePrefix: return true case ErrFilterNameSuffix, *ErrFilterNameSuffix: return true case ErrInvalidFilterValue, *ErrInvalidFilterValue: return true case...
[ "func", "IsEventError", "(", "err", "error", ")", "bool", "{", "switch", "err", ".", "(", "type", ")", "{", "case", "ErrInvalidFilterName", ",", "*", "ErrInvalidFilterName", ":", "return", "true", "\n", "case", "ErrFilterNamePrefix", ",", "*", "ErrFilterNamePr...
// IsEventError - checks whether given error is event error or not.
[ "IsEventError", "-", "checks", "whether", "given", "error", "is", "event", "error", "or", "not", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/event/errors.go#L25-L52
125,664
minio/minio
cmd/notification.go
GetARNList
func (sys *NotificationSys) GetARNList() []string { arns := []string{} region := globalServerConfig.GetRegion() for _, targetID := range sys.targetList.List() { // httpclient target is part of ListenBucketNotification // which doesn't need to be listed as part of the ARN list // This list is only meant for ext...
go
func (sys *NotificationSys) GetARNList() []string { arns := []string{} region := globalServerConfig.GetRegion() for _, targetID := range sys.targetList.List() { // httpclient target is part of ListenBucketNotification // which doesn't need to be listed as part of the ARN list // This list is only meant for ext...
[ "func", "(", "sys", "*", "NotificationSys", ")", "GetARNList", "(", ")", "[", "]", "string", "{", "arns", ":=", "[", "]", "string", "{", "}", "\n", "region", ":=", "globalServerConfig", ".", "GetRegion", "(", ")", "\n", "for", "_", ",", "targetID", "...
// GetARNList - returns available ARNs.
[ "GetARNList", "-", "returns", "available", "ARNs", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L50-L64
125,665
minio/minio
cmd/notification.go
ReloadFormat
func (sys *NotificationSys) ReloadFormat(dryRun bool) []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), func() error { return client.ReloadFormat(dryRun) }, idx, *client.h...
go
func (sys *NotificationSys) ReloadFormat(dryRun bool) []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), func() error { return client.ReloadFormat(dryRun) }, idx, *client.h...
[ "func", "(", "sys", "*", "NotificationSys", ")", "ReloadFormat", "(", "dryRun", "bool", ")", "[", "]", "NotificationPeerErr", "{", "ng", ":=", "WithNPeers", "(", "len", "(", "sys", ".", "peerClients", ")", ")", "\n", "for", "idx", ",", "client", ":=", ...
// ReloadFormat - calls ReloadFormat REST call on all peers.
[ "ReloadFormat", "-", "calls", "ReloadFormat", "REST", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L145-L157
125,666
minio/minio
cmd/notification.go
LoadUsers
func (sys *NotificationSys) LoadUsers() []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), client.LoadUsers, idx, *client.host) } return ng.Wait() }
go
func (sys *NotificationSys) LoadUsers() []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), client.LoadUsers, idx, *client.host) } return ng.Wait() }
[ "func", "(", "sys", "*", "NotificationSys", ")", "LoadUsers", "(", ")", "[", "]", "NotificationPeerErr", "{", "ng", ":=", "WithNPeers", "(", "len", "(", "sys", ".", "peerClients", ")", ")", "\n", "for", "idx", ",", "client", ":=", "range", "sys", ".", ...
// LoadUsers - calls LoadUsers RPC call on all peers.
[ "LoadUsers", "-", "calls", "LoadUsers", "RPC", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L160-L170
125,667
minio/minio
cmd/notification.go
StartProfiling
func (sys *NotificationSys) StartProfiling(profiler string) []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), func() error { return client.StartProfiling(profiler) }, idx,...
go
func (sys *NotificationSys) StartProfiling(profiler string) []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), func() error { return client.StartProfiling(profiler) }, idx,...
[ "func", "(", "sys", "*", "NotificationSys", ")", "StartProfiling", "(", "profiler", "string", ")", "[", "]", "NotificationPeerErr", "{", "ng", ":=", "WithNPeers", "(", "len", "(", "sys", ".", "peerClients", ")", ")", "\n", "for", "idx", ",", "client", ":...
// StartProfiling - start profiling on remote peers, by initiating a remote RPC.
[ "StartProfiling", "-", "start", "profiling", "on", "remote", "peers", "by", "initiating", "a", "remote", "RPC", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L173-L185
125,668
minio/minio
cmd/notification.go
SignalService
func (sys *NotificationSys) SignalService(sig serviceSignal) []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), func() error { return client.SignalService(sig) }, idx, *cli...
go
func (sys *NotificationSys) SignalService(sig serviceSignal) []NotificationPeerErr { ng := WithNPeers(len(sys.peerClients)) for idx, client := range sys.peerClients { if client == nil { continue } client := client ng.Go(context.Background(), func() error { return client.SignalService(sig) }, idx, *cli...
[ "func", "(", "sys", "*", "NotificationSys", ")", "SignalService", "(", "sig", "serviceSignal", ")", "[", "]", "NotificationPeerErr", "{", "ng", ":=", "WithNPeers", "(", "len", "(", "sys", ".", "peerClients", ")", ")", "\n", "for", "idx", ",", "client", "...
// SignalService - calls signal service RPC call on all peers.
[ "SignalService", "-", "calls", "signal", "service", "RPC", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L282-L294
125,669
minio/minio
cmd/notification.go
ServerInfo
func (sys *NotificationSys) ServerInfo(ctx context.Context) []ServerInfo { serverInfo := make([]ServerInfo, len(sys.peerClients)) var wg sync.WaitGroup for index, client := range sys.peerClients { if client == nil { continue } wg.Add(1) go func(idx int, client *peerRESTClient) { defer wg.Done() // T...
go
func (sys *NotificationSys) ServerInfo(ctx context.Context) []ServerInfo { serverInfo := make([]ServerInfo, len(sys.peerClients)) var wg sync.WaitGroup for index, client := range sys.peerClients { if client == nil { continue } wg.Add(1) go func(idx int, client *peerRESTClient) { defer wg.Done() // T...
[ "func", "(", "sys", "*", "NotificationSys", ")", "ServerInfo", "(", "ctx", "context", ".", "Context", ")", "[", "]", "ServerInfo", "{", "serverInfo", ":=", "make", "(", "[", "]", "ServerInfo", ",", "len", "(", "sys", ".", "peerClients", ")", ")", "\n",...
// ServerInfo - calls ServerInfo RPC call on all peers.
[ "ServerInfo", "-", "calls", "ServerInfo", "RPC", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L297-L337
125,670
minio/minio
cmd/notification.go
GetLocks
func (sys *NotificationSys) GetLocks(ctx context.Context) []*PeerLocks { locksResp := make([]*PeerLocks, len(sys.peerClients)) var wg sync.WaitGroup for index, client := range sys.peerClients { if client == nil { continue } wg.Add(1) go func(idx int, client *peerRESTClient) { defer wg.Done() // Try...
go
func (sys *NotificationSys) GetLocks(ctx context.Context) []*PeerLocks { locksResp := make([]*PeerLocks, len(sys.peerClients)) var wg sync.WaitGroup for index, client := range sys.peerClients { if client == nil { continue } wg.Add(1) go func(idx int, client *peerRESTClient) { defer wg.Done() // Try...
[ "func", "(", "sys", "*", "NotificationSys", ")", "GetLocks", "(", "ctx", "context", ".", "Context", ")", "[", "]", "*", "PeerLocks", "{", "locksResp", ":=", "make", "(", "[", "]", "*", "PeerLocks", ",", "len", "(", "sys", ".", "peerClients", ")", ")"...
// GetLocks - makes GetLocks RPC call on all peers.
[ "GetLocks", "-", "makes", "GetLocks", "RPC", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L340-L377
125,671
minio/minio
cmd/notification.go
SetBucketPolicy
func (sys *NotificationSys) SetBucketPolicy(ctx context.Context, bucketName string, bucketPolicy *policy.Policy) { go func() { var wg sync.WaitGroup for _, client := range sys.peerClients { if client == nil { continue } wg.Add(1) go func(client *peerRESTClient) { defer wg.Done() if err := c...
go
func (sys *NotificationSys) SetBucketPolicy(ctx context.Context, bucketName string, bucketPolicy *policy.Policy) { go func() { var wg sync.WaitGroup for _, client := range sys.peerClients { if client == nil { continue } wg.Add(1) go func(client *peerRESTClient) { defer wg.Done() if err := c...
[ "func", "(", "sys", "*", "NotificationSys", ")", "SetBucketPolicy", "(", "ctx", "context", ".", "Context", ",", "bucketName", "string", ",", "bucketPolicy", "*", "policy", ".", "Policy", ")", "{", "go", "func", "(", ")", "{", "var", "wg", "sync", ".", ...
// SetBucketPolicy - calls SetBucketPolicy RPC call on all peers.
[ "SetBucketPolicy", "-", "calls", "SetBucketPolicy", "RPC", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L380-L398
125,672
minio/minio
cmd/notification.go
ListenBucketNotification
func (sys *NotificationSys) ListenBucketNotification(ctx context.Context, bucketName string, eventNames []event.Name, pattern string, targetID event.TargetID, localPeer xnet.Host) { go func() { var wg sync.WaitGroup for _, client := range sys.peerClients { if client == nil { continue } wg.Add(1) g...
go
func (sys *NotificationSys) ListenBucketNotification(ctx context.Context, bucketName string, eventNames []event.Name, pattern string, targetID event.TargetID, localPeer xnet.Host) { go func() { var wg sync.WaitGroup for _, client := range sys.peerClients { if client == nil { continue } wg.Add(1) g...
[ "func", "(", "sys", "*", "NotificationSys", ")", "ListenBucketNotification", "(", "ctx", "context", ".", "Context", ",", "bucketName", "string", ",", "eventNames", "[", "]", "event", ".", "Name", ",", "pattern", "string", ",", "targetID", "event", ".", "Targ...
// ListenBucketNotification - calls ListenBucketNotification RPC call on all peers.
[ "ListenBucketNotification", "-", "calls", "ListenBucketNotification", "RPC", "call", "on", "all", "peers", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L443-L462
125,673
minio/minio
cmd/notification.go
initListeners
func (sys *NotificationSys) initListeners(ctx context.Context, objAPI ObjectLayer, bucketName string) error { // listener.json is available/applicable only in DistXL mode. if !globalIsDistXL { return nil } // Construct path to listener.json for the given bucket. configFile := path.Join(bucketConfigPrefix, bucke...
go
func (sys *NotificationSys) initListeners(ctx context.Context, objAPI ObjectLayer, bucketName string) error { // listener.json is available/applicable only in DistXL mode. if !globalIsDistXL { return nil } // Construct path to listener.json for the given bucket. configFile := path.Join(bucketConfigPrefix, bucke...
[ "func", "(", "sys", "*", "NotificationSys", ")", "initListeners", "(", "ctx", "context", ".", "Context", ",", "objAPI", "ObjectLayer", ",", "bucketName", "string", ")", "error", "{", "// listener.json is available/applicable only in DistXL mode.", "if", "!", "globalIs...
// initListeners - initializes PeerREST clients available in listener.json.
[ "initListeners", "-", "initializes", "PeerREST", "clients", "available", "in", "listener", ".", "json", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L512-L587
125,674
minio/minio
cmd/notification.go
Init
func (sys *NotificationSys) Init(objAPI ObjectLayer) error { if objAPI == nil { return errInvalidArgument } doneCh := make(chan struct{}) defer close(doneCh) // Initializing notification needs a retry mechanism for // the following reasons: // - Read quorum is lost just after the initialization // of th...
go
func (sys *NotificationSys) Init(objAPI ObjectLayer) error { if objAPI == nil { return errInvalidArgument } doneCh := make(chan struct{}) defer close(doneCh) // Initializing notification needs a retry mechanism for // the following reasons: // - Read quorum is lost just after the initialization // of th...
[ "func", "(", "sys", "*", "NotificationSys", ")", "Init", "(", "objAPI", "ObjectLayer", ")", "error", "{", "if", "objAPI", "==", "nil", "{", "return", "errInvalidArgument", "\n", "}", "\n\n", "doneCh", ":=", "make", "(", "chan", "struct", "{", "}", ")", ...
// Init - initializes notification system from notification.xml and listener.json of all buckets.
[ "Init", "-", "initializes", "notification", "system", "from", "notification", ".", "xml", "and", "listener", ".", "json", "of", "all", "buckets", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L612-L637
125,675
minio/minio
cmd/notification.go
AddRulesMap
func (sys *NotificationSys) AddRulesMap(bucketName string, rulesMap event.RulesMap) { sys.Lock() defer sys.Unlock() rulesMap = rulesMap.Clone() for _, targetRulesMap := range sys.bucketRemoteTargetRulesMap[bucketName] { rulesMap.Add(targetRulesMap) } // Do not add for an empty rulesMap. if len(rulesMap) == ...
go
func (sys *NotificationSys) AddRulesMap(bucketName string, rulesMap event.RulesMap) { sys.Lock() defer sys.Unlock() rulesMap = rulesMap.Clone() for _, targetRulesMap := range sys.bucketRemoteTargetRulesMap[bucketName] { rulesMap.Add(targetRulesMap) } // Do not add for an empty rulesMap. if len(rulesMap) == ...
[ "func", "(", "sys", "*", "NotificationSys", ")", "AddRulesMap", "(", "bucketName", "string", ",", "rulesMap", "event", ".", "RulesMap", ")", "{", "sys", ".", "Lock", "(", ")", "\n", "defer", "sys", ".", "Unlock", "(", ")", "\n\n", "rulesMap", "=", "rul...
// AddRulesMap - adds rules map for bucket name.
[ "AddRulesMap", "-", "adds", "rules", "map", "for", "bucket", "name", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L640-L656
125,676
minio/minio
cmd/notification.go
RemoveRulesMap
func (sys *NotificationSys) RemoveRulesMap(bucketName string, rulesMap event.RulesMap) { sys.Lock() defer sys.Unlock() sys.bucketRulesMap[bucketName].Remove(rulesMap) if len(sys.bucketRulesMap[bucketName]) == 0 { delete(sys.bucketRulesMap, bucketName) } }
go
func (sys *NotificationSys) RemoveRulesMap(bucketName string, rulesMap event.RulesMap) { sys.Lock() defer sys.Unlock() sys.bucketRulesMap[bucketName].Remove(rulesMap) if len(sys.bucketRulesMap[bucketName]) == 0 { delete(sys.bucketRulesMap, bucketName) } }
[ "func", "(", "sys", "*", "NotificationSys", ")", "RemoveRulesMap", "(", "bucketName", "string", ",", "rulesMap", "event", ".", "RulesMap", ")", "{", "sys", ".", "Lock", "(", ")", "\n", "defer", "sys", ".", "Unlock", "(", ")", "\n\n", "sys", ".", "bucke...
// RemoveRulesMap - removes rules map for bucket name.
[ "RemoveRulesMap", "-", "removes", "rules", "map", "for", "bucket", "name", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L659-L667
125,677
minio/minio
cmd/notification.go
RemoveNotification
func (sys *NotificationSys) RemoveNotification(bucketName string) { sys.Lock() defer sys.Unlock() delete(sys.bucketRulesMap, bucketName) for targetID := range sys.bucketRemoteTargetRulesMap[bucketName] { sys.targetList.Remove(targetID) delete(sys.bucketRemoteTargetRulesMap[bucketName], targetID) } delete(s...
go
func (sys *NotificationSys) RemoveNotification(bucketName string) { sys.Lock() defer sys.Unlock() delete(sys.bucketRulesMap, bucketName) for targetID := range sys.bucketRemoteTargetRulesMap[bucketName] { sys.targetList.Remove(targetID) delete(sys.bucketRemoteTargetRulesMap[bucketName], targetID) } delete(s...
[ "func", "(", "sys", "*", "NotificationSys", ")", "RemoveNotification", "(", "bucketName", "string", ")", "{", "sys", ".", "Lock", "(", ")", "\n", "defer", "sys", ".", "Unlock", "(", ")", "\n\n", "delete", "(", "sys", ".", "bucketRulesMap", ",", "bucketNa...
// RemoveNotification - removes all notification configuration for bucket name.
[ "RemoveNotification", "-", "removes", "all", "notification", "configuration", "for", "bucket", "name", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L670-L682
125,678
minio/minio
cmd/notification.go
RemoveRemoteTarget
func (sys *NotificationSys) RemoveRemoteTarget(bucketName string, targetID event.TargetID) { for terr := range sys.targetList.Remove(targetID) { reqInfo := (&logger.ReqInfo{}).AppendTags("targetID", terr.ID.Name) ctx := logger.SetReqInfo(context.Background(), reqInfo) logger.LogIf(ctx, terr.Err) } sys.Lock() ...
go
func (sys *NotificationSys) RemoveRemoteTarget(bucketName string, targetID event.TargetID) { for terr := range sys.targetList.Remove(targetID) { reqInfo := (&logger.ReqInfo{}).AppendTags("targetID", terr.ID.Name) ctx := logger.SetReqInfo(context.Background(), reqInfo) logger.LogIf(ctx, terr.Err) } sys.Lock() ...
[ "func", "(", "sys", "*", "NotificationSys", ")", "RemoveRemoteTarget", "(", "bucketName", "string", ",", "targetID", "event", ".", "TargetID", ")", "{", "for", "terr", ":=", "range", "sys", ".", "targetList", ".", "Remove", "(", "targetID", ")", "{", "reqI...
// RemoveRemoteTarget - closes and removes target by target ID.
[ "RemoveRemoteTarget", "-", "closes", "and", "removes", "target", "by", "target", "ID", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L694-L710
125,679
minio/minio
cmd/notification.go
Send
func (sys *NotificationSys) Send(args eventArgs) []event.TargetIDErr { sys.RLock() targetIDSet := sys.bucketRulesMap[args.BucketName].Match(args.EventName, args.Object.Name) sys.RUnlock() if len(targetIDSet) == 0 { return nil } targetIDs := targetIDSet.ToSlice() return sys.send(args.BucketName, args.ToEvent(...
go
func (sys *NotificationSys) Send(args eventArgs) []event.TargetIDErr { sys.RLock() targetIDSet := sys.bucketRulesMap[args.BucketName].Match(args.EventName, args.Object.Name) sys.RUnlock() if len(targetIDSet) == 0 { return nil } targetIDs := targetIDSet.ToSlice() return sys.send(args.BucketName, args.ToEvent(...
[ "func", "(", "sys", "*", "NotificationSys", ")", "Send", "(", "args", "eventArgs", ")", "[", "]", "event", ".", "TargetIDErr", "{", "sys", ".", "RLock", "(", ")", "\n", "targetIDSet", ":=", "sys", ".", "bucketRulesMap", "[", "args", ".", "BucketName", ...
// Send - sends event data to all matching targets.
[ "Send", "-", "sends", "event", "data", "to", "all", "matching", "targets", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L725-L736
125,680
minio/minio
cmd/notification.go
NewNotificationSys
func NewNotificationSys(config *serverConfig, endpoints EndpointList) *NotificationSys { targetList := getNotificationTargets(config) remoteHosts := getRemoteHosts(endpoints) remoteClients, err := getRestClients(remoteHosts) if err != nil { logger.FatalIf(err, "Unable to start notification sub system") } // bu...
go
func NewNotificationSys(config *serverConfig, endpoints EndpointList) *NotificationSys { targetList := getNotificationTargets(config) remoteHosts := getRemoteHosts(endpoints) remoteClients, err := getRestClients(remoteHosts) if err != nil { logger.FatalIf(err, "Unable to start notification sub system") } // bu...
[ "func", "NewNotificationSys", "(", "config", "*", "serverConfig", ",", "endpoints", "EndpointList", ")", "*", "NotificationSys", "{", "targetList", ":=", "getNotificationTargets", "(", "config", ")", "\n", "remoteHosts", ":=", "getRemoteHosts", "(", "endpoints", ")"...
// NewNotificationSys - creates new notification system object.
[ "NewNotificationSys", "-", "creates", "new", "notification", "system", "object", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L817-L832
125,681
minio/minio
cmd/notification.go
ToEvent
func (args eventArgs) ToEvent() event.Event { getOriginEndpoint := func() string { host := globalMinioHost if host == "" { // FIXME: Send FQDN or hostname of this machine than sending IP address. host = sortIPs(localIP4.ToSlice())[0] } return fmt.Sprintf("%s://%s", getURLScheme(globalIsSSL), net.JoinHos...
go
func (args eventArgs) ToEvent() event.Event { getOriginEndpoint := func() string { host := globalMinioHost if host == "" { // FIXME: Send FQDN or hostname of this machine than sending IP address. host = sortIPs(localIP4.ToSlice())[0] } return fmt.Sprintf("%s://%s", getURLScheme(globalIsSSL), net.JoinHos...
[ "func", "(", "args", "eventArgs", ")", "ToEvent", "(", ")", "event", ".", "Event", "{", "getOriginEndpoint", ":=", "func", "(", ")", "string", "{", "host", ":=", "globalMinioHost", "\n", "if", "host", "==", "\"", "\"", "{", "// FIXME: Send FQDN or hostname o...
// ToEvent - converts to notification event.
[ "ToEvent", "-", "converts", "to", "notification", "event", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L845-L910
125,682
minio/minio
cmd/notification.go
SaveListener
func SaveListener(objAPI ObjectLayer, bucketName string, eventNames []event.Name, pattern string, targetID event.TargetID, addr xnet.Host) error { // listener.json is available/applicable only in DistXL mode. if !globalIsDistXL { return nil } ctx := logger.SetReqInfo(context.Background(), &logger.ReqInfo{BucketN...
go
func SaveListener(objAPI ObjectLayer, bucketName string, eventNames []event.Name, pattern string, targetID event.TargetID, addr xnet.Host) error { // listener.json is available/applicable only in DistXL mode. if !globalIsDistXL { return nil } ctx := logger.SetReqInfo(context.Background(), &logger.ReqInfo{BucketN...
[ "func", "SaveListener", "(", "objAPI", "ObjectLayer", ",", "bucketName", "string", ",", "eventNames", "[", "]", "event", ".", "Name", ",", "pattern", "string", ",", "targetID", "event", ".", "TargetID", ",", "addr", "xnet", ".", "Host", ")", "error", "{", ...
// SaveListener - saves HTTP client currently listening for events to listener.json.
[ "SaveListener", "-", "saves", "HTTP", "client", "currently", "listening", "for", "events", "to", "listener", ".", "json", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/notification.go#L958-L1006
125,683
minio/minio
pkg/policy/condition/stringequalsignorecasefunc.go
newStringEqualsIgnoreCaseFunc
func newStringEqualsIgnoreCaseFunc(key Key, values ValueSet) (Function, error) { valueStrings, err := valuesToStringSlice(stringEqualsIgnoreCase, values) if err != nil { return nil, err } return NewStringEqualsIgnoreCaseFunc(key, valueStrings...) }
go
func newStringEqualsIgnoreCaseFunc(key Key, values ValueSet) (Function, error) { valueStrings, err := valuesToStringSlice(stringEqualsIgnoreCase, values) if err != nil { return nil, err } return NewStringEqualsIgnoreCaseFunc(key, valueStrings...) }
[ "func", "newStringEqualsIgnoreCaseFunc", "(", "key", "Key", ",", "values", "ValueSet", ")", "(", "Function", ",", "error", ")", "{", "valueStrings", ",", "err", ":=", "valuesToStringSlice", "(", "stringEqualsIgnoreCase", ",", "values", ")", "\n", "if", "err", ...
// newStringEqualsIgnoreCaseFunc - returns new StringEqualsIgnoreCase function.
[ "newStringEqualsIgnoreCaseFunc", "-", "returns", "new", "StringEqualsIgnoreCase", "function", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/stringequalsignorecasefunc.go#L123-L130
125,684
minio/minio
pkg/policy/condition/stringequalsignorecasefunc.go
NewStringEqualsIgnoreCaseFunc
func NewStringEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error) { sset := set.CreateStringSet(values...) if err := validateStringEqualsIgnoreCaseValues(stringEqualsIgnoreCase, key, sset); err != nil { return nil, err } return &stringEqualsIgnoreCaseFunc{key, sset}, nil }
go
func NewStringEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error) { sset := set.CreateStringSet(values...) if err := validateStringEqualsIgnoreCaseValues(stringEqualsIgnoreCase, key, sset); err != nil { return nil, err } return &stringEqualsIgnoreCaseFunc{key, sset}, nil }
[ "func", "NewStringEqualsIgnoreCaseFunc", "(", "key", "Key", ",", "values", "...", "string", ")", "(", "Function", ",", "error", ")", "{", "sset", ":=", "set", ".", "CreateStringSet", "(", "values", "...", ")", "\n", "if", "err", ":=", "validateStringEqualsIg...
// NewStringEqualsIgnoreCaseFunc - returns new StringEqualsIgnoreCase function.
[ "NewStringEqualsIgnoreCaseFunc", "-", "returns", "new", "StringEqualsIgnoreCase", "function", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/stringequalsignorecasefunc.go#L133-L140
125,685
minio/minio
pkg/policy/condition/stringequalsignorecasefunc.go
newStringNotEqualsIgnoreCaseFunc
func newStringNotEqualsIgnoreCaseFunc(key Key, values ValueSet) (Function, error) { valueStrings, err := valuesToStringSlice(stringNotEqualsIgnoreCase, values) if err != nil { return nil, err } return NewStringNotEqualsIgnoreCaseFunc(key, valueStrings...) }
go
func newStringNotEqualsIgnoreCaseFunc(key Key, values ValueSet) (Function, error) { valueStrings, err := valuesToStringSlice(stringNotEqualsIgnoreCase, values) if err != nil { return nil, err } return NewStringNotEqualsIgnoreCaseFunc(key, valueStrings...) }
[ "func", "newStringNotEqualsIgnoreCaseFunc", "(", "key", "Key", ",", "values", "ValueSet", ")", "(", "Function", ",", "error", ")", "{", "valueStrings", ",", "err", ":=", "valuesToStringSlice", "(", "stringNotEqualsIgnoreCase", ",", "values", ")", "\n", "if", "er...
// newStringNotEqualsIgnoreCaseFunc - returns new StringNotEqualsIgnoreCase function.
[ "newStringNotEqualsIgnoreCaseFunc", "-", "returns", "new", "StringNotEqualsIgnoreCase", "function", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/stringequalsignorecasefunc.go#L143-L150
125,686
minio/minio
pkg/policy/condition/stringequalsignorecasefunc.go
NewStringNotEqualsIgnoreCaseFunc
func NewStringNotEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error) { sset := set.CreateStringSet(values...) if err := validateStringEqualsIgnoreCaseValues(stringNotEqualsIgnoreCase, key, sset); err != nil { return nil, err } return &stringNotEqualsIgnoreCaseFunc{stringEqualsIgnoreCaseFunc{key, ss...
go
func NewStringNotEqualsIgnoreCaseFunc(key Key, values ...string) (Function, error) { sset := set.CreateStringSet(values...) if err := validateStringEqualsIgnoreCaseValues(stringNotEqualsIgnoreCase, key, sset); err != nil { return nil, err } return &stringNotEqualsIgnoreCaseFunc{stringEqualsIgnoreCaseFunc{key, ss...
[ "func", "NewStringNotEqualsIgnoreCaseFunc", "(", "key", "Key", ",", "values", "...", "string", ")", "(", "Function", ",", "error", ")", "{", "sset", ":=", "set", ".", "CreateStringSet", "(", "values", "...", ")", "\n", "if", "err", ":=", "validateStringEqual...
// NewStringNotEqualsIgnoreCaseFunc - returns new StringNotEqualsIgnoreCase function.
[ "NewStringNotEqualsIgnoreCaseFunc", "-", "returns", "new", "StringNotEqualsIgnoreCase", "function", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/pkg/policy/condition/stringequalsignorecasefunc.go#L153-L160
125,687
minio/minio
cmd/namespace-lock.go
newDsyncNodes
func newDsyncNodes(endpoints EndpointList) (clnts []dsync.NetLocker, myNode int) { myNode = -1 seenHosts := set.NewStringSet() for _, endpoint := range endpoints { if seenHosts.Contains(endpoint.Host) { continue } seenHosts.Add(endpoint.Host) var locker dsync.NetLocker if endpoint.IsLocal { myNode =...
go
func newDsyncNodes(endpoints EndpointList) (clnts []dsync.NetLocker, myNode int) { myNode = -1 seenHosts := set.NewStringSet() for _, endpoint := range endpoints { if seenHosts.Contains(endpoint.Host) { continue } seenHosts.Add(endpoint.Host) var locker dsync.NetLocker if endpoint.IsLocal { myNode =...
[ "func", "newDsyncNodes", "(", "endpoints", "EndpointList", ")", "(", "clnts", "[", "]", "dsync", ".", "NetLocker", ",", "myNode", "int", ")", "{", "myNode", "=", "-", "1", "\n", "seenHosts", ":=", "set", ".", "NewStringSet", "(", ")", "\n", "for", "_",...
// Initialize distributed locking only in case of distributed setup. // Returns lock clients and the node index for the current server.
[ "Initialize", "distributed", "locking", "only", "in", "case", "of", "distributed", "setup", ".", "Returns", "lock", "clients", "and", "the", "node", "index", "for", "the", "current", "server", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L56-L89
125,688
minio/minio
cmd/namespace-lock.go
newNSLock
func newNSLock(isDistXL bool) *nsLockMap { nsMutex := nsLockMap{ isDistXL: isDistXL, } if isDistXL { return &nsMutex } nsMutex.lockMap = make(map[nsParam]*nsLock) return &nsMutex }
go
func newNSLock(isDistXL bool) *nsLockMap { nsMutex := nsLockMap{ isDistXL: isDistXL, } if isDistXL { return &nsMutex } nsMutex.lockMap = make(map[nsParam]*nsLock) return &nsMutex }
[ "func", "newNSLock", "(", "isDistXL", "bool", ")", "*", "nsLockMap", "{", "nsMutex", ":=", "nsLockMap", "{", "isDistXL", ":", "isDistXL", ",", "}", "\n", "if", "isDistXL", "{", "return", "&", "nsMutex", "\n", "}", "\n", "nsMutex", ".", "lockMap", "=", ...
// newNSLock - return a new name space lock map.
[ "newNSLock", "-", "return", "a", "new", "name", "space", "lock", "map", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L92-L101
125,689
minio/minio
cmd/namespace-lock.go
lock
func (n *nsLockMap) lock(volume, path string, lockSource, opsID string, readLock bool, timeout time.Duration) (locked bool) { var nsLk *nsLock n.lockMapMutex.Lock() param := nsParam{volume, path} nsLk, found := n.lockMap[param] if !found { n.lockMap[param] = &nsLock{ LRWMutex: &lsync.LRWMutex{}, ref: ...
go
func (n *nsLockMap) lock(volume, path string, lockSource, opsID string, readLock bool, timeout time.Duration) (locked bool) { var nsLk *nsLock n.lockMapMutex.Lock() param := nsParam{volume, path} nsLk, found := n.lockMap[param] if !found { n.lockMap[param] = &nsLock{ LRWMutex: &lsync.LRWMutex{}, ref: ...
[ "func", "(", "n", "*", "nsLockMap", ")", "lock", "(", "volume", ",", "path", "string", ",", "lockSource", ",", "opsID", "string", ",", "readLock", "bool", ",", "timeout", "time", ".", "Duration", ")", "(", "locked", "bool", ")", "{", "var", "nsLk", "...
// Lock the namespace resource.
[ "Lock", "the", "namespace", "resource", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L130-L167
125,690
minio/minio
cmd/namespace-lock.go
unlock
func (n *nsLockMap) unlock(volume, path, opsID string, readLock bool) { param := nsParam{volume, path} n.lockMapMutex.RLock() nsLk, found := n.lockMap[param] n.lockMapMutex.RUnlock() if !found { return } if readLock { nsLk.RUnlock() } else { nsLk.Unlock() } n.lockMapMutex.Lock() if nsLk.ref == 0 { lo...
go
func (n *nsLockMap) unlock(volume, path, opsID string, readLock bool) { param := nsParam{volume, path} n.lockMapMutex.RLock() nsLk, found := n.lockMap[param] n.lockMapMutex.RUnlock() if !found { return } if readLock { nsLk.RUnlock() } else { nsLk.Unlock() } n.lockMapMutex.Lock() if nsLk.ref == 0 { lo...
[ "func", "(", "n", "*", "nsLockMap", ")", "unlock", "(", "volume", ",", "path", ",", "opsID", "string", ",", "readLock", "bool", ")", "{", "param", ":=", "nsParam", "{", "volume", ",", "path", "}", "\n", "n", ".", "lockMapMutex", ".", "RLock", "(", ...
// Unlock the namespace resource.
[ "Unlock", "the", "namespace", "resource", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L170-L194
125,691
minio/minio
cmd/namespace-lock.go
Lock
func (n *nsLockMap) Lock(volume, path, opsID string, timeout time.Duration) (locked bool) { readLock := false // This is a write lock. lockSource := getSource() // Useful for debugging return n.lock(volume, path, lockSource, opsID, readLock, timeout) }
go
func (n *nsLockMap) Lock(volume, path, opsID string, timeout time.Duration) (locked bool) { readLock := false // This is a write lock. lockSource := getSource() // Useful for debugging return n.lock(volume, path, lockSource, opsID, readLock, timeout) }
[ "func", "(", "n", "*", "nsLockMap", ")", "Lock", "(", "volume", ",", "path", ",", "opsID", "string", ",", "timeout", "time", ".", "Duration", ")", "(", "locked", "bool", ")", "{", "readLock", ":=", "false", "// This is a write lock.", "\n\n", "lockSource",...
// Lock - locks the given resource for writes, using a previously // allocated name space lock or initializing a new one.
[ "Lock", "-", "locks", "the", "given", "resource", "for", "writes", "using", "a", "previously", "allocated", "name", "space", "lock", "or", "initializing", "a", "new", "one", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L198-L203
125,692
minio/minio
cmd/namespace-lock.go
Unlock
func (n *nsLockMap) Unlock(volume, path, opsID string) { readLock := false n.unlock(volume, path, opsID, readLock) }
go
func (n *nsLockMap) Unlock(volume, path, opsID string) { readLock := false n.unlock(volume, path, opsID, readLock) }
[ "func", "(", "n", "*", "nsLockMap", ")", "Unlock", "(", "volume", ",", "path", ",", "opsID", "string", ")", "{", "readLock", ":=", "false", "\n", "n", ".", "unlock", "(", "volume", ",", "path", ",", "opsID", ",", "readLock", ")", "\n", "}" ]
// Unlock - unlocks any previously acquired write locks.
[ "Unlock", "-", "unlocks", "any", "previously", "acquired", "write", "locks", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L206-L209
125,693
minio/minio
cmd/namespace-lock.go
RLock
func (n *nsLockMap) RLock(volume, path, opsID string, timeout time.Duration) (locked bool) { readLock := true lockSource := getSource() // Useful for debugging return n.lock(volume, path, lockSource, opsID, readLock, timeout) }
go
func (n *nsLockMap) RLock(volume, path, opsID string, timeout time.Duration) (locked bool) { readLock := true lockSource := getSource() // Useful for debugging return n.lock(volume, path, lockSource, opsID, readLock, timeout) }
[ "func", "(", "n", "*", "nsLockMap", ")", "RLock", "(", "volume", ",", "path", ",", "opsID", "string", ",", "timeout", "time", ".", "Duration", ")", "(", "locked", "bool", ")", "{", "readLock", ":=", "true", "\n\n", "lockSource", ":=", "getSource", "(",...
// RLock - locks any previously acquired read locks.
[ "RLock", "-", "locks", "any", "previously", "acquired", "read", "locks", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L212-L217
125,694
minio/minio
cmd/namespace-lock.go
RUnlock
func (n *nsLockMap) RUnlock(volume, path, opsID string) { readLock := true n.unlock(volume, path, opsID, readLock) }
go
func (n *nsLockMap) RUnlock(volume, path, opsID string) { readLock := true n.unlock(volume, path, opsID, readLock) }
[ "func", "(", "n", "*", "nsLockMap", ")", "RUnlock", "(", "volume", ",", "path", ",", "opsID", "string", ")", "{", "readLock", ":=", "true", "\n", "n", ".", "unlock", "(", "volume", ",", "path", ",", "opsID", ",", "readLock", ")", "\n", "}" ]
// RUnlock - unlocks any previously acquired read locks.
[ "RUnlock", "-", "unlocks", "any", "previously", "acquired", "read", "locks", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L220-L223
125,695
minio/minio
cmd/namespace-lock.go
ForceUnlock
func (n *nsLockMap) ForceUnlock(volume, path string) { n.lockMapMutex.Lock() defer n.lockMapMutex.Unlock() // Clarification on operation: // - In case of FS or XL we call ForceUnlock on the local globalNSMutex // (since there is only a single server) which will cause the 'stuck' // mutex to be removed from t...
go
func (n *nsLockMap) ForceUnlock(volume, path string) { n.lockMapMutex.Lock() defer n.lockMapMutex.Unlock() // Clarification on operation: // - In case of FS or XL we call ForceUnlock on the local globalNSMutex // (since there is only a single server) which will cause the 'stuck' // mutex to be removed from t...
[ "func", "(", "n", "*", "nsLockMap", ")", "ForceUnlock", "(", "volume", ",", "path", "string", ")", "{", "n", ".", "lockMapMutex", ".", "Lock", "(", ")", "\n", "defer", "n", ".", "lockMapMutex", ".", "Unlock", "(", ")", "\n\n", "// Clarification on operat...
// ForceUnlock - forcefully unlock a lock based on name.
[ "ForceUnlock", "-", "forcefully", "unlock", "a", "lock", "based", "on", "name", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L226-L249
125,696
minio/minio
cmd/namespace-lock.go
GetRLock
func (di *distLockInstance) GetRLock(timeout *dynamicTimeout) (timedOutErr error) { lockSource := getSource() start := UTCNow() if !di.rwMutex.GetRLock(di.opsID, lockSource, timeout.Timeout()) { timeout.LogFailure() return OperationTimedOut{Path: di.path} } timeout.LogSuccess(UTCNow().Sub(start)) return nil }
go
func (di *distLockInstance) GetRLock(timeout *dynamicTimeout) (timedOutErr error) { lockSource := getSource() start := UTCNow() if !di.rwMutex.GetRLock(di.opsID, lockSource, timeout.Timeout()) { timeout.LogFailure() return OperationTimedOut{Path: di.path} } timeout.LogSuccess(UTCNow().Sub(start)) return nil }
[ "func", "(", "di", "*", "distLockInstance", ")", "GetRLock", "(", "timeout", "*", "dynamicTimeout", ")", "(", "timedOutErr", "error", ")", "{", "lockSource", ":=", "getSource", "(", ")", "\n", "start", ":=", "UTCNow", "(", ")", "\n", "if", "!", "di", "...
// RLock - block until read lock is taken or timeout has occurred.
[ "RLock", "-", "block", "until", "read", "lock", "is", "taken", "or", "timeout", "has", "occurred", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L276-L285
125,697
minio/minio
cmd/namespace-lock.go
NewNSLock
func (n *nsLockMap) NewNSLock(volume, path string) RWLocker { opsID := mustGetUUID() if n.isDistXL { return &distLockInstance{dsync.NewDRWMutex(pathJoin(volume, path), globalDsync), volume, path, opsID} } return &localLockInstance{n, volume, path, opsID} }
go
func (n *nsLockMap) NewNSLock(volume, path string) RWLocker { opsID := mustGetUUID() if n.isDistXL { return &distLockInstance{dsync.NewDRWMutex(pathJoin(volume, path), globalDsync), volume, path, opsID} } return &localLockInstance{n, volume, path, opsID} }
[ "func", "(", "n", "*", "nsLockMap", ")", "NewNSLock", "(", "volume", ",", "path", "string", ")", "RWLocker", "{", "opsID", ":=", "mustGetUUID", "(", ")", "\n", "if", "n", ".", "isDistXL", "{", "return", "&", "distLockInstance", "{", "dsync", ".", "NewD...
// NewNSLock - returns a lock instance for a given volume and // path. The returned lockInstance object encapsulates the nsLockMap, // volume, path and operation ID.
[ "NewNSLock", "-", "returns", "a", "lock", "instance", "for", "a", "given", "volume", "and", "path", ".", "The", "returned", "lockInstance", "object", "encapsulates", "the", "nsLockMap", "volume", "path", "and", "operation", "ID", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L301-L307
125,698
minio/minio
cmd/namespace-lock.go
GetLock
func (li *localLockInstance) GetLock(timeout *dynamicTimeout) (timedOutErr error) { lockSource := getSource() start := UTCNow() readLock := false if !li.ns.lock(li.volume, li.path, lockSource, li.opsID, readLock, timeout.Timeout()) { timeout.LogFailure() return OperationTimedOut{Path: li.path} } timeout.LogSu...
go
func (li *localLockInstance) GetLock(timeout *dynamicTimeout) (timedOutErr error) { lockSource := getSource() start := UTCNow() readLock := false if !li.ns.lock(li.volume, li.path, lockSource, li.opsID, readLock, timeout.Timeout()) { timeout.LogFailure() return OperationTimedOut{Path: li.path} } timeout.LogSu...
[ "func", "(", "li", "*", "localLockInstance", ")", "GetLock", "(", "timeout", "*", "dynamicTimeout", ")", "(", "timedOutErr", "error", ")", "{", "lockSource", ":=", "getSource", "(", ")", "\n", "start", ":=", "UTCNow", "(", ")", "\n", "readLock", ":=", "f...
// Lock - block until write lock is taken or timeout has occurred.
[ "Lock", "-", "block", "until", "write", "lock", "is", "taken", "or", "timeout", "has", "occurred", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L310-L320
125,699
minio/minio
cmd/namespace-lock.go
Unlock
func (li *localLockInstance) Unlock() { readLock := false li.ns.unlock(li.volume, li.path, li.opsID, readLock) }
go
func (li *localLockInstance) Unlock() { readLock := false li.ns.unlock(li.volume, li.path, li.opsID, readLock) }
[ "func", "(", "li", "*", "localLockInstance", ")", "Unlock", "(", ")", "{", "readLock", ":=", "false", "\n", "li", ".", "ns", ".", "unlock", "(", "li", ".", "volume", ",", "li", ".", "path", ",", "li", ".", "opsID", ",", "readLock", ")", "\n", "}"...
// Unlock - block until write lock is released.
[ "Unlock", "-", "block", "until", "write", "lock", "is", "released", "." ]
4b858b562a0887e10bfd0414dc87e68f1af31c3a
https://github.com/minio/minio/blob/4b858b562a0887e10bfd0414dc87e68f1af31c3a/cmd/namespace-lock.go#L323-L326