sv222 / k8s-best-repos

This is a Go project built with the Gin HTTP web framework that uses the GitHub API to search and display repositories with pagination.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Best Kubernetes Repos (GitHub-API-Search)

This is a simple project built with Go (using Gin HTTP web framework) that demonstrates how to use the GitHub API to search for repositories that match certain criteria, and how to display the search results on a web page with pagination.

Installation

  1. Clone the repository:
git clone https://github.com/sv222/k8s-best-repos.git
  1. Install the dependencies:
go mod tidy
  1. Create a config.json file in the root directory with your GitHub access token in the following format:
   {
       "access_token": "YOUR_ACCESS_TOKEN"
   }

Make sure your access token has the necessary permissions to search for repositories (see GitHub documentation for details). 4. Start the server:

go run main.go
  1. Open your web browser and go to http://localhost:8080

Usage

In the current example the web page displays a table of the top 10 GitHub repositories that match the following criteria:

  • The repository description includes the word "kubernetes"
  • The repository has more than 100 stars
  • The repositories are sorted in descending order of the number of stars.
  • The table includes the repository name, the number of stars, and a link to the repository.

Contributing

Feel free to contribute to this project by submitting pull requests or reporting issues.

License

This project is licensed under the MIT License.

About

This is a Go project built with the Gin HTTP web framework that uses the GitHub API to search and display repositories with pagination.


Languages

Language:Go 100.0%