Skip to content

关于thrift服务的描述语言 #8

@manuel76413

Description

@manuel76413

因需要使用C++写文件,要直接落盘到wfs,准备用C++Thrift协议实现客户端

但是测试了很久,发现对照着go语言已经编译的代码,无论调用什么RPC,都是被服务器关闭

所以求 wfs. thrift 文件,以及安全认证的使用方式

已提取的 .thrift 结构如下:

// mywfs.thrift - WFS服务接口定义
// 生成c++命令: thrift --gen cpp -o . mywfs.thrift

namespace go stub
namespace cpp wfs.stub

// 错误信息结构
struct WfsError {
1: i32 code,
2: string info
}

// 操作结果结构
struct Ack {
1: bool ok,
2: optional WfsError error
}

// 文件结构
struct WfsFile {
1: binary data,
2: string name
}

// 目录列表项结构
struct DirItem {
1: string name,
2: i64 size,
3: i64 mtime,
4: bool isDir
}

// 目录列表结构
struct DirList {
1: string path,
2: list items,
3: optional WfsError error
}

// WFS 服务接口
service WfsService {
// 上传文件
Ack Append(1: WfsFile wf),

// 获取文件
WfsFile Get(1: string path),

// 删除文件
Ack Delete(1: string path),

// 重命名文件
Ack Rename(1: string oldpath, 2: string newpath),

// 获取目录列表
DirList List(1: string path),

// 健康检查
i8 Ping()

}

很遗憾是C++暂无法使用,也可能是先要解决认证的问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions