linglong/external/http
ice909 4eaac1fe9a chore: change the connection timeout period to 5 seconds
Users can set the timeout period using environment variables `LINGLONG_CONNECT_TIMEOUT`.

Signed-off-by: ice909 <gaochang1@uniontech.com>
2025-04-07 17:30:11 +08:00
..
.openapi-generator chore: regenerator http api code 2025-03-11 17:16:29 +08:00
api chore: regenerator http api code 2025-03-11 17:16:29 +08:00
external refactor: use libcurl to replace QT NetworkManager 2024-09-26 19:09:16 +08:00
include feat: custom user-agent with api client and ostree 2024-12-04 09:54:49 +08:00
model chore: regenerator http api code 2025-03-11 17:16:29 +08:00
src chore: change the connection timeout period to 5 seconds 2025-04-07 17:30:11 +08:00
unit-test chore: regenerator http api code 2025-03-11 17:16:29 +08:00
.openapi-generator-ignore feat: use openapi generator cpp code for http api 2023-11-29 09:03:59 +08:00
CMakeLists.txt chore: regenerator http api code 2025-03-11 17:16:29 +08:00
Packing.cmake refactor: use libcurl to replace QT NetworkManager 2024-09-26 19:09:16 +08:00
README.md chore: regenerator http api code 2025-03-11 17:16:29 +08:00
libcurl.licence refactor: use libcurl to replace QT NetworkManager 2024-09-26 19:09:16 +08:00
uncrustify-rules.cfg refactor: use libcurl to replace QT NetworkManager 2024-09-26 19:09:16 +08:00

README.md

C API client for linglong

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version:
  • Generator version: 7.8.0
  • Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen For more information, please visit https://linglong.dev

Installation

You'll need the curl 7.58.0 package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later.

Prerequisites

Install the curl 7.58.0 package with the following command on Linux.

sudo apt remove curl
wget http://curl.haxx.se/download/curl-7.58.0.tar.gz
tar -xvf curl-7.58.0.tar.gz
cd curl-7.58.0/
./configure
make
sudo make install

Install the uncrustify 0.67 package with the following command on Linux.

git clone https://github.com/uncrustify/uncrustify.git
cd uncrustify
mkdir build
cd build
cmake ..
make
sudo make install

Compile the sample:

This will compile the generated code and create a library in the build folder which has to be linked to the codes where API will be used.

mkdir build
cd build
// To install library to specific location, use following commands
cmake -DCMAKE_INSTALL_PREFIX=/pathtolocation ..
// for normal install use following command
cmake ..
make
sudo make install

How to use compiled library

Considering the test/source code which uses the API is written in main.c(respective api include is written and all objects necessary are defined and created)

To compile main.c(considering the file is present in build folder) use following command -L - location of the library(not required if cmake with normal installation is performed) -l library name

gcc main.c -L. -llinglong -o main

Once compiled, you can run it with ./main

Note: You don't need to specify includes for models and include folder separately as they are path linked. You just have to import the api.h file in your code, the include linking will work.

Documentation for API Endpoints

All URIs are relative to http://localhost

Category Method HTTP request Description
ClientAPI ClientAPI_apiV1ReposGet GET /api/v1/repos 查看仓库列表
ClientAPI ClientAPI_fuzzySearchApp POST /api/v0/apps/fuzzysearchapp 模糊查找App
ClientAPI ClientAPI_getRepo GET /api/v1/repos/{repo} 查看仓库信息
ClientAPI ClientAPI_newUploadTaskID POST /api/v1/upload-tasks generate a new upload task id
ClientAPI ClientAPI_refDelete DELETE /api/v1/repos/{repo}/refs/{channel}/{app_id}/{version}/{arch}/{module} delete a ref from repo
ClientAPI ClientAPI_searchApp GET /api/v2/search/apps 查找App
ClientAPI ClientAPI_signIn POST /api/v1/sign-in 登陆帐号
ClientAPI ClientAPI_uploadTaskFile PUT /api/v1/upload-tasks/{task_id}/tar upload tgz file to upload task
ClientAPI ClientAPI_uploadTaskInfo GET /api/v1/upload-tasks/{task_id}/status get upload task status
ClientAPI ClientAPI_uploadTaskLayerFile PUT /api/v1/upload-tasks/{task_id}/layer upload layer file to upload task

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Token

  • Type: API key

  • API key parameter name: X-Token

  • Location: HTTP header

Author

wurongjie@deepin.org