https://github.com/armingodiz/gitlab-api
Simple application to interact with GitLab API
https://github.com/armingodiz/gitlab-api
gin-gonic gitlab-api redis
Last synced: 10 months ago
JSON representation
Simple application to interact with GitLab API
- Host: GitHub
- URL: https://github.com/armingodiz/gitlab-api
- Owner: Armingodiz
- Created: 2021-07-25T11:32:47.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-25T18:21:30.000Z (over 4 years ago)
- Last Synced: 2025-02-05T16:47:55.298Z (11 months ago)
- Topics: gin-gonic, gitlab-api, redis
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gitlab-api
Simple application to interact with gitlab api.
This app work with 2 kind of cache : 1) simple string-> string map and 2) Redis,
You can chose which one to use.
## Dependencies
name | repo
------------- | -------------
go | https://golang.org/doc/install
gin | https://github.com/gin-gonic/gin
go redis | https://github.com/go-redis/redis
docker | https://www.docker.com/
You must have [go](https://golang.org/doc/install) and [gin](https://github.com/gin-gonic/gin),
First you need to install go and then you can run `go get https://github.com/gin-gonic/gin.git` to have gin.
If you want to use redis as cache you need [Docker](https://www.docker.com/) installed on your machine
also you need to run `go get https://github.com/go-redis/redis` too.
## Usage
If you want to use redis as cache:
[Run `docker run --name redis-usdb -p "yourPort":6379 -d redis` to connect redis to port "yourPort".
Set cache_port in config.json to yourPort.]
** default cache_port is -1 which show you want to use map as cache in your app.
Build and run **main.go** file(`go run main.go`) to start the app.
(default port is 8080 but if this port of your system is busy you can change it in config.json(listener_port))
## Endpoints
baseUrl: localhost:listener_port
`POST baseUrl/token ==> to set your access token and userId body :{ userId: string, gitlabAccessToken: string }`
`GET baseUrl/projects/:id/repository_tree ==> get repository tree of project with id mentioned in request body and access token for user with userId set in request header with key as `
`GET baseUrl/ping ==> simple get endpoint used for cloud to hit it and understand our web server is still running`