NIM PC Cross Platform SDK
nim_nos_def.h
Go to the documentation of this file.
1
8#ifndef NIM_SDK_DLL_EXPORT_HEADERS_NOS_DEF_H_
9#define NIM_SDK_DLL_EXPORT_HEADERS_NOS_DEF_H_
10
11#include "public_defines.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
25};
39 const char* json_result,
40 const char* json_extension,
41 const void* user_data);
42
58typedef void (*nim_nos_download_cb_func)(int rescode,
59 const char* file_path,
60 const char* call_id,
61 const char* res_id,
62 const char* json_extension,
63 const void* user_data);
64
73typedef void (*nim_nos_download_prg_cb_func)(int64_t downloaded_size, int64_t file_size, const char* json_extension, const void* user_data);
74
82typedef void (*nim_nos_download_speed_cb_func)(int64_t download_speed, const char* json_extension, const void* user_data);
83
95typedef void (
96 *nim_nos_download_info_cb_func)(int64_t actual_download_size, int64_t download_speed, const char* json_extension, const void* user_data);
97
106typedef void (*nim_nos_upload_cb_func)(int rescode, const char* url, const char* json_extension, const void* user_data);
107
116typedef void (*nim_nos_upload_prg_cb_func)(int64_t uploaded_size, int64_t file_size, const char* json_extension, const void* user_data);
117
125typedef void (*nim_nos_upload_speed_cb_func)(int64_t upload_speed, const char* json_extension, const void* user_data);
126
135typedef void (*nim_nos_upload_info_cb_func)(int64_t actual_upload_size, int64_t upload_speed, const char* json_extension, const void* user_data);
136
144typedef void (*nim_nos_safeurl_to_originurl_cb_func)(int rescode, const char* origin_url, const void* user_data);
145
153typedef void (*nim_nos_custom_token_cb_func)(const char* url, char* token, const int length);
154
161};
162
165static const char* kNIMNosLowLimit = "low_limit";
167static const char* kNIMNosLowTime = "low_time";
169static const char* kNIMNosTimeout = "timeout";
171static const char* kNIMNosTaskId = "task_id";
173static const char* kNIMNosNeedContinueTrans = "continue_trans";
175static const char* kNIMNosFileSize = "download_filesize";
177static const char* kNIMNosSaveAsFilePath = "saveas_filepath";
179static const char* kNIMNosUploadType = "upload_type";
181static const char* kNIMNosDocTransName = "name";
183static const char* kNIMNosDocTransSourceType = "source_type";
185static const char* kNIMNosDocTransPicType = "pic_type";
187static const char* kNIMNosDocTransExt = "doc_trans_ext";
189static const char* kNIMNosUploadTag = "upload_tag"; // NOS扩展上传\下载接口参数json_extension Json key for nim_nos_upload_ex && nim_nos_download_ex
191
194static const char* kNIMNosResId = "res_id";
196static const char* kNIMNosCallId = "call_id"; // NOS扩展上传回调参数json_extension, Json key for upload cb
198
201static const char* kNIMNosDefaultTagResource = "nim_default_profile_icon";
203static const char* kNIMNosDefaultTagIM = "nim_default_im"; // NOS 上传文件到Nos缺省tag定义
205
208static const char* kNIMNosUploadTagName = "nim_nos_tag_name";
210static const char* kNIMNosUploadTagSurvivalTime = "nim_nos_tag_survival_time";
212static const char* kNIMNosInitConfigSucceed = "nim_nos_init_config_succeed";
214static const char* kNIMNosInitConfigFailure = "nim_nos_init_config_failure";
216static const char* kNIMNosInitConfigIgnore = "nim_nos_init_config_ignore";
218static const char* kNIMNosInitConfigErrcode = "nim_nos_init_config_errcode";
220static const char* kNIMNosInitConfigRetcode = "nim_nos_init_config_retcode"; // NOS 初始化参数定义
222
223#ifdef __cplusplus
224};
225#endif //__cplusplus
226#endif // NIM_SDK_DLL_EXPORT_HEADERS_NOS_DEF_H_
void(* nim_nos_upload_cb_func)(int rescode, const char *url, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:106
static const char * kNIMNosInitConfigSucceed
string array 初始化成功了的tag
Definition: nim_nos_def.h:212
static const char * kNIMNosDocTransPicType
NIMDocTranscodingImageType (HTTP上传转码文档使用)转码目标图片的文件类型, nim_doc_trans_def.h.
Definition: nim_nos_def.h:185
static const char * kNIMNosUploadTagSurvivalTime
int32_t 资源所对应的tag生命周期 s
Definition: nim_nos_def.h:210
static const char * kNIMNosDefaultTagResource
string 资源类文件上传tag 如头像、群头像等, 可以通过 nim_nos_init_tags修改资源的过期时间
Definition: nim_nos_def.h:201
static const char * kNIMNosDocTransExt
string (HTTP上传转码文档使用)文档转换时的扩展参数,在成功后能查询到
Definition: nim_nos_def.h:187
static const char * kNIMNosLowTime
int HTTP通用配置,传输过程中当low_time秒时间内传输速度小于low_limit时(字节每秒),下载任务会返回超时而取消(默认60)
Definition: nim_nos_def.h:167
static const char * kNIMNosUploadTag
string, 上传文件时使用的场景标签(可参见nos删除策略)
Definition: nim_nos_def.h:189
static const char * kNIMNosUploadType
NIMNosUploadType HTTP上传任务的类型
Definition: nim_nos_def.h:179
void(* nim_nos_download_speed_cb_func)(int64_t download_speed, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:82
static const char * kNIMNosResId
string 上传文件的id,如果是文档转换则为服务器的文档id
Definition: nim_nos_def.h:194
static const char * kNIMNosDocTransName
string (HTTP上传转码文档使用)名称
Definition: nim_nos_def.h:181
static const char * kNIMNosInitConfigErrcode
int 初始化tag失败时的错误码
Definition: nim_nos_def.h:218
void(* nim_nos_download_info_cb_func)(int64_t actual_download_size, int64_t download_speed, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:96
static const char * kNIMNosTimeout
int HTTP通用配置,超时时间,单位ms,下载时最小10000,上传时最小30000,不设置默认30000
Definition: nim_nos_def.h:169
static const char * kNIMNosDefaultTagIM
string im消息类文件上传tag 如图片、文件、音视频消息等, 可以通过 nim_nos_init_tags修改资源的过期时间
Definition: nim_nos_def.h:203
static const char * kNIMNosInitConfigRetcode
NIMNosInitConfigResultType nos config初始化结果
Definition: nim_nos_def.h:220
static const char * kNIMNosSaveAsFilePath
string HTTP下载任务的文件存放本地路径,不填则默认路径回调中返回
Definition: nim_nos_def.h:177
void(* nim_nos_custom_token_cb_func)(const char *url, char *token, const int length)
Definition: nim_nos_def.h:153
static const char * kNIMNosTaskId
HTTP通用配置,任务ID,上传下载断点续传必填,如果传入的ID是曾经未完成的需要续传功能的传输任务的ID,则会开始续传(用户需要保证ID的唯一性)
Definition: nim_nos_def.h:171
NIMNosInitConfigResultType
Definition: nim_nos_def.h:16
@ kNIMNosInitConfResTypePartSuccessful
部分tag初始化成功,失败的tag及错误码可以解析json_result来取得
Definition: nim_nos_def.h:22
@ kNIMNosInitConfResTypeFailure
所有tag初始化失败
Definition: nim_nos_def.h:24
@ kNIMNosInitConfResTypeSuccess
所有tag初始成功
Definition: nim_nos_def.h:20
@ kNIMNosInitConfResTypeTagCountOF
自定义tag数量超过最大数量
Definition: nim_nos_def.h:18
static const char * kNIMNosFileSize
int64 HTTP下载任务的文件大小,需要续传功能必填,单位Byte,其他情况不需要填
Definition: nim_nos_def.h:175
void(* nim_nos_safeurl_to_originurl_cb_func)(int rescode, const char *origin_url, const void *user_data)
Definition: nim_nos_def.h:144
static const char * kNIMNosLowLimit
int HTTP通用配置,传输速度,每秒字节数(默认10)
Definition: nim_nos_def.h:165
NIMNosUploadType
Definition: nim_nos_def.h:156
@ kNIMNosUploadTypeNormal
普通文件上传
Definition: nim_nos_def.h:158
@ kNIMNosUploadTypeDocTrans
文档转换上传
Definition: nim_nos_def.h:160
void(* nim_nos_download_cb_func)(int rescode, const char *file_path, const char *call_id, const char *res_id, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:58
static const char * kNIMNosInitConfigIgnore
string array 因为指定的survival_time 相同而被忽略了的tag
Definition: nim_nos_def.h:216
void(* nim_nos_download_prg_cb_func)(int64_t downloaded_size, int64_t file_size, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:73
void(* nim_nos_upload_prg_cb_func)(int64_t uploaded_size, int64_t file_size, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:116
static const char * kNIMNosUploadTagName
string tag的名称
Definition: nim_nos_def.h:208
void(* nim_nos_upload_speed_cb_func)(int64_t upload_speed, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:125
static const char * kNIMNosNeedContinueTrans
bool HTTP通用配置,任务是否需要续传功能
Definition: nim_nos_def.h:173
static const char * kNIMNosDocTransSourceType
NIMDocTranscodingFileType (HTTP上传转码文档使用)转码源文档的文件类型, nim_doc_trans_def.h.
Definition: nim_nos_def.h:183
static const char * kNIMNosCallId
string 上传文件的会话id
Definition: nim_nos_def.h:196
static const char * kNIMNosInitConfigFailure
object array 初始化失败了的tag
Definition: nim_nos_def.h:214
void(* nim_nos_upload_info_cb_func)(int64_t actual_upload_size, int64_t upload_speed, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:135
void(* nim_nos_init_config_cb_func)(enum NIMNosInitConfigResultType rescode, const char *json_result, const char *json_extension, const void *user_data)
Definition: nim_nos_def.h:38
NIM SDK 及 NIM ChatRoom SDK 公用头文件