diff --git a/cmd/http-tracer.go b/cmd/http-tracer.go index b46a7668a..f1e5cb85e 100644 --- a/cmd/http-tracer.go +++ b/cmd/http-tracer.go @@ -32,8 +32,8 @@ import ( "github.com/gorilla/mux" "github.com/minio/minio/cmd/logger" + jsonrpc "github.com/minio/minio/contrib/pkg/rpc" "github.com/minio/minio/pkg/handlers" - jsonrpc "github.com/minio/minio/pkg/rpc" trace "github.com/minio/minio/pkg/trace" ) diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index 5ce444076..4dd9408e3 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -46,6 +46,7 @@ import ( "github.com/minio/minio/cmd/crypto" xhttp "github.com/minio/minio/cmd/http" "github.com/minio/minio/cmd/logger" + "github.com/minio/minio/contrib/pkg/rpc/json2" "github.com/minio/minio/pkg/auth" objectlock "github.com/minio/minio/pkg/bucket/object/lock" "github.com/minio/minio/pkg/bucket/policy" @@ -56,7 +57,6 @@ import ( "github.com/minio/minio/pkg/hash" iampolicy "github.com/minio/minio/pkg/iam/policy" "github.com/minio/minio/pkg/ioutil" - "github.com/minio/minio/pkg/rpc/json2" ) func extractBucketObject(args reflect.Value) (bucketName, objectName string) { diff --git a/cmd/web-router.go b/cmd/web-router.go index d193447e9..d089225ff 100644 --- a/cmd/web-router.go +++ b/cmd/web-router.go @@ -27,8 +27,8 @@ import ( "github.com/minio/minio/browser" "github.com/minio/minio/cmd/logger" - jsonrpc "github.com/minio/minio/pkg/rpc" - "github.com/minio/minio/pkg/rpc/json2" + jsonrpc "github.com/minio/minio/contrib/pkg/rpc" + "github.com/minio/minio/contrib/pkg/rpc/json2" ) // webAPI container for Web API. diff --git a/pkg/argon2/argon2.go b/contrib/pkg/argon2/argon2.go similarity index 96% rename from pkg/argon2/argon2.go rename to contrib/pkg/argon2/argon2.go index 90c048b61..5953f10ed 100644 --- a/pkg/argon2/argon2.go +++ b/contrib/pkg/argon2/argon2.go @@ -35,14 +35,8 @@ // [1] https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf // [2] https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-9.3 // -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://golang.org/x/crypto/argon2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. -// -// Modification here specifically adds sync.Pool reusable buffers to -// avoid large memory build up with frequent +// Modified to be used with MinIO. Modification here specifically adds +// sync.Pool reusable buffers to avoid large memory build up with frequent // allocations done by memory hard PBKDF. package argon2 diff --git a/pkg/argon2/argon2_test.go b/contrib/pkg/argon2/argon2_test.go similarity index 100% rename from pkg/argon2/argon2_test.go rename to contrib/pkg/argon2/argon2_test.go diff --git a/pkg/argon2/blake2b.go b/contrib/pkg/argon2/blake2b.go similarity index 100% rename from pkg/argon2/blake2b.go rename to contrib/pkg/argon2/blake2b.go diff --git a/pkg/argon2/blamka_amd64.go b/contrib/pkg/argon2/blamka_amd64.go similarity index 100% rename from pkg/argon2/blamka_amd64.go rename to contrib/pkg/argon2/blamka_amd64.go diff --git a/pkg/argon2/blamka_amd64.s b/contrib/pkg/argon2/blamka_amd64.s similarity index 100% rename from pkg/argon2/blamka_amd64.s rename to contrib/pkg/argon2/blamka_amd64.s diff --git a/pkg/argon2/blamka_generic.go b/contrib/pkg/argon2/blamka_generic.go similarity index 100% rename from pkg/argon2/blamka_generic.go rename to contrib/pkg/argon2/blamka_generic.go diff --git a/pkg/argon2/blamka_ref.go b/contrib/pkg/argon2/blamka_ref.go similarity index 100% rename from pkg/argon2/blamka_ref.go rename to contrib/pkg/argon2/blamka_ref.go diff --git a/pkg/csvparser/example_test.go b/contrib/pkg/csvparser/example_test.go similarity index 100% rename from pkg/csvparser/example_test.go rename to contrib/pkg/csvparser/example_test.go diff --git a/pkg/csvparser/fuzz.go b/contrib/pkg/csvparser/fuzz.go similarity index 100% rename from pkg/csvparser/fuzz.go rename to contrib/pkg/csvparser/fuzz.go diff --git a/pkg/csvparser/reader.go b/contrib/pkg/csvparser/reader.go similarity index 98% rename from pkg/csvparser/reader.go rename to contrib/pkg/csvparser/reader.go index 15102c464..39195bf68 100644 --- a/pkg/csvparser/reader.go +++ b/contrib/pkg/csvparser/reader.go @@ -50,13 +50,7 @@ // {`Multi-line // field`, `comma is ,`} // -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://golang.org/pkg/encoding/csv -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. -// -// Main modifications include +// Modified to be used with MinIO. Main modifications include // - Configurable 'quote' parameter // - Performance improvements // benchmark old ns/op new ns/op delta diff --git a/pkg/csvparser/reader_test.go b/contrib/pkg/csvparser/reader_test.go similarity index 100% rename from pkg/csvparser/reader_test.go rename to contrib/pkg/csvparser/reader_test.go diff --git a/pkg/csvparser/writer.go b/contrib/pkg/csvparser/writer.go similarity index 100% rename from pkg/csvparser/writer.go rename to contrib/pkg/csvparser/writer.go diff --git a/pkg/csvparser/writer_test.go b/contrib/pkg/csvparser/writer_test.go similarity index 100% rename from pkg/csvparser/writer_test.go rename to contrib/pkg/csvparser/writer_test.go diff --git a/pkg/rpc/LICENSE b/contrib/pkg/rpc/LICENSE similarity index 100% rename from pkg/rpc/LICENSE rename to contrib/pkg/rpc/LICENSE diff --git a/pkg/rpc/LICENSE.ORIG b/contrib/pkg/rpc/LICENSE.ORIG similarity index 100% rename from pkg/rpc/LICENSE.ORIG rename to contrib/pkg/rpc/LICENSE.ORIG diff --git a/pkg/rpc/README.md b/contrib/pkg/rpc/README.md similarity index 100% rename from pkg/rpc/README.md rename to contrib/pkg/rpc/README.md diff --git a/pkg/rpc/compression_selector.go b/contrib/pkg/rpc/compression_selector.go similarity index 88% rename from pkg/rpc/compression_selector.go rename to contrib/pkg/rpc/compression_selector.go index 35f716e0c..1a579c192 100644 --- a/pkg/rpc/compression_selector.go +++ b/contrib/pkg/rpc/compression_selector.go @@ -2,13 +2,9 @@ // Copyright 2012 The Gorilla Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE.ORIG file. -// -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package rpc diff --git a/pkg/rpc/doc.go b/contrib/pkg/rpc/doc.go similarity index 90% rename from pkg/rpc/doc.go rename to contrib/pkg/rpc/doc.go index c9a1fc6c8..ecd51f5c9 100644 --- a/pkg/rpc/doc.go +++ b/contrib/pkg/rpc/doc.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. +// Copyright 2021 MinIO, Inc. modified to be used with MinIO. // forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. /* Package rpc is a foundation for RPC over HTTP services, providing @@ -26,8 +23,8 @@ Let's setup a server and register a codec and service: import ( "http" - "github.com/minio/minio/pkg/rpc/" - "github.com/minio/minio/pkg/rpc/json2" + "github.com/minio/minio/contrib/pkg/rpc/" + "github.com/minio/minio/contrib/pkg/rpc/json2" ) func init() { diff --git a/pkg/rpc/encoder_selector.go b/contrib/pkg/rpc/encoder_selector.go similarity index 81% rename from pkg/rpc/encoder_selector.go rename to contrib/pkg/rpc/encoder_selector.go index 2a8739168..bc4a99035 100644 --- a/pkg/rpc/encoder_selector.go +++ b/contrib/pkg/rpc/encoder_selector.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2020 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package rpc diff --git a/pkg/rpc/json2/client.go b/contrib/pkg/rpc/json2/client.go similarity index 90% rename from pkg/rpc/json2/client.go rename to contrib/pkg/rpc/json2/client.go index e89dca478..87c7f0548 100644 --- a/pkg/rpc/json2/client.go +++ b/contrib/pkg/rpc/json2/client.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package json2 diff --git a/pkg/rpc/json2/error.go b/contrib/pkg/rpc/json2/error.go similarity index 81% rename from pkg/rpc/json2/error.go rename to contrib/pkg/rpc/json2/error.go index 41bb32811..4d3ac261c 100644 --- a/pkg/rpc/json2/error.go +++ b/contrib/pkg/rpc/json2/error.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package json2 diff --git a/pkg/rpc/json2/json_test.go b/contrib/pkg/rpc/json2/json_test.go similarity index 96% rename from pkg/rpc/json2/json_test.go rename to contrib/pkg/rpc/json2/json_test.go index 1968336ec..ea02830d5 100644 --- a/pkg/rpc/json2/json_test.go +++ b/contrib/pkg/rpc/json2/json_test.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package json2 @@ -19,7 +16,7 @@ import ( "strings" "testing" - "github.com/minio/minio/pkg/rpc" + "github.com/minio/minio/contrib/pkg/rpc" ) // ResponseRecorder is an implementation of http.ResponseWriter that diff --git a/pkg/rpc/json2/server.go b/contrib/pkg/rpc/json2/server.go similarity index 96% rename from pkg/rpc/json2/server.go rename to contrib/pkg/rpc/json2/server.go index a8acec6c5..a65040ee6 100644 --- a/pkg/rpc/json2/server.go +++ b/contrib/pkg/rpc/json2/server.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package json2 @@ -15,7 +12,7 @@ import ( "net/http" jsoniter "github.com/json-iterator/go" - "github.com/minio/minio/pkg/rpc" + "github.com/minio/minio/contrib/pkg/rpc" ) var null = jsoniter.RawMessage([]byte("null")) diff --git a/pkg/rpc/map.go b/contrib/pkg/rpc/map.go similarity index 95% rename from pkg/rpc/map.go rename to contrib/pkg/rpc/map.go index c5995ece1..4c7fa780b 100644 --- a/pkg/rpc/map.go +++ b/contrib/pkg/rpc/map.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package rpc diff --git a/pkg/rpc/server.go b/contrib/pkg/rpc/server.go similarity index 97% rename from pkg/rpc/server.go rename to contrib/pkg/rpc/server.go index f5b8074ab..3a20ffd00 100644 --- a/pkg/rpc/server.go +++ b/contrib/pkg/rpc/server.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package rpc diff --git a/pkg/rpc/server_test.go b/contrib/pkg/rpc/server_test.go similarity index 96% rename from pkg/rpc/server_test.go rename to contrib/pkg/rpc/server_test.go index a50d60651..98cc4bd88 100644 --- a/pkg/rpc/server_test.go +++ b/contrib/pkg/rpc/server_test.go @@ -3,11 +3,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Copyright 2021 MinIO, Inc. All rights reserved. -// forked from https://github.com/gorilla/rpc/v2 -// modified to be used with MinIO under GNU Affero General -// Public License 3.0 license that can be found in -// the LICENSE file. +// Modified to be used with MinIO, uses jsoniter and +// supports tracing JSON-rpc calls. package rpc diff --git a/pkg/madmin/encrypt.go b/pkg/madmin/encrypt.go index 6fb4caefc..74bb7d6a2 100644 --- a/pkg/madmin/encrypt.go +++ b/pkg/madmin/encrypt.go @@ -24,7 +24,7 @@ import ( "io" "io/ioutil" - "github.com/minio/minio/pkg/argon2" + "github.com/minio/minio/contrib/pkg/argon2" "github.com/minio/minio/pkg/fips" "github.com/secure-io/sio-go" "github.com/secure-io/sio-go/sioutil" diff --git a/pkg/s3select/csv/reader.go b/pkg/s3select/csv/reader.go index 78a0da233..787426ae9 100644 --- a/pkg/s3select/csv/reader.go +++ b/pkg/s3select/csv/reader.go @@ -26,7 +26,7 @@ import ( "sync" "unicode/utf8" - csv "github.com/minio/minio/pkg/csvparser" + csv "github.com/minio/minio/contrib/pkg/csvparser" "github.com/minio/minio/pkg/s3select/sql" ) diff --git a/pkg/s3select/csv/record.go b/pkg/s3select/csv/record.go index bf7e4a498..73eebb1d9 100644 --- a/pkg/s3select/csv/record.go +++ b/pkg/s3select/csv/record.go @@ -24,7 +24,7 @@ import ( "io" "github.com/bcicen/jstream" - csv "github.com/minio/minio/pkg/csvparser" + csv "github.com/minio/minio/contrib/pkg/csvparser" "github.com/minio/minio/pkg/s3select/sql" ) diff --git a/pkg/s3select/json/record.go b/pkg/s3select/json/record.go index 7e19cada6..707e61efc 100644 --- a/pkg/s3select/json/record.go +++ b/pkg/s3select/json/record.go @@ -27,7 +27,7 @@ import ( "strings" "github.com/bcicen/jstream" - csv "github.com/minio/minio/pkg/csvparser" + csv "github.com/minio/minio/contrib/pkg/csvparser" "github.com/minio/minio/pkg/s3select/sql" ) diff --git a/pkg/s3select/simdj/record.go b/pkg/s3select/simdj/record.go index b4254a3ae..404e44de8 100644 --- a/pkg/s3select/simdj/record.go +++ b/pkg/s3select/simdj/record.go @@ -21,9 +21,8 @@ import ( "fmt" "io" - csv "github.com/minio/minio/pkg/csvparser" - "github.com/bcicen/jstream" + csv "github.com/minio/minio/contrib/pkg/csvparser" "github.com/minio/minio/pkg/s3select/json" "github.com/minio/minio/pkg/s3select/sql" "github.com/minio/simdjson-go"