Disable lll linter
This commit is contained in:
parent
4c47900701
commit
5d02d74a49
6 changed files with 146 additions and 161 deletions
|
@ -8,7 +8,7 @@ before_install:
|
||||||
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
- go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- vgo mod -vendor
|
- vgo mod vendor
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make lint
|
- make lint
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -4,7 +4,7 @@ all:
|
||||||
go build ./cmd/s3manager
|
go build ./cmd/s3manager
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
golangci-lint run --enable-all
|
golangci-lint run --enable-all --disable lll
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test -race -cover ./...
|
go test -race -cover ./...
|
||||||
|
|
|
@ -9,7 +9,7 @@ A Web GUI written in Go to manage S3 buckets from any provider.
|
||||||
## Install Dependencies
|
## Install Dependencies
|
||||||
|
|
||||||
1. Install [vgo](https://github.com/golang/vgo)
|
1. Install [vgo](https://github.com/golang/vgo)
|
||||||
1. Run `vgo mod -vendor`
|
1. Run `vgo mod vendor`
|
||||||
|
|
||||||
## Build and Run Locally
|
## Build and Run Locally
|
||||||
|
|
||||||
|
|
11
go.mod
11
go.mod
|
@ -2,19 +2,14 @@ module github.com/mastertinner/s3manager
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-ini/ini v1.38.1 // indirect
|
github.com/go-ini/ini v1.38.1 // indirect
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f // indirect
|
|
||||||
github.com/jtolds/gls v4.2.1+incompatible // indirect
|
|
||||||
github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a
|
github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a
|
||||||
github.com/matryer/is v1.1.0
|
github.com/matryer/is v1.1.0
|
||||||
github.com/matryer/way v0.0.0-20180416093233-9632d0c407b0
|
github.com/matryer/way v0.0.0-20180416093233-9632d0c407b0
|
||||||
github.com/minio/minio-go v6.0.5+incompatible
|
github.com/minio/minio-go v6.0.5+incompatible
|
||||||
github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff // indirect
|
github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff // indirect
|
||||||
github.com/pkg/errors v0.8.0
|
github.com/pkg/errors v0.8.0
|
||||||
github.com/smartystreets/assertions v0.0.0-20180725160413-e900ae048470 // indirect
|
golang.org/x/crypto v0.0.0-20180807104621-f027049dab0a // indirect
|
||||||
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect
|
golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb // indirect
|
golang.org/x/sys v0.0.0-20180808154034-904bdc257025 // indirect
|
||||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a // indirect
|
|
||||||
golang.org/x/sys v0.0.0-20180801221139-3dc4335d56c7 // indirect
|
|
||||||
golang.org/x/text v0.3.0 // indirect
|
golang.org/x/text v0.3.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.38.1 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
22
go.sum
22
go.sum
|
@ -1,9 +1,5 @@
|
||||||
github.com/go-ini/ini v1.38.1 h1:hbtfM8emWUVo9GnXSloXYyFbXxZ+tG6sbepSStoe1FY=
|
github.com/go-ini/ini v1.38.1 h1:hbtfM8emWUVo9GnXSloXYyFbXxZ+tG6sbepSStoe1FY=
|
||||||
github.com/go-ini/ini v1.38.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
github.com/go-ini/ini v1.38.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f h1:FDM3EtwZLyhW48YRiyqjivNlNZjAObv4xt4NnJaU+NQ=
|
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
|
||||||
github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE=
|
|
||||||
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
|
||||||
github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a h1:zfKot2b2ghanQHXgxFuhRjBsHceUM2nyKB/6+Uzs0nc=
|
github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a h1:zfKot2b2ghanQHXgxFuhRjBsHceUM2nyKB/6+Uzs0nc=
|
||||||
github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a/go.mod h1:+CmkQ6q1+eiIdmwd2m4kBj8xAcIjlIVAesWwv9YmuXY=
|
github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a/go.mod h1:+CmkQ6q1+eiIdmwd2m4kBj8xAcIjlIVAesWwv9YmuXY=
|
||||||
github.com/matryer/is v1.1.0 h1:VWTaJ7O+aCteFVVE16QjvBNDDHVK26TN0pHFRUPRIgY=
|
github.com/matryer/is v1.1.0 h1:VWTaJ7O+aCteFVVE16QjvBNDDHVK26TN0pHFRUPRIgY=
|
||||||
|
@ -16,17 +12,11 @@ github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff h1:jM4Eo4qMmm
|
||||||
github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/smartystreets/assertions v0.0.0-20180725160413-e900ae048470 h1:R0uuDVEvfDha2O6dfJRr4/5NBHKEbZhMPZmqOWpEkSo=
|
golang.org/x/crypto v0.0.0-20180807104621-f027049dab0a h1:PulT0Y50PcfTWomfsD39bSQyVrjjWdIuJKfyR4nOCJw=
|
||||||
github.com/smartystreets/assertions v0.0.0-20180725160413-e900ae048470/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
golang.org/x/crypto v0.0.0-20180807104621-f027049dab0a/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbmil4Ui/dDdFBExb7/cmkNjyX5F97oglmvCDo=
|
golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24 h1:mEsFm194MmS9vCwxFy+zwu0EU7ZkxxMD1iH++vmGdUY=
|
||||||
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
|
golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb h1:Ah9YqXLj6fEgeKqcmBuLCbAsrF3ScD7dJ/bYM0C6tXI=
|
golang.org/x/sys v0.0.0-20180808154034-904bdc257025 h1:vE4lpaOfhRi5ci1V4lyWFx2Rg3CXZNaN09Q1e+GKioA=
|
||||||
golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/sys v0.0.0-20180808154034-904bdc257025/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a h1:8fCF9zjAir2SP3N+axz9xs+0r4V8dqPzqsWO10t8zoo=
|
|
||||||
golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/sys v0.0.0-20180801221139-3dc4335d56c7 h1:tr8zzCvQ7aQaYQ5nOInKN9jN9ujD92ktUtiEpN/b+tE=
|
|
||||||
golang.org/x/sys v0.0.0-20180801221139-3dc4335d56c7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
gopkg.in/ini.v1 v1.38.1 h1:8E3nEICVJ6kxl6aTXYp77xYyObhw7YG9/avdj0r3vME=
|
|
||||||
gopkg.in/ini.v1 v1.38.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Code generated by moq; DO NOT EDIT
|
// Code generated by moq; DO NOT EDIT.
|
||||||
// github.com/matryer/moq
|
// github.com/matryer/moq
|
||||||
|
|
||||||
package s3manager_test
|
package s3manager_test
|
||||||
|
@ -25,25 +25,25 @@ var (
|
||||||
//
|
//
|
||||||
// // make and configure a mocked S3
|
// // make and configure a mocked S3
|
||||||
// mockedS3 := &S3Mock{
|
// mockedS3 := &S3Mock{
|
||||||
// GetObjectFunc: func(in1 string, in2 string, in3 minio.GetObjectOptions) (*minio.Object, error) {
|
// GetObjectFunc: func(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) {
|
||||||
// panic("TODO: mock out the GetObject method")
|
// panic("TODO: mock out the GetObject method")
|
||||||
// },
|
// },
|
||||||
// ListBucketsFunc: func() ([]minio.BucketInfo, error) {
|
// ListBucketsFunc: func() ([]minio.BucketInfo, error) {
|
||||||
// panic("TODO: mock out the ListBuckets method")
|
// panic("TODO: mock out the ListBuckets method")
|
||||||
// },
|
// },
|
||||||
// ListObjectsV2Func: func(in1 string, in2 string, in3 bool, in4 <-chan struct{}) <-chan minio.ObjectInfo {
|
// ListObjectsV2Func: func(bucketName string, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo {
|
||||||
// panic("TODO: mock out the ListObjectsV2 method")
|
// panic("TODO: mock out the ListObjectsV2 method")
|
||||||
// },
|
// },
|
||||||
// MakeBucketFunc: func(in1 string, in2 string) error {
|
// MakeBucketFunc: func(bucketName string, location string) error {
|
||||||
// panic("TODO: mock out the MakeBucket method")
|
// panic("TODO: mock out the MakeBucket method")
|
||||||
// },
|
// },
|
||||||
// PutObjectFunc: func(in1 string, in2 string, in3 io.Reader, in4 int64, in5 minio.PutObjectOptions) (int64, error) {
|
// PutObjectFunc: func(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (int64, error) {
|
||||||
// panic("TODO: mock out the PutObject method")
|
// panic("TODO: mock out the PutObject method")
|
||||||
// },
|
// },
|
||||||
// RemoveBucketFunc: func(in1 string) error {
|
// RemoveBucketFunc: func(bucketName string) error {
|
||||||
// panic("TODO: mock out the RemoveBucket method")
|
// panic("TODO: mock out the RemoveBucket method")
|
||||||
// },
|
// },
|
||||||
// RemoveObjectFunc: func(in1 string, in2 string) error {
|
// RemoveObjectFunc: func(bucketName string, objectName string) error {
|
||||||
// panic("TODO: mock out the RemoveObject method")
|
// panic("TODO: mock out the RemoveObject method")
|
||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
|
@ -54,118 +54,118 @@ var (
|
||||||
// }
|
// }
|
||||||
type S3Mock struct {
|
type S3Mock struct {
|
||||||
// GetObjectFunc mocks the GetObject method.
|
// GetObjectFunc mocks the GetObject method.
|
||||||
GetObjectFunc func(in1 string, in2 string, in3 minio.GetObjectOptions) (*minio.Object, error)
|
GetObjectFunc func(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error)
|
||||||
|
|
||||||
// ListBucketsFunc mocks the ListBuckets method.
|
// ListBucketsFunc mocks the ListBuckets method.
|
||||||
ListBucketsFunc func() ([]minio.BucketInfo, error)
|
ListBucketsFunc func() ([]minio.BucketInfo, error)
|
||||||
|
|
||||||
// ListObjectsV2Func mocks the ListObjectsV2 method.
|
// ListObjectsV2Func mocks the ListObjectsV2 method.
|
||||||
ListObjectsV2Func func(in1 string, in2 string, in3 bool, in4 <-chan struct{}) <-chan minio.ObjectInfo
|
ListObjectsV2Func func(bucketName string, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo
|
||||||
|
|
||||||
// MakeBucketFunc mocks the MakeBucket method.
|
// MakeBucketFunc mocks the MakeBucket method.
|
||||||
MakeBucketFunc func(in1 string, in2 string) error
|
MakeBucketFunc func(bucketName string, location string) error
|
||||||
|
|
||||||
// PutObjectFunc mocks the PutObject method.
|
// PutObjectFunc mocks the PutObject method.
|
||||||
PutObjectFunc func(in1 string, in2 string, in3 io.Reader, in4 int64, in5 minio.PutObjectOptions) (int64, error)
|
PutObjectFunc func(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (int64, error)
|
||||||
|
|
||||||
// RemoveBucketFunc mocks the RemoveBucket method.
|
// RemoveBucketFunc mocks the RemoveBucket method.
|
||||||
RemoveBucketFunc func(in1 string) error
|
RemoveBucketFunc func(bucketName string) error
|
||||||
|
|
||||||
// RemoveObjectFunc mocks the RemoveObject method.
|
// RemoveObjectFunc mocks the RemoveObject method.
|
||||||
RemoveObjectFunc func(in1 string, in2 string) error
|
RemoveObjectFunc func(bucketName string, objectName string) error
|
||||||
|
|
||||||
// calls tracks calls to the methods.
|
// calls tracks calls to the methods.
|
||||||
calls struct {
|
calls struct {
|
||||||
// GetObject holds details about calls to the GetObject method.
|
// GetObject holds details about calls to the GetObject method.
|
||||||
GetObject []struct {
|
GetObject []struct {
|
||||||
// In1 is the in1 argument value.
|
// BucketName is the bucketName argument value.
|
||||||
In1 string
|
BucketName string
|
||||||
// In2 is the in2 argument value.
|
// ObjectName is the objectName argument value.
|
||||||
In2 string
|
ObjectName string
|
||||||
// In3 is the in3 argument value.
|
// Opts is the opts argument value.
|
||||||
In3 minio.GetObjectOptions
|
Opts minio.GetObjectOptions
|
||||||
}
|
}
|
||||||
// ListBuckets holds details about calls to the ListBuckets method.
|
// ListBuckets holds details about calls to the ListBuckets method.
|
||||||
ListBuckets []struct {
|
ListBuckets []struct {
|
||||||
}
|
}
|
||||||
// ListObjectsV2 holds details about calls to the ListObjectsV2 method.
|
// ListObjectsV2 holds details about calls to the ListObjectsV2 method.
|
||||||
ListObjectsV2 []struct {
|
ListObjectsV2 []struct {
|
||||||
// In1 is the in1 argument value.
|
// BucketName is the bucketName argument value.
|
||||||
In1 string
|
BucketName string
|
||||||
// In2 is the in2 argument value.
|
// ObjectPrefix is the objectPrefix argument value.
|
||||||
In2 string
|
ObjectPrefix string
|
||||||
// In3 is the in3 argument value.
|
// Recursive is the recursive argument value.
|
||||||
In3 bool
|
Recursive bool
|
||||||
// In4 is the in4 argument value.
|
// DoneCh is the doneCh argument value.
|
||||||
In4 <-chan struct{}
|
DoneCh <-chan struct{}
|
||||||
}
|
}
|
||||||
// MakeBucket holds details about calls to the MakeBucket method.
|
// MakeBucket holds details about calls to the MakeBucket method.
|
||||||
MakeBucket []struct {
|
MakeBucket []struct {
|
||||||
// In1 is the in1 argument value.
|
// BucketName is the bucketName argument value.
|
||||||
In1 string
|
BucketName string
|
||||||
// In2 is the in2 argument value.
|
// Location is the location argument value.
|
||||||
In2 string
|
Location string
|
||||||
}
|
}
|
||||||
// PutObject holds details about calls to the PutObject method.
|
// PutObject holds details about calls to the PutObject method.
|
||||||
PutObject []struct {
|
PutObject []struct {
|
||||||
// In1 is the in1 argument value.
|
// BucketName is the bucketName argument value.
|
||||||
In1 string
|
BucketName string
|
||||||
// In2 is the in2 argument value.
|
// ObjectName is the objectName argument value.
|
||||||
In2 string
|
ObjectName string
|
||||||
// In3 is the in3 argument value.
|
// Reader is the reader argument value.
|
||||||
In3 io.Reader
|
Reader io.Reader
|
||||||
// In4 is the in4 argument value.
|
// ObjectSize is the objectSize argument value.
|
||||||
In4 int64
|
ObjectSize int64
|
||||||
// In5 is the in5 argument value.
|
// Opts is the opts argument value.
|
||||||
In5 minio.PutObjectOptions
|
Opts minio.PutObjectOptions
|
||||||
}
|
}
|
||||||
// RemoveBucket holds details about calls to the RemoveBucket method.
|
// RemoveBucket holds details about calls to the RemoveBucket method.
|
||||||
RemoveBucket []struct {
|
RemoveBucket []struct {
|
||||||
// In1 is the in1 argument value.
|
// BucketName is the bucketName argument value.
|
||||||
In1 string
|
BucketName string
|
||||||
}
|
}
|
||||||
// RemoveObject holds details about calls to the RemoveObject method.
|
// RemoveObject holds details about calls to the RemoveObject method.
|
||||||
RemoveObject []struct {
|
RemoveObject []struct {
|
||||||
// In1 is the in1 argument value.
|
// BucketName is the bucketName argument value.
|
||||||
In1 string
|
BucketName string
|
||||||
// In2 is the in2 argument value.
|
// ObjectName is the objectName argument value.
|
||||||
In2 string
|
ObjectName string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetObject calls GetObjectFunc.
|
// GetObject calls GetObjectFunc.
|
||||||
func (mock *S3Mock) GetObject(in1 string, in2 string, in3 minio.GetObjectOptions) (*minio.Object, error) {
|
func (mock *S3Mock) GetObject(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) {
|
||||||
if mock.GetObjectFunc == nil {
|
if mock.GetObjectFunc == nil {
|
||||||
panic("moq: S3Mock.GetObjectFunc is nil but S3.GetObject was just called")
|
panic("S3Mock.GetObjectFunc: method is nil but S3.GetObject was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
In3 minio.GetObjectOptions
|
Opts minio.GetObjectOptions
|
||||||
}{
|
}{
|
||||||
In1: in1,
|
BucketName: bucketName,
|
||||||
In2: in2,
|
ObjectName: objectName,
|
||||||
In3: in3,
|
Opts: opts,
|
||||||
}
|
}
|
||||||
lockS3MockGetObject.Lock()
|
lockS3MockGetObject.Lock()
|
||||||
mock.calls.GetObject = append(mock.calls.GetObject, callInfo)
|
mock.calls.GetObject = append(mock.calls.GetObject, callInfo)
|
||||||
lockS3MockGetObject.Unlock()
|
lockS3MockGetObject.Unlock()
|
||||||
return mock.GetObjectFunc(in1, in2, in3)
|
return mock.GetObjectFunc(bucketName, objectName, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetObjectCalls gets all the calls that were made to GetObject.
|
// GetObjectCalls gets all the calls that were made to GetObject.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
// len(mockedS3.GetObjectCalls())
|
// len(mockedS3.GetObjectCalls())
|
||||||
func (mock *S3Mock) GetObjectCalls() []struct {
|
func (mock *S3Mock) GetObjectCalls() []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
In3 minio.GetObjectOptions
|
Opts minio.GetObjectOptions
|
||||||
} {
|
} {
|
||||||
var calls []struct {
|
var calls []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
In3 minio.GetObjectOptions
|
Opts minio.GetObjectOptions
|
||||||
}
|
}
|
||||||
lockS3MockGetObject.RLock()
|
lockS3MockGetObject.RLock()
|
||||||
calls = mock.calls.GetObject
|
calls = mock.calls.GetObject
|
||||||
|
@ -176,7 +176,7 @@ func (mock *S3Mock) GetObjectCalls() []struct {
|
||||||
// ListBuckets calls ListBucketsFunc.
|
// ListBuckets calls ListBucketsFunc.
|
||||||
func (mock *S3Mock) ListBuckets() ([]minio.BucketInfo, error) {
|
func (mock *S3Mock) ListBuckets() ([]minio.BucketInfo, error) {
|
||||||
if mock.ListBucketsFunc == nil {
|
if mock.ListBucketsFunc == nil {
|
||||||
panic("moq: S3Mock.ListBucketsFunc is nil but S3.ListBuckets was just called")
|
panic("S3Mock.ListBucketsFunc: method is nil but S3.ListBuckets was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
}{}
|
}{}
|
||||||
|
@ -200,41 +200,41 @@ func (mock *S3Mock) ListBucketsCalls() []struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListObjectsV2 calls ListObjectsV2Func.
|
// ListObjectsV2 calls ListObjectsV2Func.
|
||||||
func (mock *S3Mock) ListObjectsV2(in1 string, in2 string, in3 bool, in4 <-chan struct{}) <-chan minio.ObjectInfo {
|
func (mock *S3Mock) ListObjectsV2(bucketName string, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo {
|
||||||
if mock.ListObjectsV2Func == nil {
|
if mock.ListObjectsV2Func == nil {
|
||||||
panic("moq: S3Mock.ListObjectsV2Func is nil but S3.ListObjectsV2 was just called")
|
panic("S3Mock.ListObjectsV2Func: method is nil but S3.ListObjectsV2 was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectPrefix string
|
||||||
In3 bool
|
Recursive bool
|
||||||
In4 <-chan struct{}
|
DoneCh <-chan struct{}
|
||||||
}{
|
}{
|
||||||
In1: in1,
|
BucketName: bucketName,
|
||||||
In2: in2,
|
ObjectPrefix: objectPrefix,
|
||||||
In3: in3,
|
Recursive: recursive,
|
||||||
In4: in4,
|
DoneCh: doneCh,
|
||||||
}
|
}
|
||||||
lockS3MockListObjectsV2.Lock()
|
lockS3MockListObjectsV2.Lock()
|
||||||
mock.calls.ListObjectsV2 = append(mock.calls.ListObjectsV2, callInfo)
|
mock.calls.ListObjectsV2 = append(mock.calls.ListObjectsV2, callInfo)
|
||||||
lockS3MockListObjectsV2.Unlock()
|
lockS3MockListObjectsV2.Unlock()
|
||||||
return mock.ListObjectsV2Func(in1, in2, in3, in4)
|
return mock.ListObjectsV2Func(bucketName, objectPrefix, recursive, doneCh)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListObjectsV2Calls gets all the calls that were made to ListObjectsV2.
|
// ListObjectsV2Calls gets all the calls that were made to ListObjectsV2.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
// len(mockedS3.ListObjectsV2Calls())
|
// len(mockedS3.ListObjectsV2Calls())
|
||||||
func (mock *S3Mock) ListObjectsV2Calls() []struct {
|
func (mock *S3Mock) ListObjectsV2Calls() []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectPrefix string
|
||||||
In3 bool
|
Recursive bool
|
||||||
In4 <-chan struct{}
|
DoneCh <-chan struct{}
|
||||||
} {
|
} {
|
||||||
var calls []struct {
|
var calls []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectPrefix string
|
||||||
In3 bool
|
Recursive bool
|
||||||
In4 <-chan struct{}
|
DoneCh <-chan struct{}
|
||||||
}
|
}
|
||||||
lockS3MockListObjectsV2.RLock()
|
lockS3MockListObjectsV2.RLock()
|
||||||
calls = mock.calls.ListObjectsV2
|
calls = mock.calls.ListObjectsV2
|
||||||
|
@ -243,33 +243,33 @@ func (mock *S3Mock) ListObjectsV2Calls() []struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeBucket calls MakeBucketFunc.
|
// MakeBucket calls MakeBucketFunc.
|
||||||
func (mock *S3Mock) MakeBucket(in1 string, in2 string) error {
|
func (mock *S3Mock) MakeBucket(bucketName string, location string) error {
|
||||||
if mock.MakeBucketFunc == nil {
|
if mock.MakeBucketFunc == nil {
|
||||||
panic("moq: S3Mock.MakeBucketFunc is nil but S3.MakeBucket was just called")
|
panic("S3Mock.MakeBucketFunc: method is nil but S3.MakeBucket was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
Location string
|
||||||
}{
|
}{
|
||||||
In1: in1,
|
BucketName: bucketName,
|
||||||
In2: in2,
|
Location: location,
|
||||||
}
|
}
|
||||||
lockS3MockMakeBucket.Lock()
|
lockS3MockMakeBucket.Lock()
|
||||||
mock.calls.MakeBucket = append(mock.calls.MakeBucket, callInfo)
|
mock.calls.MakeBucket = append(mock.calls.MakeBucket, callInfo)
|
||||||
lockS3MockMakeBucket.Unlock()
|
lockS3MockMakeBucket.Unlock()
|
||||||
return mock.MakeBucketFunc(in1, in2)
|
return mock.MakeBucketFunc(bucketName, location)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeBucketCalls gets all the calls that were made to MakeBucket.
|
// MakeBucketCalls gets all the calls that were made to MakeBucket.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
// len(mockedS3.MakeBucketCalls())
|
// len(mockedS3.MakeBucketCalls())
|
||||||
func (mock *S3Mock) MakeBucketCalls() []struct {
|
func (mock *S3Mock) MakeBucketCalls() []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
Location string
|
||||||
} {
|
} {
|
||||||
var calls []struct {
|
var calls []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
Location string
|
||||||
}
|
}
|
||||||
lockS3MockMakeBucket.RLock()
|
lockS3MockMakeBucket.RLock()
|
||||||
calls = mock.calls.MakeBucket
|
calls = mock.calls.MakeBucket
|
||||||
|
@ -278,45 +278,45 @@ func (mock *S3Mock) MakeBucketCalls() []struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutObject calls PutObjectFunc.
|
// PutObject calls PutObjectFunc.
|
||||||
func (mock *S3Mock) PutObject(in1 string, in2 string, in3 io.Reader, in4 int64, in5 minio.PutObjectOptions) (int64, error) {
|
func (mock *S3Mock) PutObject(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (int64, error) {
|
||||||
if mock.PutObjectFunc == nil {
|
if mock.PutObjectFunc == nil {
|
||||||
panic("moq: S3Mock.PutObjectFunc is nil but S3.PutObject was just called")
|
panic("S3Mock.PutObjectFunc: method is nil but S3.PutObject was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
In3 io.Reader
|
Reader io.Reader
|
||||||
In4 int64
|
ObjectSize int64
|
||||||
In5 minio.PutObjectOptions
|
Opts minio.PutObjectOptions
|
||||||
}{
|
}{
|
||||||
In1: in1,
|
BucketName: bucketName,
|
||||||
In2: in2,
|
ObjectName: objectName,
|
||||||
In3: in3,
|
Reader: reader,
|
||||||
In4: in4,
|
ObjectSize: objectSize,
|
||||||
In5: in5,
|
Opts: opts,
|
||||||
}
|
}
|
||||||
lockS3MockPutObject.Lock()
|
lockS3MockPutObject.Lock()
|
||||||
mock.calls.PutObject = append(mock.calls.PutObject, callInfo)
|
mock.calls.PutObject = append(mock.calls.PutObject, callInfo)
|
||||||
lockS3MockPutObject.Unlock()
|
lockS3MockPutObject.Unlock()
|
||||||
return mock.PutObjectFunc(in1, in2, in3, in4, in5)
|
return mock.PutObjectFunc(bucketName, objectName, reader, objectSize, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PutObjectCalls gets all the calls that were made to PutObject.
|
// PutObjectCalls gets all the calls that were made to PutObject.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
// len(mockedS3.PutObjectCalls())
|
// len(mockedS3.PutObjectCalls())
|
||||||
func (mock *S3Mock) PutObjectCalls() []struct {
|
func (mock *S3Mock) PutObjectCalls() []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
In3 io.Reader
|
Reader io.Reader
|
||||||
In4 int64
|
ObjectSize int64
|
||||||
In5 minio.PutObjectOptions
|
Opts minio.PutObjectOptions
|
||||||
} {
|
} {
|
||||||
var calls []struct {
|
var calls []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
In3 io.Reader
|
Reader io.Reader
|
||||||
In4 int64
|
ObjectSize int64
|
||||||
In5 minio.PutObjectOptions
|
Opts minio.PutObjectOptions
|
||||||
}
|
}
|
||||||
lockS3MockPutObject.RLock()
|
lockS3MockPutObject.RLock()
|
||||||
calls = mock.calls.PutObject
|
calls = mock.calls.PutObject
|
||||||
|
@ -325,29 +325,29 @@ func (mock *S3Mock) PutObjectCalls() []struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveBucket calls RemoveBucketFunc.
|
// RemoveBucket calls RemoveBucketFunc.
|
||||||
func (mock *S3Mock) RemoveBucket(in1 string) error {
|
func (mock *S3Mock) RemoveBucket(bucketName string) error {
|
||||||
if mock.RemoveBucketFunc == nil {
|
if mock.RemoveBucketFunc == nil {
|
||||||
panic("moq: S3Mock.RemoveBucketFunc is nil but S3.RemoveBucket was just called")
|
panic("S3Mock.RemoveBucketFunc: method is nil but S3.RemoveBucket was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
In1 string
|
BucketName string
|
||||||
}{
|
}{
|
||||||
In1: in1,
|
BucketName: bucketName,
|
||||||
}
|
}
|
||||||
lockS3MockRemoveBucket.Lock()
|
lockS3MockRemoveBucket.Lock()
|
||||||
mock.calls.RemoveBucket = append(mock.calls.RemoveBucket, callInfo)
|
mock.calls.RemoveBucket = append(mock.calls.RemoveBucket, callInfo)
|
||||||
lockS3MockRemoveBucket.Unlock()
|
lockS3MockRemoveBucket.Unlock()
|
||||||
return mock.RemoveBucketFunc(in1)
|
return mock.RemoveBucketFunc(bucketName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveBucketCalls gets all the calls that were made to RemoveBucket.
|
// RemoveBucketCalls gets all the calls that were made to RemoveBucket.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
// len(mockedS3.RemoveBucketCalls())
|
// len(mockedS3.RemoveBucketCalls())
|
||||||
func (mock *S3Mock) RemoveBucketCalls() []struct {
|
func (mock *S3Mock) RemoveBucketCalls() []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
} {
|
} {
|
||||||
var calls []struct {
|
var calls []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
}
|
}
|
||||||
lockS3MockRemoveBucket.RLock()
|
lockS3MockRemoveBucket.RLock()
|
||||||
calls = mock.calls.RemoveBucket
|
calls = mock.calls.RemoveBucket
|
||||||
|
@ -356,33 +356,33 @@ func (mock *S3Mock) RemoveBucketCalls() []struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveObject calls RemoveObjectFunc.
|
// RemoveObject calls RemoveObjectFunc.
|
||||||
func (mock *S3Mock) RemoveObject(in1 string, in2 string) error {
|
func (mock *S3Mock) RemoveObject(bucketName string, objectName string) error {
|
||||||
if mock.RemoveObjectFunc == nil {
|
if mock.RemoveObjectFunc == nil {
|
||||||
panic("moq: S3Mock.RemoveObjectFunc is nil but S3.RemoveObject was just called")
|
panic("S3Mock.RemoveObjectFunc: method is nil but S3.RemoveObject was just called")
|
||||||
}
|
}
|
||||||
callInfo := struct {
|
callInfo := struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
}{
|
}{
|
||||||
In1: in1,
|
BucketName: bucketName,
|
||||||
In2: in2,
|
ObjectName: objectName,
|
||||||
}
|
}
|
||||||
lockS3MockRemoveObject.Lock()
|
lockS3MockRemoveObject.Lock()
|
||||||
mock.calls.RemoveObject = append(mock.calls.RemoveObject, callInfo)
|
mock.calls.RemoveObject = append(mock.calls.RemoveObject, callInfo)
|
||||||
lockS3MockRemoveObject.Unlock()
|
lockS3MockRemoveObject.Unlock()
|
||||||
return mock.RemoveObjectFunc(in1, in2)
|
return mock.RemoveObjectFunc(bucketName, objectName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveObjectCalls gets all the calls that were made to RemoveObject.
|
// RemoveObjectCalls gets all the calls that were made to RemoveObject.
|
||||||
// Check the length with:
|
// Check the length with:
|
||||||
// len(mockedS3.RemoveObjectCalls())
|
// len(mockedS3.RemoveObjectCalls())
|
||||||
func (mock *S3Mock) RemoveObjectCalls() []struct {
|
func (mock *S3Mock) RemoveObjectCalls() []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
} {
|
} {
|
||||||
var calls []struct {
|
var calls []struct {
|
||||||
In1 string
|
BucketName string
|
||||||
In2 string
|
ObjectName string
|
||||||
}
|
}
|
||||||
lockS3MockRemoveObject.RLock()
|
lockS3MockRemoveObject.RLock()
|
||||||
calls = mock.calls.RemoveObject
|
calls = mock.calls.RemoveObject
|
||||||
|
|
Loading…
Reference in a new issue