From 30fc14e7036d32416d5ec1f1c6ee13b8294ee2ac Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 3 Jul 2015 15:17:44 -0700 Subject: [PATCH] Restructure codebase move crypto, checksum to top-level, move ``split`` into donut, move crypto/keys into api/auth --- pkg/{utils => }/crypto/md5/md5.go | 0 pkg/{utils => }/crypto/md5/md5_test.go | 2 +- pkg/{utils => }/crypto/sha1/.gitignore | 0 pkg/{utils/checksum/crc32c => crypto/sha1}/LICENSE | 0 pkg/{utils => }/crypto/sha1/sha1_darwin.go | 0 pkg/{utils => }/crypto/sha1/sha1_linux.S | 0 pkg/{utils => }/crypto/sha1/sha1_linux.go | 0 pkg/{utils => }/crypto/sha1/sha1_sse3_amd64.asm | 0 pkg/{utils => }/crypto/sha1/sha1_test.go | 0 pkg/{utils => }/crypto/sha1/sha1_windows.go | 0 pkg/{utils => }/crypto/sha1/sha1_yasm_darwin.go | 0 pkg/{utils => }/crypto/sha1/sha1_yasm_linux.go | 0 pkg/{utils => }/crypto/sha1/sha1_yasm_windows.go | 0 pkg/{utils => }/crypto/sha1/sha1block_darwin.go | 0 pkg/{utils => }/crypto/sha1/sha1block_generic.go | 0 pkg/{utils => }/crypto/sha1/sha1block_linux.go | 0 pkg/{utils => }/crypto/sha1/sha1block_windows.go | 0 pkg/{utils/crypto/sha1 => crypto/sha256}/LICENSE | 0 pkg/{utils => }/crypto/sha256/sha256-avx-asm_linux.S | 0 pkg/{utils => }/crypto/sha256/sha256-avx2-asm_linux.S | 0 pkg/{utils => }/crypto/sha256/sha256-ssse3-asm_linux.S | 0 pkg/{utils => }/crypto/sha256/sha256_darwin.go | 0 pkg/{utils => }/crypto/sha256/sha256_linux.go | 0 pkg/{utils => }/crypto/sha256/sha256_linux_test.go | 0 pkg/{utils => }/crypto/sha256/sha256_windows.go | 0 pkg/{utils => }/crypto/sha256/sha256block_linux.go | 0 pkg/{utils/crypto/sha256 => crypto/sha512}/LICENSE | 0 pkg/{utils => }/crypto/sha512/sha512-avx-asm_linux.S | 0 pkg/{utils => }/crypto/sha512/sha512-avx2-asm_linux.S | 0 pkg/{utils => }/crypto/sha512/sha512-ssse3-asm_linux.S | 0 pkg/{utils => }/crypto/sha512/sha512_darwin.go | 0 pkg/{utils => }/crypto/sha512/sha512_linux.go | 0 pkg/{utils => }/crypto/sha512/sha512_linux_test.go | 0 pkg/{utils => }/crypto/sha512/sha512_windows.go | 0 pkg/{utils => }/crypto/sha512/sha512block_linux.go | 0 pkg/donut/bucket.go | 4 ++-- pkg/{utils => donut}/split/.gitignore | 0 pkg/{utils => donut}/split/split.go | 0 pkg/{utils => donut}/split/split_test.go | 2 +- pkg/{utils => donut}/split/testdata/TESTFILE | 0 pkg/{utils/crypto/sha512 => hash/crc32c}/LICENSE | 0 pkg/{utils/checksum => hash}/crc32c/crc32c_darwin.go | 0 pkg/{utils/checksum => hash}/crc32c/crc32c_intel_linux.go | 0 pkg/{utils/checksum => hash}/crc32c/crc32c_linux.S | 0 pkg/{utils/checksum => hash}/crc32c/crc32c_linux.go | 0 pkg/{utils/checksum => hash}/crc32c/crc32c_linux_test.go | 0 pkg/{utils/checksum => hash}/crc32c/crc32c_windows.go | 0 pkg/{utils/checksum => hash}/crc32c/doc.go | 0 pkg/{utils/crypto => server/api/auth}/keys/common.go | 0 pkg/{utils/crypto => server/api/auth}/keys/keys.go | 0 pkg/{utils/crypto => server/api/auth}/keys/keys_test.go | 2 +- pkg/server/api/generic-handlers.go | 2 +- 52 files changed, 6 insertions(+), 6 deletions(-) rename pkg/{utils => }/crypto/md5/md5.go (100%) rename pkg/{utils => }/crypto/md5/md5_test.go (90%) rename pkg/{utils => }/crypto/sha1/.gitignore (100%) rename pkg/{utils/checksum/crc32c => crypto/sha1}/LICENSE (100%) rename pkg/{utils => }/crypto/sha1/sha1_darwin.go (100%) rename pkg/{utils => }/crypto/sha1/sha1_linux.S (100%) rename pkg/{utils => }/crypto/sha1/sha1_linux.go (100%) rename pkg/{utils => }/crypto/sha1/sha1_sse3_amd64.asm (100%) rename pkg/{utils => }/crypto/sha1/sha1_test.go (100%) rename pkg/{utils => }/crypto/sha1/sha1_windows.go (100%) rename pkg/{utils => }/crypto/sha1/sha1_yasm_darwin.go (100%) rename pkg/{utils => }/crypto/sha1/sha1_yasm_linux.go (100%) rename pkg/{utils => }/crypto/sha1/sha1_yasm_windows.go (100%) rename pkg/{utils => }/crypto/sha1/sha1block_darwin.go (100%) rename pkg/{utils => }/crypto/sha1/sha1block_generic.go (100%) rename pkg/{utils => }/crypto/sha1/sha1block_linux.go (100%) rename pkg/{utils => }/crypto/sha1/sha1block_windows.go (100%) rename pkg/{utils/crypto/sha1 => crypto/sha256}/LICENSE (100%) rename pkg/{utils => }/crypto/sha256/sha256-avx-asm_linux.S (100%) rename pkg/{utils => }/crypto/sha256/sha256-avx2-asm_linux.S (100%) rename pkg/{utils => }/crypto/sha256/sha256-ssse3-asm_linux.S (100%) rename pkg/{utils => }/crypto/sha256/sha256_darwin.go (100%) rename pkg/{utils => }/crypto/sha256/sha256_linux.go (100%) rename pkg/{utils => }/crypto/sha256/sha256_linux_test.go (100%) rename pkg/{utils => }/crypto/sha256/sha256_windows.go (100%) rename pkg/{utils => }/crypto/sha256/sha256block_linux.go (100%) rename pkg/{utils/crypto/sha256 => crypto/sha512}/LICENSE (100%) rename pkg/{utils => }/crypto/sha512/sha512-avx-asm_linux.S (100%) rename pkg/{utils => }/crypto/sha512/sha512-avx2-asm_linux.S (100%) rename pkg/{utils => }/crypto/sha512/sha512-ssse3-asm_linux.S (100%) rename pkg/{utils => }/crypto/sha512/sha512_darwin.go (100%) rename pkg/{utils => }/crypto/sha512/sha512_linux.go (100%) rename pkg/{utils => }/crypto/sha512/sha512_linux_test.go (100%) rename pkg/{utils => }/crypto/sha512/sha512_windows.go (100%) rename pkg/{utils => }/crypto/sha512/sha512block_linux.go (100%) rename pkg/{utils => donut}/split/.gitignore (100%) rename pkg/{utils => donut}/split/split.go (100%) rename pkg/{utils => donut}/split/split_test.go (97%) rename pkg/{utils => donut}/split/testdata/TESTFILE (100%) rename pkg/{utils/crypto/sha512 => hash/crc32c}/LICENSE (100%) rename pkg/{utils/checksum => hash}/crc32c/crc32c_darwin.go (100%) rename pkg/{utils/checksum => hash}/crc32c/crc32c_intel_linux.go (100%) rename pkg/{utils/checksum => hash}/crc32c/crc32c_linux.S (100%) rename pkg/{utils/checksum => hash}/crc32c/crc32c_linux.go (100%) rename pkg/{utils/checksum => hash}/crc32c/crc32c_linux_test.go (100%) rename pkg/{utils/checksum => hash}/crc32c/crc32c_windows.go (100%) rename pkg/{utils/checksum => hash}/crc32c/doc.go (100%) rename pkg/{utils/crypto => server/api/auth}/keys/common.go (100%) rename pkg/{utils/crypto => server/api/auth}/keys/keys.go (100%) rename pkg/{utils/crypto => server/api/auth}/keys/keys_test.go (95%) diff --git a/pkg/utils/crypto/md5/md5.go b/pkg/crypto/md5/md5.go similarity index 100% rename from pkg/utils/crypto/md5/md5.go rename to pkg/crypto/md5/md5.go diff --git a/pkg/utils/crypto/md5/md5_test.go b/pkg/crypto/md5/md5_test.go similarity index 90% rename from pkg/utils/crypto/md5/md5_test.go rename to pkg/crypto/md5/md5_test.go index 1c0e14a6b..c39fdd6c6 100644 --- a/pkg/utils/crypto/md5/md5_test.go +++ b/pkg/crypto/md5/md5_test.go @@ -6,7 +6,7 @@ import ( "testing" . "github.com/minio/check" - "github.com/minio/minio/pkg/utils/crypto/md5" + "github.com/minio/minio/pkg/crypto/md5" ) func Test(t *testing.T) { TestingT(t) } diff --git a/pkg/utils/crypto/sha1/.gitignore b/pkg/crypto/sha1/.gitignore similarity index 100% rename from pkg/utils/crypto/sha1/.gitignore rename to pkg/crypto/sha1/.gitignore diff --git a/pkg/utils/checksum/crc32c/LICENSE b/pkg/crypto/sha1/LICENSE similarity index 100% rename from pkg/utils/checksum/crc32c/LICENSE rename to pkg/crypto/sha1/LICENSE diff --git a/pkg/utils/crypto/sha1/sha1_darwin.go b/pkg/crypto/sha1/sha1_darwin.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_darwin.go rename to pkg/crypto/sha1/sha1_darwin.go diff --git a/pkg/utils/crypto/sha1/sha1_linux.S b/pkg/crypto/sha1/sha1_linux.S similarity index 100% rename from pkg/utils/crypto/sha1/sha1_linux.S rename to pkg/crypto/sha1/sha1_linux.S diff --git a/pkg/utils/crypto/sha1/sha1_linux.go b/pkg/crypto/sha1/sha1_linux.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_linux.go rename to pkg/crypto/sha1/sha1_linux.go diff --git a/pkg/utils/crypto/sha1/sha1_sse3_amd64.asm b/pkg/crypto/sha1/sha1_sse3_amd64.asm similarity index 100% rename from pkg/utils/crypto/sha1/sha1_sse3_amd64.asm rename to pkg/crypto/sha1/sha1_sse3_amd64.asm diff --git a/pkg/utils/crypto/sha1/sha1_test.go b/pkg/crypto/sha1/sha1_test.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_test.go rename to pkg/crypto/sha1/sha1_test.go diff --git a/pkg/utils/crypto/sha1/sha1_windows.go b/pkg/crypto/sha1/sha1_windows.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_windows.go rename to pkg/crypto/sha1/sha1_windows.go diff --git a/pkg/utils/crypto/sha1/sha1_yasm_darwin.go b/pkg/crypto/sha1/sha1_yasm_darwin.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_yasm_darwin.go rename to pkg/crypto/sha1/sha1_yasm_darwin.go diff --git a/pkg/utils/crypto/sha1/sha1_yasm_linux.go b/pkg/crypto/sha1/sha1_yasm_linux.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_yasm_linux.go rename to pkg/crypto/sha1/sha1_yasm_linux.go diff --git a/pkg/utils/crypto/sha1/sha1_yasm_windows.go b/pkg/crypto/sha1/sha1_yasm_windows.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1_yasm_windows.go rename to pkg/crypto/sha1/sha1_yasm_windows.go diff --git a/pkg/utils/crypto/sha1/sha1block_darwin.go b/pkg/crypto/sha1/sha1block_darwin.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1block_darwin.go rename to pkg/crypto/sha1/sha1block_darwin.go diff --git a/pkg/utils/crypto/sha1/sha1block_generic.go b/pkg/crypto/sha1/sha1block_generic.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1block_generic.go rename to pkg/crypto/sha1/sha1block_generic.go diff --git a/pkg/utils/crypto/sha1/sha1block_linux.go b/pkg/crypto/sha1/sha1block_linux.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1block_linux.go rename to pkg/crypto/sha1/sha1block_linux.go diff --git a/pkg/utils/crypto/sha1/sha1block_windows.go b/pkg/crypto/sha1/sha1block_windows.go similarity index 100% rename from pkg/utils/crypto/sha1/sha1block_windows.go rename to pkg/crypto/sha1/sha1block_windows.go diff --git a/pkg/utils/crypto/sha1/LICENSE b/pkg/crypto/sha256/LICENSE similarity index 100% rename from pkg/utils/crypto/sha1/LICENSE rename to pkg/crypto/sha256/LICENSE diff --git a/pkg/utils/crypto/sha256/sha256-avx-asm_linux.S b/pkg/crypto/sha256/sha256-avx-asm_linux.S similarity index 100% rename from pkg/utils/crypto/sha256/sha256-avx-asm_linux.S rename to pkg/crypto/sha256/sha256-avx-asm_linux.S diff --git a/pkg/utils/crypto/sha256/sha256-avx2-asm_linux.S b/pkg/crypto/sha256/sha256-avx2-asm_linux.S similarity index 100% rename from pkg/utils/crypto/sha256/sha256-avx2-asm_linux.S rename to pkg/crypto/sha256/sha256-avx2-asm_linux.S diff --git a/pkg/utils/crypto/sha256/sha256-ssse3-asm_linux.S b/pkg/crypto/sha256/sha256-ssse3-asm_linux.S similarity index 100% rename from pkg/utils/crypto/sha256/sha256-ssse3-asm_linux.S rename to pkg/crypto/sha256/sha256-ssse3-asm_linux.S diff --git a/pkg/utils/crypto/sha256/sha256_darwin.go b/pkg/crypto/sha256/sha256_darwin.go similarity index 100% rename from pkg/utils/crypto/sha256/sha256_darwin.go rename to pkg/crypto/sha256/sha256_darwin.go diff --git a/pkg/utils/crypto/sha256/sha256_linux.go b/pkg/crypto/sha256/sha256_linux.go similarity index 100% rename from pkg/utils/crypto/sha256/sha256_linux.go rename to pkg/crypto/sha256/sha256_linux.go diff --git a/pkg/utils/crypto/sha256/sha256_linux_test.go b/pkg/crypto/sha256/sha256_linux_test.go similarity index 100% rename from pkg/utils/crypto/sha256/sha256_linux_test.go rename to pkg/crypto/sha256/sha256_linux_test.go diff --git a/pkg/utils/crypto/sha256/sha256_windows.go b/pkg/crypto/sha256/sha256_windows.go similarity index 100% rename from pkg/utils/crypto/sha256/sha256_windows.go rename to pkg/crypto/sha256/sha256_windows.go diff --git a/pkg/utils/crypto/sha256/sha256block_linux.go b/pkg/crypto/sha256/sha256block_linux.go similarity index 100% rename from pkg/utils/crypto/sha256/sha256block_linux.go rename to pkg/crypto/sha256/sha256block_linux.go diff --git a/pkg/utils/crypto/sha256/LICENSE b/pkg/crypto/sha512/LICENSE similarity index 100% rename from pkg/utils/crypto/sha256/LICENSE rename to pkg/crypto/sha512/LICENSE diff --git a/pkg/utils/crypto/sha512/sha512-avx-asm_linux.S b/pkg/crypto/sha512/sha512-avx-asm_linux.S similarity index 100% rename from pkg/utils/crypto/sha512/sha512-avx-asm_linux.S rename to pkg/crypto/sha512/sha512-avx-asm_linux.S diff --git a/pkg/utils/crypto/sha512/sha512-avx2-asm_linux.S b/pkg/crypto/sha512/sha512-avx2-asm_linux.S similarity index 100% rename from pkg/utils/crypto/sha512/sha512-avx2-asm_linux.S rename to pkg/crypto/sha512/sha512-avx2-asm_linux.S diff --git a/pkg/utils/crypto/sha512/sha512-ssse3-asm_linux.S b/pkg/crypto/sha512/sha512-ssse3-asm_linux.S similarity index 100% rename from pkg/utils/crypto/sha512/sha512-ssse3-asm_linux.S rename to pkg/crypto/sha512/sha512-ssse3-asm_linux.S diff --git a/pkg/utils/crypto/sha512/sha512_darwin.go b/pkg/crypto/sha512/sha512_darwin.go similarity index 100% rename from pkg/utils/crypto/sha512/sha512_darwin.go rename to pkg/crypto/sha512/sha512_darwin.go diff --git a/pkg/utils/crypto/sha512/sha512_linux.go b/pkg/crypto/sha512/sha512_linux.go similarity index 100% rename from pkg/utils/crypto/sha512/sha512_linux.go rename to pkg/crypto/sha512/sha512_linux.go diff --git a/pkg/utils/crypto/sha512/sha512_linux_test.go b/pkg/crypto/sha512/sha512_linux_test.go similarity index 100% rename from pkg/utils/crypto/sha512/sha512_linux_test.go rename to pkg/crypto/sha512/sha512_linux_test.go diff --git a/pkg/utils/crypto/sha512/sha512_windows.go b/pkg/crypto/sha512/sha512_windows.go similarity index 100% rename from pkg/utils/crypto/sha512/sha512_windows.go rename to pkg/crypto/sha512/sha512_windows.go diff --git a/pkg/utils/crypto/sha512/sha512block_linux.go b/pkg/crypto/sha512/sha512block_linux.go similarity index 100% rename from pkg/utils/crypto/sha512/sha512block_linux.go rename to pkg/crypto/sha512/sha512block_linux.go diff --git a/pkg/donut/bucket.go b/pkg/donut/bucket.go index ccc89ada8..fca6a5adb 100644 --- a/pkg/donut/bucket.go +++ b/pkg/donut/bucket.go @@ -31,9 +31,9 @@ import ( "encoding/hex" "encoding/json" + "github.com/minio/minio/pkg/crypto/sha512" + "github.com/minio/minio/pkg/donut/split" "github.com/minio/minio/pkg/iodine" - "github.com/minio/minio/pkg/utils/crypto/sha512" - "github.com/minio/minio/pkg/utils/split" ) const ( diff --git a/pkg/utils/split/.gitignore b/pkg/donut/split/.gitignore similarity index 100% rename from pkg/utils/split/.gitignore rename to pkg/donut/split/.gitignore diff --git a/pkg/utils/split/split.go b/pkg/donut/split/split.go similarity index 100% rename from pkg/utils/split/split.go rename to pkg/donut/split/split.go diff --git a/pkg/utils/split/split_test.go b/pkg/donut/split/split_test.go similarity index 97% rename from pkg/utils/split/split_test.go rename to pkg/donut/split/split_test.go index de84c0e32..569f6d02a 100644 --- a/pkg/utils/split/split_test.go +++ b/pkg/donut/split/split_test.go @@ -25,7 +25,7 @@ import ( "testing" . "github.com/minio/check" - "github.com/minio/minio/pkg/utils/split" + "github.com/minio/minio/pkg/donut/split" ) type MySuite struct{} diff --git a/pkg/utils/split/testdata/TESTFILE b/pkg/donut/split/testdata/TESTFILE similarity index 100% rename from pkg/utils/split/testdata/TESTFILE rename to pkg/donut/split/testdata/TESTFILE diff --git a/pkg/utils/crypto/sha512/LICENSE b/pkg/hash/crc32c/LICENSE similarity index 100% rename from pkg/utils/crypto/sha512/LICENSE rename to pkg/hash/crc32c/LICENSE diff --git a/pkg/utils/checksum/crc32c/crc32c_darwin.go b/pkg/hash/crc32c/crc32c_darwin.go similarity index 100% rename from pkg/utils/checksum/crc32c/crc32c_darwin.go rename to pkg/hash/crc32c/crc32c_darwin.go diff --git a/pkg/utils/checksum/crc32c/crc32c_intel_linux.go b/pkg/hash/crc32c/crc32c_intel_linux.go similarity index 100% rename from pkg/utils/checksum/crc32c/crc32c_intel_linux.go rename to pkg/hash/crc32c/crc32c_intel_linux.go diff --git a/pkg/utils/checksum/crc32c/crc32c_linux.S b/pkg/hash/crc32c/crc32c_linux.S similarity index 100% rename from pkg/utils/checksum/crc32c/crc32c_linux.S rename to pkg/hash/crc32c/crc32c_linux.S diff --git a/pkg/utils/checksum/crc32c/crc32c_linux.go b/pkg/hash/crc32c/crc32c_linux.go similarity index 100% rename from pkg/utils/checksum/crc32c/crc32c_linux.go rename to pkg/hash/crc32c/crc32c_linux.go diff --git a/pkg/utils/checksum/crc32c/crc32c_linux_test.go b/pkg/hash/crc32c/crc32c_linux_test.go similarity index 100% rename from pkg/utils/checksum/crc32c/crc32c_linux_test.go rename to pkg/hash/crc32c/crc32c_linux_test.go diff --git a/pkg/utils/checksum/crc32c/crc32c_windows.go b/pkg/hash/crc32c/crc32c_windows.go similarity index 100% rename from pkg/utils/checksum/crc32c/crc32c_windows.go rename to pkg/hash/crc32c/crc32c_windows.go diff --git a/pkg/utils/checksum/crc32c/doc.go b/pkg/hash/crc32c/doc.go similarity index 100% rename from pkg/utils/checksum/crc32c/doc.go rename to pkg/hash/crc32c/doc.go diff --git a/pkg/utils/crypto/keys/common.go b/pkg/server/api/auth/keys/common.go similarity index 100% rename from pkg/utils/crypto/keys/common.go rename to pkg/server/api/auth/keys/common.go diff --git a/pkg/utils/crypto/keys/keys.go b/pkg/server/api/auth/keys/keys.go similarity index 100% rename from pkg/utils/crypto/keys/keys.go rename to pkg/server/api/auth/keys/keys.go diff --git a/pkg/utils/crypto/keys/keys_test.go b/pkg/server/api/auth/keys/keys_test.go similarity index 95% rename from pkg/utils/crypto/keys/keys_test.go rename to pkg/server/api/auth/keys/keys_test.go index f3a6017b0..a3ecb9573 100644 --- a/pkg/utils/crypto/keys/keys_test.go +++ b/pkg/server/api/auth/keys/keys_test.go @@ -20,7 +20,7 @@ import ( "testing" . "github.com/minio/check" - "github.com/minio/minio/pkg/utils/crypto/keys" + "github.com/minio/minio/pkg/server/api/auth/keys" ) func Test(t *testing.T) { TestingT(t) } diff --git a/pkg/server/api/generic-handlers.go b/pkg/server/api/generic-handlers.go index 08f36f94d..bf21b6c43 100644 --- a/pkg/server/api/generic-handlers.go +++ b/pkg/server/api/generic-handlers.go @@ -26,7 +26,7 @@ import ( "time" "github.com/minio/minio/pkg/quick" - "github.com/minio/minio/pkg/utils/crypto/keys" + "github.com/minio/minio/pkg/server/api/auth/keys" ) type contentTypeHandler struct {