/* This file is part of FediBlock-backend. * Copyright © 2020 tastytea * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ #ifndef FEDIBLOCK_BACKEND_GITEA_HPP #define FEDIBLOCK_BACKEND_GITEA_HPP #include "cgi.hpp" #include #include namespace FediBlock::gitea { using std::uint64_t; using std::string_view; // Initialize the curl connection handle. void init(); // Clean up the curl connection handle. void cleanup(); // No-op write function. Discards HTTP response bodies. size_t noop_cb(void *ptr, size_t size, size_t nmemb, void *data); // Make a HTTP POST request to the Gitea API. void api_request(string_view path, string_view body); // Make a pull request. void pull_request(string_view branch, const cgi::entry_type &entry); [[nodiscard]] uint64_t get_last_pr_id(); } // namespace FediBlock::gitea #endif // FEDIBLOCK_BACKEND_GITEA_HPP