test

package
v0.0.0-...-8bff5d1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package test contains testing helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCookie

func AddCookie(t testing.TB, r *http.Request, name, value string)

AddCookie encrypts and adds a cookie to the request passed.

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

func RunMemcached() (*dockertest.Pool, *dockertest.Resource, *memcache.Client, error)

RunMemcached initializes a docker container with memcached running in it.

func RunPostgres

func RunPostgres() (*dockertest.Pool, *dockertest.Resource, *sqlx.DB, error)

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

func StartMemcached(t testing.TB) *memcache.Client

StartMemcached starts a memcached container and makes the cleanup.

func StartPostgres

func StartPostgres(t testing.TB) *sqlx.DB

StartPostgres starts a postgres container and makes the cleanup.

func StartRedis

func StartRedis(t testing.TB) *redis.Client

StartRedis starts a redis container and makes the cleanup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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