testutils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MongoDBHost = "127.0.0.1"
	//
	MongoDBShard1ReplsetName    = os.Getenv(envMongoDBShard1ReplsetName)
	MongoDBShard1PrimaryPort    = os.Getenv(envMongoDBShard1PrimaryPort)
	MongoDBShard1Secondary1Port = os.Getenv(envMongoDBShard1Secondary1Port)
	MongoDBShard1Secondary2Port = os.Getenv(envMongoDBShard1Secondary2Port)
	//
	MongoDBShard2ReplsetName    = os.Getenv(envMongoDBShard2ReplsetName)
	MongoDBShard2PrimaryPort    = os.Getenv(envMongoDBShard2PrimaryPort)
	MongoDBShard2Secondary1Port = os.Getenv(envMongoDBShard2Secondary1Port)
	MongoDBShard2Secondary2Port = os.Getenv(envMongoDBShard2Secondary2Port)
	//
	MongoDBConfigsvrReplsetName = os.Getenv(envMongoDBConfigsvrReplsetName)
	MongoDBConfigsvr1Port       = os.Getenv(envMongoDBConfigsvr1Port)
	MongoDBConfigsvr2Port       = os.Getenv(envMongoDBConfigsvr2Port)
	MongoDBConfigsvr3Port       = os.Getenv(envMongoDBConfigsvr3Port)
	//
	MongoDBMongosPort = os.Getenv(envMongoDBMongosPort)
	MongoDBUser       = os.Getenv(envMongoDBUser)
	MongoDBPassword   = os.Getenv(envMongoDBPassword)
	MongoDBTimeout    = time.Duration(10) * time.Second

	MongoDBSSLDir        = "../docker/test/ssl"
	MongoDBSSLPEMKeyFile = filepath.Join(MongoDBSSLDir, "client.pem")
	MongoDBSSLCACertFile = filepath.Join(MongoDBSSLDir, "rootCA.crt")
)
View Source
var (
	FileNotFoundError = fmt.Errorf("File not found")
)

Functions

func BaseDir

func BaseDir() string

BaseDir returns the project's root dir by asking git

func BucketExists

func BucketExists(svc *s3.S3, bucketname string) (bool, error)

func CleanTempDirAndBucket added in v0.3.0

func CleanTempDirAndBucket() error

func CleanupDatabases added in v0.4.0

func CleanupDatabases(session *mgo.Session, ignore map[string][]string) error

func ConfigsvrReplsetDialInfo

func ConfigsvrReplsetDialInfo(t *testing.T) *mgo.DialInfo

func CreateBucket

func CreateBucket(svc *s3.S3, bucket string) error

func DeleteBucket

func DeleteBucket(svc *s3.S3, bucket string) error

func DeleteFile

func DeleteFile(svc *s3.S3, bucket, filename string) error

func Diag

func Diag(params ...interface{})

func DialInfoForPort

func DialInfoForPort(rs, port string) (*mgo.DialInfo, error)

func DownloadFile

func DownloadFile(svc *s3.S3, bucket, file string, writer io.WriterAt) (int64, error)

func GetAWSSession

func GetAWSSession() (*session.Session, error)

func GetMongoDBAddr

func GetMongoDBAddr(rs, name string) string

func GetMongoDBReplsetAddrs

func GetMongoDBReplsetAddrs(rs string) []string

func MongosDialInfo

func MongosDialInfo(t *testing.T) *mgo.DialInfo

func PrimaryDialInfo

func PrimaryDialInfo(t *testing.T, rs string) *mgo.DialInfo

func RandomBucket added in v0.3.0

func RandomBucket() string

func ReplsetDialInfo

func ReplsetDialInfo(t *testing.T, rs string) *mgo.DialInfo

func S3Stat

func S3Stat(svc *s3.S3, bucket, filename string) (*s3.Object, error)

func TestingStorages added in v0.3.0

func TestingStorages() *storage.Storages

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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