# Functions
FindContainerId checks for an existing docker container with the given name, and returns its container ID (as a 12-digit hex string) if found.
FindProjectRootDir returns the absolute path to the root directory of the project (i.e.
GetContainerName returns the canonical name for the docker container that runs a postgres container for this project's query tests.
GetPostgresClientEnv returns querytest database connection details, as PG* env vars, for the given project's test database.
GetPostgresHostPort returns an arbitrary but stable port number, representing a port on the host machine, that should be canonically used for the querytest database for the given project.
GetPostgresUri returns the 'postgres:' connection string that can be used to connect to the postgres server that's running in a container for the given project's query tests.
GetProjectName infers the name of the current Go project, given the absolute path to its root directory.
IsDockerInstalled returns true if the docker CLI is installed and in the PATH.
RunMigrations invokes the current project's db-migrate script, configured to run against the project's querytest database.
StartContainer attempts to start a new docker container which will run in the background and be auto-removed upon exit, returning the new container ID if successful.
StopContainer terminates the docker container with the given ID.
TailContainerOutput runs docker logs -f until the provided context is canceled, piping line-by-line output from both stdout and stderr to the provided channel.
# Constants
MigrateScriptFilename is the canonical name of the bash script that runs a project's database migrations against the postgres db described by PGHOST, PGPORT, etc.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ErrNoSuchContainer is returned to indicate that a docker command targeting a specific container finished normally, but the targeted container was not found.
# Type aliases
ContainerId is a hexadecimal string that identifies a valid docker container, as reported in the output of docker CLI commands.