Documentation
¶
Index ¶
- Variables
- func BucketName(prefix string) string
- func ErrorCode(err error) (string, bool)
- func ErrorMessage(err error) (string, bool)
- func MakeBucket(bucket string, exists func(string) (bool, error), ...) (func(testing.TB), error)
- func Parse() error
- func RemoveBucket(bucket string, remove func(string) error, t testing.TB)
- func RemoveObject(bucket, object string, remove func(bucket, object string) error, t testing.TB)
Constants ¶
This section is empty.
Variables ¶
var ( // Endpoint is the S3 endpoint. Specified either through the '-server' CLI argument // or through the 'SERVER_ENDPOINT' env. variable. The default is 'localhost:9000' Endpoint string // AccessKey is the S3 access-key for the specified endpoint. Specified either through // the '-access' CLI argument or through the 'ACCESS_KEY' env. variable. AccessKey string // SecretKey is the S3 secret-key for the specified endpoint. Specified either through // the '-secret' CLI argument or through the 'SECRET_KEY' env. variable. SecretKey string // Insecure allows TLS to endpoints without a valid signed TLS certificate. // Particually useful for local servers. Can be set using the '-insecure' CLI flag. Insecure bool // NoTLS disables TLS. All client requests will be made of plain HTTP/TCP connections. // Tests which require TLS will be skipped. NoTLS bool // Size is the size of objects for single-part operations in bytes. It is set by the '-size' CLI flag. Size int64 // MultipartSize is the size of objects for multi-part operations in bytes. It is set by the '-sizeMultipart' CLI flag. MultipartSize int64 )
Functions ¶
func BucketName ¶
BucketName returns a bucket name with the given prefix and a random hex suffix.
func ErrorCode ¶
ErrorCode returns the response code as string if the err is a minio.ErrorResponse. It returns a boolean flag indicating whether the provided error is a minio.ErrorResponse.
func ErrorMessage ¶
ErrorMessage returns the response message as string if the err is a minio.ErrorResponse. It returns a boolean flag indicating whether the provided error is a minio.ErrorResponse.
func MakeBucket ¶
func MakeBucket(bucket string, exists func(string) (bool, error), make func(string, string) error, remove func(string) error) (func(testing.TB), error)
MakeBucket checks whether the bucket exists, if not creates it and returns a function which removes the bucket if it was created successfully.
It simplifies code that should cleanup created objects and buckets.
func Parse ¶
func Parse() error
Parse parses the command line arguments. It returns an error if no server, access-key or secret-key is provided and also no env. variables for the missing arguments are exported.
It is save to call Parse() multiple times.
func RemoveBucket ¶
RemoveBucket removes the bucket using the remove function. If the remove function returns a error RemoveBucket() fails the test.
It simplifies code that should cleanup created objects and buckets.
func RemoveObject ¶
RemoveObject removes the object at the bucket using the remove function. If the remove function returns a error RemoveObject() fails the test.
It simplifies code that should cleanup created objects and buckets.
Types ¶
This section is empty.