Skip to main content

StealthIM FileAPI Upload/Download Command Toolkit

Project description

StealthIM FileAPI

文件接口 0.0.1

.proto 文件:./proto/fileapi.proto

hash 计算

hash 算法采用分块 Blake3 进行。具体分块如下:

将文件以预设大小分块(默认为 2048 KiB,需要与服务器一致)后计算每块 Blake3,将计算后的 hash binary 形式拼接后再计算一次 Blake3,得到最终 hash。

构建

依赖

Go 版本:1.24.1

软件包:protobuf protobuf-dev make

命令行工具 protoc make(gnumake)

go mod download
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

命令行

make # 构建并运行
make build # 构建可执行文件

# 构建指定环境
make build_windows
make build_linux
make build_docker

make release # 构建所有平台

make proto # 生成 proto

make clean # 清理

配置

默认会读取当前文件夹 config.toml 文件(不存在会自动生成模板)

docker 镜像为 cfg/config.toml

默认配置:

[server]
host = "127.0.0.1"
port = 50053
log = false

[dbgateway]
host = "127.0.0.1"
port = 50051
conn_num = 5
sql_timeout = 5000 # 单位:ms

[[filestorage]]
host = "127.0.0.1"
port = 50052
id = 0

# 多个存储单元配置
#
# [[filestorage]]
# host = "192.168.xx.xx"
# port = 50052
# id = 1
#
# 请保证 ID 唯一,在迁移时请使用相同的 ID

[storage]
timeout = 1000   # 单位:ms
check_time = 60  # 单位:s
blocksize = 2048 # 单位:KB
# 不建议更改,不超过 2048

也可使用 --config={PATH} 参数指定配置文件路径

命令行工具

命令行工具使用 Typer 构建。

命令行工具在打包前需要使用 makefile 构建 proto。

make proto_t # 生成工具用 proto
make clean # 清理

使用 poetry install 安装。

帮助信息请查看 stimfileapi --help

调试环境

确保你使用的是 Linux 环境并安装了 tmux

确保在父目录以原名 Clone 了 StealthimDBStealthIMFileStorage

make dev
# 命令会运行 run_env.sh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stimfileapi-0.1.2.tar.gz (15.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

stimfileapi-0.1.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

stimfileapi-0.1.2-cp313-cp313-manylinux_2_41_x86_64.whl (14.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.41+ x86-64

File details

Details for the file stimfileapi-0.1.2.tar.gz.

File metadata

  • Download URL: stimfileapi-0.1.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for stimfileapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8c937ebe5d0f3d578132bb18e08e9b592437459db80443b618d7e1aee290f34f
MD5 00fdf1e22b1cb167096c971f64642e34
BLAKE2b-256 99004fc41ef3ee080a4a75ff8553522b24c891cd56449e79f06419e0bb1445cc

See more details on using hashes here.

File details

Details for the file stimfileapi-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: stimfileapi-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for stimfileapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7058a55cf1f55cb42008e042b3cbe6813e6fe5973d3df5ddc96021e79b78d42
MD5 00ae77331d5e501fc864f3a8e592fd8f
BLAKE2b-256 07f983d9bc4e572cfcf719c18ba8ceda3ef625e48364789f1d3ff4f9b695dd18

See more details on using hashes here.

File details

Details for the file stimfileapi-0.1.2-cp313-cp313-manylinux_2_41_x86_64.whl.

File metadata

File hashes

Hashes for stimfileapi-0.1.2-cp313-cp313-manylinux_2_41_x86_64.whl
Algorithm Hash digest
SHA256 04c5bbbe271b8a016cdeae64143f3b983c7498de30b71026f038c402255e5a46
MD5 f5511bf85764228e2187430e2fd95bdc
BLAKE2b-256 8e684546b7ab264653be58b3628913aa06abb134e060c866a332daaa229db871

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page