authToken: "5672139asdaw"
port: ":8080"
timeLayout: "2006-01-02 15:04:05"
dateLayout: "2006-01-02"
mysqlURL: "cobrareviews:password@/cobrareviews"
mode: "dev" # or 'prod'
Add config.yaml
to config
directory. If you are using docker on local instance, add to /etc/mysql/my.cnf
next lines to allow listening to all ports:
[mysqld]
bind-address = 0.0.0.0
and restart mysql sudo service mysql restart
(If you need some help with MySQL connection URL, you could read https://github.com/go-sql-driver/mysql).
And finally, execute go run server.go
from directory, where server.go
is located
make run
- to start servermake docker-up
- to run dockermake docker-down
- to shut down dockermake test-stats
- to run tests for statsmake test-company
- to run tests for company
docker-compose up --build
They are testing Rest API, so you need to have a working server.
Firstly, setup the server by running go run server.go
Then in new terminal run cd tests/(stats or company)
and go test
.
cd tests/stats/benchmark
&&
go test -bench . -count 10