appleboy / go-storage

storage interface for local disk or AWS S3 (or Minio) platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should provide named argument in interface `Storage`

unknowntpo opened this issue · comments

e.g. In CreateBucket() method, the second argument is bucket name, the third argument is region,
but it's hard to know which argument we need to provide without digging into actual implementation.

// Storage for s3 and disk
type Storage interface {
	// CreateBucket for create new folder
	CreateBucket(context.Context, string, string) error
}

So, it should be:

// Storage for s3 and disk
type Storage interface {
	// CreateBucket for create new folder
	CreateBucket(ctx context.Context, bucketName string, region string) error
}