swooosh13 / L0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

L0

Первый запуск

Создание бд

$ docker-compose up -d
$ docker-compose exec pgdb sh
$ psql -U admin
admin=# create database orders; 

Поднятие миграций с помощью goose

$ make migrate-up

Работа приложения

service - основной сервис
publisher - сервис для генерации и публикации в канал валидных/невалидных сообщений

Логи запуска приложения

Параллельно запустим publisher

$ make pub
$ go run cmd/app/main.go
{"level":"info","ts":1654768720.9499724,"caller":"logger/zap.go:25","msg":"Config has been loaded"}
{"level":"info","ts":1654768721.0336752,"caller":"logger/zap.go:25","msg":"PostgresComposite has been created successfully"}
{"level":"info","ts":1654768721.082607,"caller":"logger/zap.go:25","msg":"Data has been recovered from db to in-memory cache"}
{"level":"info","ts":1654768721.0831296,"caller":"logger/zap.go:25","msg":"OrderComposite has been created successfully"}
{"level":"info","ts":1654768721.1146371,"caller":"logger/zap.go:25","msg":"Nats connection successfully established"}
{"level":"info","ts":1654768721.121121,"caller":"logger/zap.go:25","msg":"Server has been started"}
{"level":"info","ts":1654768960.8691394,"caller":"logger/zap.go:25","msg":"The order was successfully written to the DB and in-memory cache"}
{"level":"info","ts":1654768963.871098,"caller":"logger/zap.go:25","msg":"The order was successfully written to the DB and in-memory cache"}
{"level":"error","ts":1654768966.8756394,"caller":"logger/zap.go:29","msg":"Received error json format"}
{"level":"info","ts":1654768966.8914194,"caller":"logger/zap.go:25","msg":"The order was successfully written to the DB and in-memory cache"}
{"level":"info","ts":1654768969.9020646,"caller":"logger/zap.go:25","msg":"The order was successfully written to the DB and in-memory cache"}

About


Languages

Language:Go 65.6%Language:HTML 32.8%Language:Makefile 1.6%