Documentation
¶
Index ¶
- Constants
- type PostgresContainer
- func (pg *PostgresContainer) GetDBHost() string
- func (pg *PostgresContainer) GetDBName() string
- func (pg *PostgresContainer) GetDBPassword() string
- func (pg *PostgresContainer) GetDBPort() string
- func (pg *PostgresContainer) GetDBPortInt() int
- func (pg *PostgresContainer) GetDBUser() string
- func (pg *PostgresContainer) GetDSN() dsn.DSN
- func (pg *PostgresContainer) GetDSNString() string
- func (pg *PostgresContainer) Terminate(ctx context.Context) error
- type RedisContainer
- func (r *RedisContainer) DSN() string
- func (r *RedisContainer) GetRedisHost() string
- func (r *RedisContainer) GetRedisPassword() string
- func (r *RedisContainer) GetRedisPort() string
- func (r *RedisContainer) GetRedisPortInt() int
- func (r *RedisContainer) GetRedisUser() string
- func (r *RedisContainer) Terminate(ctx context.Context) error
- type SFTPServer
- type SMTPServer
- func (t *SMTPServer) GetSMTPEndpoint() string
- func (t *SMTPServer) GetSMTPHost() string
- func (t *SMTPServer) GetSMTPPassword() string
- func (t *SMTPServer) GetSMTPPortInt() int
- func (t *SMTPServer) GetSMTPPortStr() string
- func (t *SMTPServer) GetSMTPUser() string
- func (t *SMTPServer) Terminate() error
Constants ¶
const DeadlineTimeout = 20 * time.Second
const PostgresDockerImage = "postgres:16.2"
const SMTPDDockerImage = "axllent/mailpit:v1.14.0"
const SSHDDockerImage = "sgaunet/alpine-sshd:latest"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresContainer ¶
type PostgresContainer struct {
// contains filtered or unexported fields
}
TestDB is a struct that holds the postgresql container and the DSN
func NewPostgresContainer ¶
func NewPostgresContainer(postgresUser, postgresPassword, postgresDBName string) (*PostgresContainer, error)
NewTestDB creates a postgresql database in docker for tests
func (*PostgresContainer) GetDBHost ¶
func (pg *PostgresContainer) GetDBHost() string
GetDBHost returns the host of the database
func (*PostgresContainer) GetDBName ¶
func (pg *PostgresContainer) GetDBName() string
GetDBName returns the name of the database
func (*PostgresContainer) GetDBPassword ¶
func (pg *PostgresContainer) GetDBPassword() string
GetDBPassword returns the password of the database
func (*PostgresContainer) GetDBPort ¶
func (pg *PostgresContainer) GetDBPort() string
GetDBPort returns the port of the database
func (*PostgresContainer) GetDBPortInt ¶
func (pg *PostgresContainer) GetDBPortInt() int
GetDBPortInt returns the port of the database as an integer
func (*PostgresContainer) GetDBUser ¶
func (pg *PostgresContainer) GetDBUser() string
GetDBUser returns the user of the database
func (*PostgresContainer) GetDSN ¶
func (pg *PostgresContainer) GetDSN() dsn.DSN
GetDSN returns the DSN
func (*PostgresContainer) GetDSNString ¶
func (pg *PostgresContainer) GetDSNString() string
GetDSNString returns the DSN string The format is 'host=... port=... user=... password=... dbname=... sslmode=...'
type RedisContainer ¶
type RedisContainer struct {
// contains filtered or unexported fields
}
TestDB is a struct that holds the redis container and the DSN
func NewRedisContainer ¶
func NewRedisContainer(redisUser, redisPassword string) (*RedisContainer, error)
NewTestDB creates a redis database in docker for tests
func (*RedisContainer) DSN ¶
func (r *RedisContainer) DSN() string
DSN returns the DSN of the redis server
func (*RedisContainer) GetRedisHost ¶
func (r *RedisContainer) GetRedisHost() string
GetRedisHost returns the host of the redis server
func (*RedisContainer) GetRedisPassword ¶
func (r *RedisContainer) GetRedisPassword() string
GetRedisPassword returns the password of the redis server
func (*RedisContainer) GetRedisPort ¶
func (r *RedisContainer) GetRedisPort() string
GetRedisPort returns the port of the redis server as a string
func (*RedisContainer) GetRedisPortInt ¶
func (r *RedisContainer) GetRedisPortInt() int
GetRedisPortInt returns the port of the redis server as an integer
func (*RedisContainer) GetRedisUser ¶
func (r *RedisContainer) GetRedisUser() string
GetRedisUser returns the user of the redis server
type SFTPServer ¶
type SFTPServer struct {
// contains filtered or unexported fields
}
SFTPServer
func NewTestSFTPServer ¶
func NewTestSFTPServer() (*SFTPServer, error)
NewTestSFTPServer creates a new SFTP server for testing with default values
func (*SFTPServer) GetEndpoint ¶
func (t *SFTPServer) GetEndpoint() string
GetEndpoint returns the endpoint of the SFTP server
func (*SFTPServer) GetPassword ¶
func (t *SFTPServer) GetPassword() string
GetPassword returns the password of the SFTP server
func (*SFTPServer) GetPrivateKey ¶
func (t *SFTPServer) GetPrivateKey() string
GetPrivateKey returns the private key of the SFTP server
func (*SFTPServer) GetUsername ¶
func (t *SFTPServer) GetUsername() string
GetUsername returns the username of the SFTP server
func (*SFTPServer) Terminate ¶
func (t *SFTPServer) Terminate() error
Terminate stops the SFTP server
type SMTPServer ¶
type SMTPServer struct {
// contains filtered or unexported fields
}
SMTPServer
func NewTestSMTPServer ¶
func NewTestSMTPServer() (*SMTPServer, error)
NewTestSMTPServer creates a new SMTP server for testing with default values
func (*SMTPServer) GetSMTPEndpoint ¶
func (t *SMTPServer) GetSMTPEndpoint() string
GetEndpoint returns the endpoint of the SFTP server
func (*SMTPServer) GetSMTPHost ¶
func (t *SMTPServer) GetSMTPHost() string
func (*SMTPServer) GetSMTPPassword ¶
func (t *SMTPServer) GetSMTPPassword() string
func (*SMTPServer) GetSMTPPortInt ¶
func (t *SMTPServer) GetSMTPPortInt() int
func (*SMTPServer) GetSMTPPortStr ¶
func (t *SMTPServer) GetSMTPPortStr() string
GetPort returns the port of the SFTP server
func (*SMTPServer) GetSMTPUser ¶
func (t *SMTPServer) GetSMTPUser() string
func (*SMTPServer) Terminate ¶
func (t *SMTPServer) Terminate() error
Terminate stops the SMTP server