Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baraja-core/gitlab-api
Simple and robust GitLab API wrapper with Tracy debug mode.
https://github.com/baraja-core/gitlab-api
gitlab-api gitlab-tracy-panel konfigurace nette
Last synced: 3 months ago
JSON representation
Simple and robust GitLab API wrapper with Tracy debug mode.
- Host: GitHub
- URL: https://github.com/baraja-core/gitlab-api
- Owner: baraja-core
- License: mit
- Created: 2019-10-09T12:17:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-10T04:37:46.000Z (7 months ago)
- Last Synced: 2024-10-07T03:23:04.381Z (4 months ago)
- Topics: gitlab-api, gitlab-tracy-panel, konfigurace, nette
- Language: PHP
- Size: 260 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
GitLab API for Nette
====================![Integrity check](https://github.com/baraja-core/gitlab-api/workflows/Integrity%20check/badge.svg)
This package serves as a transport layer between a specific application and GitLab.
With this package, you can easily submit queries to GitLab, detect error messages in the Tracy bar, and monitor request load.
Requests of type `GET` are automatically cached for `12 hours` unless told otherwise.
Requests like `POST`, `PUT`, `DELETE` and other change actions are not cached at all and we always retransmit all data.
![GitLab Tracy panel](/src/gitlab-api-tracy.png "GitLab Tracy panel")
Installation
---------Use the Composer command:
```shell
composer require baraja-core/gitlab-api
```Next, you need to set the service configuration for Nette in the NEON file.
Default minimum configuration:
```yaml
services:
gitLabAPI:
factory: baraja\GitLabApi\GitLabApi(%gitLab.token%)parameters:
gitLab:
token: 123-abcDEFghiJKL-789tracy:
bar:
- Baraja\GitLabApi\GitLabApiPanel
```You must always change the API token for your user account!
Configuration
-----------In the `parameters` section, you need to enter the default API token to connect to GitLab:
Example:
```yaml
parameters:
gitLab:
token: 123-abcDEFghiJKL-789
```Optionally, you can set to use Nette Cache:
```yaml
services:
gitLabAPI:
factory: baraja\GitLabApi\GitLabApi(%gitLab.token%)
setup:
- setCache(@cache.storage)
```Linking to a custom GitLab installation
------------------------------------In some cases, you need to link the API to the internal corporate network where GitLab is hosted. This is done by using the `setBaseUrl()` method with a domain path.
The passed parameter can be, for example, the string `'https://gitlab.com/api/v4/'`.