1
0
mirror of https://github.com/minio/mc.git synced 2025-11-10 13:42:32 +03:00

Add admin lock command (#1942)

This commit is contained in:
Anis Elleuch
2017-01-06 10:29:49 +01:00
committed by Harshavardhana
parent 86777e7863
commit 7cec8f2285
14 changed files with 776 additions and 26 deletions

View File

@@ -21,6 +21,7 @@ import (
"io"
"math/rand"
"os"
"strings"
"time"
"github.com/minio/mc/pkg/console"
@@ -75,3 +76,14 @@ func dumpTLSCertificates(t *tls.ConnectionState) {
func isStdIO(reader io.Reader) bool {
return reader == os.Stdin || reader == os.Stdout || reader == os.Stderr
}
// splitStr splits a string into n parts, empty strings are added
// if we are not able to reach n elements
func splitStr(path, sep string, n int) []string {
splits := strings.SplitN(path, sep, n)
// Add empty strings if we found elements less than nr
for i := n - len(splits); i > 0; i-- {
splits = append(splits, "")
}
return splits
}