The following dependencies are used in this project (generated using Glice):
|-------------------------------------|--------------------------------------------|--------------|
| DEPENDENCY | REPOURL | LICENSE |
|-------------------------------------|--------------------------------------------|--------------|
| github.com/labstack/echo | https://github.com/labstack/echo | MIT |
| github.com/go-pg/pg | https://github.com/go-pg/pg | bsd-2-clause |
| github.com/dgrijalva/jwt-go | https://github.com/dgrijalva/jwt-go | MIT |
| github.com/rs/xid | https://github.com/rs/xid | MIT |
| golang.org/x/crypto/bcrypt | https://github.com/golang/crypto | |
| gopkg.in/yaml.v2 | https://github.com/go-yaml/yaml | |
| gopkg.in/go-playground/validator.v8 | https://github.com/go-playground/validator | MIT |
| github.com/lib/pq | https://github.com/lib/pq | Other |
| github.com/fortytw2/dockertest | https://github.com/fortytw2/dockertest | MIT |
| github.com/stretchr/testify | https://github.com/stretchr/testify | Other |
|-------------------------------------|--------------------------------------------|--------------|
- Echo - HTTP 'framework'.
- Go-Pg - PostgreSQL ORM
- JWT-Go - JWT Authentication
- XID - Generating refresh tokens
- Bcrypt - Password hashing
- Yaml - Unmarshalling YAML config file
- Validator - Request validation.
- lib/pq - Postgres driver
- DockerTest - Testing database queries
- Testify/Assert - Asserting test results
The application runs as an HTTP server at port 8080. It provides the following RESTful endpoints:
POST /login
: accepts username/passwords and returns jwt token and refresh tokenGET /refresh/:token
: refreshes sessions and returns jwt tokenGET /me
: returns info about currently logged in userGET /swaggerui/
: launches swaggerui in browserGET /v1/users
: returns list of usersGET /v1/users/:id
: returns single userPOST /v1/users
: creates a new userPATCH /v1/users/:id/password
: changes password for a userDELETE /v1/users/:id
: deletes a user
You can log in as admin to the application by sending a post request to localhost:8080/login with username admin
and password admin
in JSON body.
- Bell Eapen
- GORSK by Emir Ribic