Skip to content
Snippets Groups Projects
Commit 36a99ecf authored by Michael Eyob's avatar Michael Eyob
Browse files

edited Readme file

parent df074a59
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,14 @@ IMPLEMENTED ENDPOINTS
/repocheck/v1/commits{?limit=[0-9]+{&auth=<access-token>}}
- Returns commits from Gitlab, takes limit and auth token as parameters.
The returned data contains repo's path and commits count sorted by commits count
If limit is not specified it returns 5 repository commits
- Sends notifications to registered webhooks for this event
/repocheck/v1/languages{?limit=[0-9]+{&auth=<access-token>}}
- Returns languages from Gitlab, takes limit and auth token as parameters
( doesn't take project payloads as parameters).
Languages are sorted according to their occurrences.
If limit is not specified it returns 5 languages
- Sends notifications to registered webhooks for this event
/repocheck/v1/status
......@@ -37,4 +39,7 @@ IMPLEMENTED ENDPOINTS
Deletes webhook with a given id (currently not working)!!
Used database is MongoDB
\ No newline at end of file
- The issues endpoint is not implemented (the 2 out of 3 chosen are : commits and languages)
- Used NOSQL database is MongoDB
- Commits and languages requests take time as they check all the repos in Gitlab, so that the collected data
can be sorted.
\ No newline at end of file
......@@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"time"
)
//HandlerCommits returns the repositories with most commits
......@@ -56,7 +57,8 @@ func HandlerCommits(w http.ResponseWriter, r *http.Request){
resp, err := http.Get(projectsURL)
serverErrorMessage(w, err)
err = json.NewDecoder(resp.Body).Decode(proj)
resp.Body.Close()
serverErrorMessage(w, err)
err = resp.Body.Close()
serverErrorMessage(w, err)
// append all ids in a [] and save project id and name
......
......@@ -194,5 +194,4 @@ func CallURL(url string, content []byte) {
fmt.Print(response)
}
}
......@@ -71,12 +71,3 @@ type MongoDB struct {
CollectionName string
}
/*
// Invocation struct : struct sent to webhook
type Invocation struct{
Event string
Param string
Timestamp time.Time
}
*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment