Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soh335/test-mysqld-docker
testing with docker mysqld for golang
https://github.com/soh335/test-mysqld-docker
docker golang mysql testing
Last synced: 14 days ago
JSON representation
testing with docker mysqld for golang
- Host: GitHub
- URL: https://github.com/soh335/test-mysqld-docker
- Owner: soh335
- License: mit
- Created: 2016-12-01T08:00:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T12:26:27.000Z (over 7 years ago)
- Last Synced: 2024-10-11T21:11:48.197Z (about 1 month ago)
- Topics: docker, golang, mysql, testing
- Language: Go
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://travis-ci.org/soh335/test-mysqld-docker.svg?branch=master)
# test-mysqld-docker
Testing with docker mysqld for golang. Support inside and outside of docker container.
## DOWNLOAD
```
$ go get github.com/soh335/test-mysqld-docker
```## USAGE
```go
mysqld, err := mysqltest.NewMysqld(nil)
if err != nil {
log.Fatal(err.Error())
}
db, err := sql.Open("mysql", mysqld.DSN())
if err != nil {
log.Fatal(err.Error())
}
if err := db.Ping(); err != nil {
log.Fatal("ping failed")
}
```
### INSIDE DOCKER CONTAINERRequire docker command for finding parent conatiner network and ip address of mysql container is created. If you can allow to mount parent docker socket, add -v option like this ( ```-v /var/run/docker.sock:/var/run/docker.sock```).
## SEE ALSO
* https://github.com/lestrrat/go-test-mysqld
* https://github.com/punytan/p5-Test-Docker-MySQL## LICENSE
* MIT