Giter Club home page Giter Club logo

github-tag-api's Introduction

Golang Github Tag API

This RESTful API will recover a user Starred repositories, add some tags to it so it can classify better the selection. With all this data it will be possible to recover the repos with the same tags e and even recomend some tags to be added.

Prerequisites

This project was built in Go version go1.12, so it must be a version similar with that.

NOTE: dependency management was done using Dep (dependency management tool for Go)

Running

To run this project just enter the command bellow:

Running in the terminal if you have golang installed:

make run

Building and Creating a Container:

make docker-build

Running the Container locally:

make docker-run

Requests

GET repos/{username}/starred?tag={tag}

  • To recover all starred repos by an user, the GET request will only need an URL parameter for the username. If a tag is passed in the query params the search will return starred repos that were tagged with that search information

GET /repos/{user}/starred/{repo}/recommendation

  • To recover all starred repos by an user, the GET request will need an URL parameter called for the username and for the repo that should be recommendated

POST /repos/{user}/starred/{repo}

  • To add a new tag for a repo
  • The body for the post request should be a JSON as: { "tag": "test" }

DELETE /repos/{user}/starred/{repo}

  • To add a delete tag for a repo
  • The body for the post request should be a JSON as: { "tag": "test" }

Pagination is implemented, the default Response has offset=0 and limit=10 for starred repos, if there is a need to change that just run the request with the below for example:

/repos/{username}/starred?offset=0&limit=10

Running the tests

The file main_test.go has the integration tests, which is required a connection to the db and Github

To run the tests locally just execute:

go test

Running on Docker

The endpoint and the Port are external varibles setup in the Dockerfile, if change is needed it is ok, but they are required.

Thanks ;D

github-tag-api's People

Contributors

joaopmgd avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.