minio_local

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TmpDirFile

func TmpDirFile(size int64) (dir string, fn string, err kv.Error)

TmpDirFile creates a temporary file of a given size and passes back the directory it was generated in along with its name

Types

type MinioCfgJson

type MinioCfgJson struct {
	Version    string `json:"version"`
	Credential struct {
		AccessKey string `json:"accessKey"`
		SecretKey string `json:"secretKey"`
	} `json:"credential"`
	Region       string `json:"region"`
	Browser      string `json:"browser"`
	Worm         string `json:"worm"`
	Domain       string `json:"domain"`
	Storageclass struct {
		Standard string `json:"standard"`
		Rrs      string `json:"rrs"`
	} `json:"storageclass"`
	Cache struct {
		Drives  []interface{} `json:"drives"`
		Expiry  int           `json:"expiry"`
		Maxuse  int           `json:"maxuse"`
		Exclude []interface{} `json:"exclude"`
	} `json:"cache"`
}

MinioCfgJson stores configuration information to be written to a disk based configuration file prior to starting a test minio instance

type MinioTestServer

type MinioTestServer struct {
	AccessKeyId       string
	SecretAccessKeyId string
	Address           string
	Client            *minio.Client
	Ready             atomic.Bool
	ProcessState      *os.ProcessState
}

MinioTestServer encapsulates all of the data needed to run a test minio server instance

func InitTestingMinio

func InitTestingMinio(ctx context.Context, retainWorkingDirs bool) (mts *MinioTestServer, errC chan kv.Error)

InitTestingMinio will fork a minio server that can he used for staging and test in a manner that also wraps an error reporting channel and a means of stopping it

func NewMinioTest

func NewMinioTest() (minioTest *MinioTestServer)

func (*MinioTestServer) IsAlive

func (mts *MinioTestServer) IsAlive(ctx context.Context) (alive bool, err kv.Error)

IsAlive is used to test if the expected minio local test server is alive

func (*MinioTestServer) RemoveBucketAll

func (mts *MinioTestServer) RemoveBucketAll(bucket string) (errs []kv.Error)

RemoveBucketAll empties the identified bucket on the minio test server identified by the mtx receiver variable

func (*MinioTestServer) SetPublic

func (mts *MinioTestServer) SetPublic(bucket string) (err kv.Error)

SetPublic can be used to enable public access to a bucket

func (*MinioTestServer) Upload

func (mts *MinioTestServer) Upload(bucket string, key string, file string) (err kv.Error)

Upload will take the nominated file, file parameter, and will upload it to the bucket and key pair on the server identified by the mtx receiver variable

func (*MinioTestServer) UploadTestFile

func (mts *MinioTestServer) UploadTestFile(bucket string, key string, size int64) (err kv.Error)

UploadTestFile will create and upload a file of a given size to the MinioTest server to allow test cases to exercise functionality based on S3

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL