├── .github └── workflows │ └── go.yml ├── .gitignore ├── .idea ├── modules.xml ├── simple-web-server.iml ├── sqldialects.xml ├── vcs.xml ├── watcherTasks.xml └── workspace.xml ├── Dockerfile ├── LICENSE.md ├── Makefile ├── README.md ├── cmd └── api │ ├── env.sh │ ├── main.go │ ├── rundev.sh │ └── wait-for-it.sh ├── config └── config.go ├── controller ├── file.go ├── users.go └── users_test.go ├── docker-compose.yml ├── go.mod ├── go.sum ├── images ├── big-gopher.png ├── echo-logo.svg └── make-run.png ├── lib ├── error │ └── error.go ├── types │ └── types.go └── validator │ └── validator.go ├── logger └── logger.go ├── model ├── file.go ├── ok.go └── user.go ├── postman ├── REST API Example.postman_collection.json └── REST API Server Local.postman_environment.json ├── run.sh ├── service ├── file_content.go ├── file_meta.go ├── manager.go ├── mocks │ ├── FileContentService.go │ ├── FileMetaService.go │ └── UserService.go ├── services.go ├── user.go └── user_test.go └── store ├── gcloud ├── file.go └── gcloud.go ├── local └── file.go ├── migrations.go ├── mocks ├── FileContentRepo.go ├── FileRepo.go └── UserRepo.go ├── mysql ├── file.go ├── migrations │ ├── 20200629153445_init.down.sql │ ├── 20200629153445_init.up.sql │ ├── 20201003153445_init.down.sql │ └── 20201003153445_init.up.sql ├── mysql.go └── user.go ├── pg ├── file.go ├── migrations │ ├── 20200629153445_init.down.sql │ ├── 20200629153445_init.up.sql │ ├── 20201003153445_init.down.sql │ └── 20201003153445_init.up.sql ├── pg.go └── user.go ├── repositories.go └── store.go /.github/workflows/go.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.github/workflows/go.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /store/pg/data/ 2 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.idea/modules.xml -------------------------------------------------------------------------------- /.idea/simple-web-server.iml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.idea/simple-web-server.iml -------------------------------------------------------------------------------- /.idea/sqldialects.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.idea/sqldialects.xml -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.idea/vcs.xml -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.idea/watcherTasks.xml -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/.idea/workspace.xml -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/Dockerfile -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/LICENSE.md -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/Makefile -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/README.md -------------------------------------------------------------------------------- /cmd/api/env.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/cmd/api/env.sh -------------------------------------------------------------------------------- /cmd/api/main.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/cmd/api/main.go -------------------------------------------------------------------------------- /cmd/api/rundev.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/cmd/api/rundev.sh -------------------------------------------------------------------------------- /cmd/api/wait-for-it.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/cmd/api/wait-for-it.sh -------------------------------------------------------------------------------- /config/config.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/config/config.go -------------------------------------------------------------------------------- /controller/file.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/controller/file.go -------------------------------------------------------------------------------- /controller/users.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/controller/users.go -------------------------------------------------------------------------------- /controller/users_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/controller/users_test.go -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/docker-compose.yml -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/go.mod -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/go.sum -------------------------------------------------------------------------------- /images/big-gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/images/big-gopher.png -------------------------------------------------------------------------------- /images/echo-logo.svg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/images/echo-logo.svg -------------------------------------------------------------------------------- /images/make-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/images/make-run.png -------------------------------------------------------------------------------- /lib/error/error.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/lib/error/error.go -------------------------------------------------------------------------------- /lib/types/types.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/lib/types/types.go -------------------------------------------------------------------------------- /lib/validator/validator.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/lib/validator/validator.go -------------------------------------------------------------------------------- /logger/logger.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/logger/logger.go -------------------------------------------------------------------------------- /model/file.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/model/file.go -------------------------------------------------------------------------------- /model/ok.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/model/ok.go -------------------------------------------------------------------------------- /model/user.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/model/user.go -------------------------------------------------------------------------------- /postman/REST API Example.postman_collection.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/postman/REST API Example.postman_collection.json -------------------------------------------------------------------------------- /postman/REST API Server Local.postman_environment.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/postman/REST API Server Local.postman_environment.json -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source ./cmd/api/env.sh 3 | docker-compose up --build -------------------------------------------------------------------------------- /service/file_content.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/file_content.go -------------------------------------------------------------------------------- /service/file_meta.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/file_meta.go -------------------------------------------------------------------------------- /service/manager.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/manager.go -------------------------------------------------------------------------------- /service/mocks/FileContentService.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/mocks/FileContentService.go -------------------------------------------------------------------------------- /service/mocks/FileMetaService.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/mocks/FileMetaService.go -------------------------------------------------------------------------------- /service/mocks/UserService.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/mocks/UserService.go -------------------------------------------------------------------------------- /service/services.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/services.go -------------------------------------------------------------------------------- /service/user.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/user.go -------------------------------------------------------------------------------- /service/user_test.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/service/user_test.go -------------------------------------------------------------------------------- /store/gcloud/file.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/gcloud/file.go -------------------------------------------------------------------------------- /store/gcloud/gcloud.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/gcloud/gcloud.go -------------------------------------------------------------------------------- /store/local/file.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/local/file.go -------------------------------------------------------------------------------- /store/migrations.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/migrations.go -------------------------------------------------------------------------------- /store/mocks/FileContentRepo.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mocks/FileContentRepo.go -------------------------------------------------------------------------------- /store/mocks/FileRepo.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mocks/FileRepo.go -------------------------------------------------------------------------------- /store/mocks/UserRepo.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mocks/UserRepo.go -------------------------------------------------------------------------------- /store/mysql/file.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mysql/file.go -------------------------------------------------------------------------------- /store/mysql/migrations/20200629153445_init.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE users; -------------------------------------------------------------------------------- /store/mysql/migrations/20200629153445_init.up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mysql/migrations/20200629153445_init.up.sql -------------------------------------------------------------------------------- /store/mysql/migrations/20201003153445_init.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE files; -------------------------------------------------------------------------------- /store/mysql/migrations/20201003153445_init.up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mysql/migrations/20201003153445_init.up.sql -------------------------------------------------------------------------------- /store/mysql/mysql.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mysql/mysql.go -------------------------------------------------------------------------------- /store/mysql/user.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/mysql/user.go -------------------------------------------------------------------------------- /store/pg/file.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/pg/file.go -------------------------------------------------------------------------------- /store/pg/migrations/20200629153445_init.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE users; -------------------------------------------------------------------------------- /store/pg/migrations/20200629153445_init.up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/pg/migrations/20200629153445_init.up.sql -------------------------------------------------------------------------------- /store/pg/migrations/20201003153445_init.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE files; -------------------------------------------------------------------------------- /store/pg/migrations/20201003153445_init.up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/pg/migrations/20201003153445_init.up.sql -------------------------------------------------------------------------------- /store/pg/pg.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/pg/pg.go -------------------------------------------------------------------------------- /store/pg/user.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/pg/user.go -------------------------------------------------------------------------------- /store/repositories.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/repositories.go -------------------------------------------------------------------------------- /store/store.go: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evt/rest-api-example/HEAD/store/store.go --------------------------------------------------------------------------------