https://github.com/opengapps/package-api
API to list OpenGApps assets on the website
https://github.com/opengapps/package-api
api go opengapps
Last synced: 12 months ago
JSON representation
API to list OpenGApps assets on the website
- Host: GitHub
- URL: https://github.com/opengapps/package-api
- Owner: opengapps
- License: apache-2.0
- Created: 2019-08-20T10:22:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T11:24:30.000Z (about 2 years ago)
- Last Synced: 2025-04-11T02:08:52.473Z (over 1 year ago)
- Topics: api, go, opengapps
- Language: Go
- Size: 146 KB
- Stars: 9
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenGApps Package API [](https://circleci.com/gh/opengapps/package-api/tree/master) [](https://goreportcard.com/report/github.com/opengapps/package-api)
This is the implementation of the [opengapps.org](https://opengapps.org) backend.
This project adheres to the Golang [project-layout](https://github.com/golang-standards/project-layout) structure.
## Purpose
Since the website has transitioned to the SourceForge storage from Github releases, we've lost Github API support.
So, to compensate for that, this service was created.
## Installation
The service uses Go modules for vendoring.
To install it, starting with Go 1.12 you can just use `go get`:
```shellscript
go get github.com/opengapps/package-api/cmd/package-api
```
Also you can clone this repo and use the build/install/run targets from [Makefile](./Makefile).
## Configuration
You can use any config file format supported by [Viper](https://github.com/spf13/viper) library (currently our preferred format is [TOML](https://github.com/toml-lang/toml)).
In case you don't want to use local config, it will rely on ENV variables with prefix `PACKAGE_API_` (can be changed in [Makefile](./Makefile)).
Example config can be found at [config_example.toml](./resources/config_example.toml).
## Usage
This API only exposes two endpoints: `/list` and `/download`.
### Request format
| Method | Endpoint | Parameters |
| ------ | ----------- | ------------------------------------------------------------- |
| `GET` | `/list` | None |
| `GET` | `/download` | `arch={ARCHITECTURE}&api={API}&variant={VARIANT}&date={DATE}` |
### Response codes
- **200**: successful response;
- **404**: on bad request format or improper parameters;
- **500**: mostly on external call failures.