gogsapi.php 546 B

12345678910111213141516171819202122232425
  1. <?php namespace Client;
  2. class GogsAPI {
  3. use \Lib\Curl;
  4. public function __construct($api_url, $api_token) {
  5. $this->url = $api_url;
  6. $this->token = $api_token;
  7. }
  8. public function users() {
  9. return new Request\Users($this->url, $this->token);
  10. }
  11. public function repos() {
  12. return new Request\Repos($this->url, $this->token);
  13. }
  14. public function user(string $name = "me") {
  15. return new Request\User($this->url, $this->token, $name);
  16. }
  17. public function __destruct() {}
  18. }
  19. ?>