mirror of
https://github.com/logos-storage/logos-storage-go-bindings-example.git
synced 2026-01-04 22:43:07 +00:00
Debug
This commit is contained in:
parent
c393fa04da
commit
446b37fc06
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
@ -10,25 +10,25 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- os: ubuntu-latest
|
||||
name: linux
|
||||
cpu: amd64
|
||||
lib_ext: so
|
||||
# - os: ubuntu-latest
|
||||
# name: linux
|
||||
# cpu: amd64
|
||||
# lib_ext: so
|
||||
|
||||
- os: ubuntu-24.04-arm
|
||||
cpu: arm64
|
||||
name: linux
|
||||
lib_ext: so
|
||||
# - os: ubuntu-24.04-arm
|
||||
# cpu: arm64
|
||||
# name: linux
|
||||
# lib_ext: so
|
||||
|
||||
- os: macos-latest
|
||||
lib_ext: so
|
||||
name: macos
|
||||
cpu: arm64
|
||||
|
||||
- os: windows-latest
|
||||
cpu: amd64
|
||||
name: windows
|
||||
lib_ext: dll
|
||||
# - os: windows-latest
|
||||
# cpu: amd64
|
||||
# name: windows
|
||||
# lib_ext: dll
|
||||
|
||||
steps:
|
||||
- name: Check out sources
|
||||
@ -41,11 +41,11 @@ jobs:
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Fetch artifacts
|
||||
env:
|
||||
OS: ${{ matrix.target.name }}
|
||||
ARCH: ${{ matrix.target.cpu }}
|
||||
run: make fetch
|
||||
# - name: Fetch artifacts
|
||||
# env:
|
||||
# OS: ${{ matrix.target.name }}
|
||||
# ARCH: ${{ matrix.target.cpu }}
|
||||
# run: make fetch
|
||||
|
||||
- name: Build
|
||||
run: make build
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
# Ignore artifacts downloaded
|
||||
libs
|
||||
# libs
|
||||
|
||||
# Ignore file downloaded
|
||||
hello.txt
|
||||
|
||||
BIN
libs/libcodex.dylib
Executable file
BIN
libs/libcodex.dylib
Executable file
Binary file not shown.
200
libs/libcodex.h
Normal file
200
libs/libcodex.h
Normal file
@ -0,0 +1,200 @@
|
||||
/**
|
||||
* libcodex.h - C Interface for Example Library
|
||||
*
|
||||
* This header provides the public API for libcodex
|
||||
*
|
||||
* To see the auto-generated header by Nim, run `make libcodex` from the
|
||||
* repository root. The generated file will be created at:
|
||||
* nimcache/release/libcodex/libcodex.h
|
||||
*/
|
||||
|
||||
#ifndef __libcodex__
|
||||
#define __libcodex__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// The possible returned values for the functions that return int
|
||||
#define RET_OK 0
|
||||
#define RET_ERR 1
|
||||
#define RET_MISSING_CALLBACK 2
|
||||
#define RET_PROGRESS 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*CodexCallback) (int callerRet, const char* msg, size_t len, void* userData);
|
||||
|
||||
void* codex_new(
|
||||
const char* configJson,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_version(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_revision(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_repo(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_debug(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_spr(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_peer_id(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_log_level(
|
||||
void* ctx,
|
||||
const char* logLevel,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_connect(
|
||||
void* ctx,
|
||||
const char* peerId,
|
||||
const char** peerAddresses,
|
||||
size_t peerAddressesSize,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_peer_debug(
|
||||
void* ctx,
|
||||
const char* peerId,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
|
||||
int codex_upload_init(
|
||||
void* ctx,
|
||||
const char* filepath,
|
||||
size_t chunkSize,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_upload_chunk(
|
||||
void* ctx,
|
||||
const char* sessionId,
|
||||
const uint8_t* chunk,
|
||||
size_t len,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_upload_finalize(
|
||||
void* ctx,
|
||||
const char* sessionId,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_upload_cancel(
|
||||
void* ctx,
|
||||
const char* sessionId,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_upload_file(
|
||||
void* ctx,
|
||||
const char* sessionId,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_download_stream(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
size_t chunkSize,
|
||||
bool local,
|
||||
const char* filepath,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_download_init(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
size_t chunkSize,
|
||||
bool local,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_download_chunk(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_download_cancel(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_download_manifest(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_storage_list(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_storage_space(
|
||||
void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_storage_delete(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_storage_fetch(
|
||||
void* ctx,
|
||||
const char* cid,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_start(void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_stop(void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
int codex_close(void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
// Destroys an instance of a codex node created with codex_new
|
||||
int codex_destroy(void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
void codex_set_event_callback(void* ctx,
|
||||
CodexCallback callback,
|
||||
void* userData);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __libcodex__ */
|
||||
Loading…
x
Reference in New Issue
Block a user