Documentation ¶
Overview ¶
Package test contains testing helpers.
Index ¶
- func AddCookie(t testing.TB, r *http.Request, name, value string)
- func NewResource(t testing.TB, repository, tags string, env []string) (*dockertest.Pool, *dockertest.Resource)
- func RunMemcached() (*dockertest.Pool, *dockertest.Resource, *memcache.Client, error)
- func RunPostgres() (*dockertest.Pool, *dockertest.Resource, *sqlx.DB, error)
- func RunRedis() (*dockertest.Pool, *dockertest.Resource, *redis.Client, error)
- func StartMemcached(t testing.TB) *memcache.Client
- func StartPostgres(t testing.TB) *sqlx.DB
- func StartRedis(t testing.TB) *redis.Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResource ¶
func NewResource(t testing.TB, repository, tags string, env []string) (*dockertest.Pool, *dockertest.Resource)
NewResource returns a new pool, a docker container and handles its purge.
func RunMemcached ¶
RunMemcached initializes a docker container with memcached running in it.
func RunPostgres ¶
RunPostgres initializes a docker container with postgres running in it.
func RunRedis ¶
func RunRedis() (*dockertest.Pool, *dockertest.Resource, *redis.Client, error)
RunRedis initializes a docker container with redis running in it.
func StartMemcached ¶
StartMemcached starts a memcached container and makes the cleanup.
func StartPostgres ¶
StartPostgres starts a postgres container and makes the cleanup.
func StartRedis ¶
StartRedis starts a redis container and makes the cleanup.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.