NIM SDK API  8.0.0
Typedefs | Enumerations
nim_nos_def.h File Reference

NOS云存储服务 接口相关的常量函数等定义头文件 More...

#include "public_define/nim_util_include.h"

Go to the source code of this file.

Typedefs

typedef void(* nim_nos_init_config_cb_func) (enum NIMNosInitConfigResultType rescode, const char *json_result, const char *json_extension, const void *user_data)
 
typedef 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)
 
typedef void(* nim_nos_download_prg_cb_func) (int64_t downloaded_size, int64_t file_size, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_download_speed_cb_func) (int64_t download_speed, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_download_info_cb_func) (int64_t actual_download_size, int64_t download_speed, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_upload_cb_func) (int rescode, const char *url, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_upload_prg_cb_func) (int64_t uploaded_size, int64_t file_size, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_upload_speed_cb_func) (int64_t upload_speed, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_upload_info_cb_func) (int64_t actual_upload_size, int64_t upload_speed, const char *json_extension, const void *user_data)
 
typedef void(* nim_nos_safeurl_to_originurl_cb_func) (int rescode, const char *origin_url, const void *user_data)
 

Enumerations

enum  NIMNosInitConfigResultType { kNIMNosInitConfResTypeTagCountOF = 0, kNIMNosInitConfResTypeSuccess, kNIMNosInitConfResTypePartSuccessful, kNIMNosInitConfResTypeFailure }
 
enum  NIMNosUploadType { kNIMNosUploadTypeNormal = 0, kNIMNosUploadTypeDocTrans = 1 }
 

Variables

NOS扩展上传\下载接口参数json_extension Json key for nim_nos_upload_ex && nim_nos_download_ex
static const char * kNIMNosLowLimit = "low_limit"
 
static const char * kNIMNosLowTime = "low_time"
 
static const char * kNIMNosTimeout = "timeout"
 
static const char * kNIMNosTaskId = "task_id"
 
static const char * kNIMNosNeedContinueTrans = "continue_trans"
 
static const char * kNIMNosFileSize = "download_filesize"
 
static const char * kNIMNosSaveAsFilePath = "saveas_filepath"
 
static const char * kNIMNosUploadType = "upload_type"
 
static const char * kNIMNosDocTransName = "name"
 
static const char * kNIMNosDocTransSourceType = "source_type"
 
static const char * kNIMNosDocTransPicType = "pic_type"
 
static const char * kNIMNosDocTransExt = "doc_trans_ext"
 
static const char * kNIMNosUploadTag = "upload_tag"
 
NOS扩展上传回调参数json_extension, Json key for upload cb
static const char * kNIMNosResId = "res_id"
 
static const char * kNIMNosCallId = "call_id"
 
NOS 上传文件到Nos缺省tag定义
static const char * kNIMNosDefaultTagResource = "nim_default_profile_icon"
 
static const char * kNIMNosDefaultTagIM = "nim_default_im"
 
NOS 初始化参数定义 Json key for nim_nos_init_config_cb_func & nim_nos_init_config
static const char * kNIMNosUploadTagName = "nim_nos_tag_name"
 
static const char * kNIMNosUploadTagSurvivalTime = "nim_nos_tag_survival_time"
 
static const char * kNIMNosInitConfigSucceed = "nim_nos_init_config_succeed"
 
static const char * kNIMNosInitConfigFailure = "nim_nos_init_config_failure"
 
static const char * kNIMNosInitConfigIgnore = "nim_nos_init_config_ignore"
 
static const char * kNIMNosInitConfigErrcode = "nim_nos_init_config_errcode"
 
static const char * kNIMNosInitConfigRetcode = "nim_nos_init_config_retcode"
 

Detailed Description

NOS云存储服务 接口相关的常量函数等定义头文件

Author
Oleg
Date
2015/2/1

Typedef Documentation

◆ nim_nos_download_cb_func

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)

nim callback function for nos http download

Parameters
[out]rescode下载结果,一切正常200
[out]file_path下载资源文件本地绝对路径
[out]call_id如果下载的是消息中的资源,则为消息所属的会话id,否则为空
[out]res_id如果下载的是消息中的资源,则为消息id,否则为空
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_download_info_cb_func

void(* nim_nos_download_info_cb_func)(int64_t actual_download_size, int64_t download_speed, const char *json_extension, const void *user_data)

nim callback function for nos http download info

Parameters
[out]actual_download_size最终实际下载数据大小
[out]download_speed平均下载速度
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_download_prg_cb_func

void(* nim_nos_download_prg_cb_func)(int64_t downloaded_size, int64_t file_size, const char *json_extension, const void *user_data)

nim callback function for nos http download progress

Parameters
[out]downloaded_size已下载数据大小
[out]file_size文件大小
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_download_speed_cb_func

void(* nim_nos_download_speed_cb_func)(int64_t download_speed, const char *json_extension, const void *user_data)

nim callback function for nos http download speed

Parameters
[out]download_speed下载速度
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_init_config_cb_func

void(* nim_nos_init_config_cb_func)(enum NIMNosInitConfigResultType rescode, const char *json_result, const char *json_extension, const void *user_data)

nim callback function for nos init config

Parameters
[out]rescode结果,参考NIMNosInitConfigResultType定义
[out]json_result初始化详细结果,包含了成功的tag,失败的tag及错误码,被忽略的(因为指定的生命周期与上次指定的生命周期相同,没有必要重新初始化)tag
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_safeurl_to_originurl_cb_func

void(* nim_nos_safeurl_to_originurl_cb_func)(int rescode, const char *origin_url, const void *user_data)

nim callback function for safe url to origin url

Parameters
[out]rescode返回的错误码,200成功,404,传入的安全链接(短链)不存在,或不是有效的安全链接(短链)
[out]origin_url源链(长链)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_upload_cb_func

void(* nim_nos_upload_cb_func)(int rescode, const char *url, const char *json_extension, const void *user_data)

nim callback function for nos http upload

Parameters
[out]rescode上传结果,一切正常200
[out]urlurl
[out]json_extensionjson扩展数据,解析字段见 nim_nos_def.h "NOS扩展上传回调参数json_extension, Json key for upload cb"
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_upload_info_cb_func

void(* nim_nos_upload_info_cb_func)(int64_t actual_upload_size, int64_t upload_speed, const char *json_extension, const void *user_data)

nim callback function for nos http upload info

Parameters
[out]actual_upload_size最终实际上传数据大小
[out]upload_speed平均上传速度
[out]json_extensionjson扩展数据,返回kNIMNosResId
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_upload_prg_cb_func

void(* nim_nos_upload_prg_cb_func)(int64_t uploaded_size, int64_t file_size, const char *json_extension, const void *user_data)

nim callback function for nos http upload progress

Parameters
[out]uploaded_size已上传数据大小
[out]file_size文件大小
[out]json_extensionjson扩展数据,返回kNIMNosResId
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_nos_upload_speed_cb_func

void(* nim_nos_upload_speed_cb_func)(int64_t upload_speed, const char *json_extension, const void *user_data)

nim callback function for nos http upload speed

Parameters
[out]upload_speed上传速度
[out]json_extensionjson扩展数据,返回kNIMNosResId
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

Enumeration Type Documentation

◆ NIMNosInitConfigResultType

Enumerator
kNIMNosInitConfResTypeTagCountOF 

自定义tag数量超过最大数量

kNIMNosInitConfResTypeSuccess 

所有tag初始成功

kNIMNosInitConfResTypePartSuccessful 

部分tag初始化成功,失败的tag及错误码可以解析json_result来取得

kNIMNosInitConfResTypeFailure 

所有tag初始化失败

◆ NIMNosUploadType

NOS扩展类型

Enumerator
kNIMNosUploadTypeNormal 

普通文件上传

kNIMNosUploadTypeDocTrans 

文档转换上传

Variable Documentation

◆ kNIMNosCallId

const char* kNIMNosCallId = "call_id"
static

string 上传文件的会话id

◆ kNIMNosDefaultTagIM

const char* kNIMNosDefaultTagIM = "nim_default_im"
static

string im消息类文件上传tag 如图片、文件、音视频消息等, 可以通过 nim_nos_init_tags修改资源的过期时间

◆ kNIMNosDefaultTagResource

const char* kNIMNosDefaultTagResource = "nim_default_profile_icon"
static

string 资源类文件上传tag 如头像、群头像等, 可以通过 nim_nos_init_tags修改资源的过期时间

◆ kNIMNosDocTransExt

const char* kNIMNosDocTransExt = "doc_trans_ext"
static

string (HTTP上传转码文档使用)文档转换时的扩展参数,在成功后能查询到

◆ kNIMNosDocTransName

const char* kNIMNosDocTransName = "name"
static

string (HTTP上传转码文档使用)名称

◆ kNIMNosDocTransPicType

const char* kNIMNosDocTransPicType = "pic_type"
static

NIMDocTranscodingImageType (HTTP上传转码文档使用)转码目标图片的文件类型, nim_doc_trans_def.h

◆ kNIMNosDocTransSourceType

const char* kNIMNosDocTransSourceType = "source_type"
static

NIMDocTranscodingFileType (HTTP上传转码文档使用)转码源文档的文件类型, nim_doc_trans_def.h

◆ kNIMNosFileSize

const char* kNIMNosFileSize = "download_filesize"
static

int64 HTTP下载任务的文件大小,需要续传功能必填,单位Byte,其他情况不需要填

◆ kNIMNosInitConfigErrcode

const char* kNIMNosInitConfigErrcode = "nim_nos_init_config_errcode"
static

int 初始化tag失败时的错误码

◆ kNIMNosInitConfigFailure

const char* kNIMNosInitConfigFailure = "nim_nos_init_config_failure"
static

object array 初始化失败了的tag

◆ kNIMNosInitConfigIgnore

const char* kNIMNosInitConfigIgnore = "nim_nos_init_config_ignore"
static

string array 因为指定的survival_time 相同而被忽略了的tag

◆ kNIMNosInitConfigRetcode

const char* kNIMNosInitConfigRetcode = "nim_nos_init_config_retcode"
static

NIMNosInitConfigResultType nos config初始化结果

◆ kNIMNosInitConfigSucceed

const char* kNIMNosInitConfigSucceed = "nim_nos_init_config_succeed"
static

string array 初始化成功了的tag

◆ kNIMNosLowLimit

const char* kNIMNosLowLimit = "low_limit"
static

int HTTP通用配置,传输速度,每秒字节数(默认10)

◆ kNIMNosLowTime

const char* kNIMNosLowTime = "low_time"
static

int HTTP通用配置,传输过程中当low_time秒时间内传输速度小于low_limit时(字节每秒),下载任务会返回超时而取消(默认60)

◆ kNIMNosNeedContinueTrans

const char* kNIMNosNeedContinueTrans = "continue_trans"
static

bool HTTP通用配置,任务是否需要续传功能

◆ kNIMNosResId

const char* kNIMNosResId = "res_id"
static

string 上传文件的id,如果是文档转换则为服务器的文档id

◆ kNIMNosSaveAsFilePath

const char* kNIMNosSaveAsFilePath = "saveas_filepath"
static

string HTTP下载任务的文件存放本地路径,不填则默认路径回调中返回

◆ kNIMNosTaskId

const char* kNIMNosTaskId = "task_id"
static

string HTTP通用配置,任务ID,上传下载断点续传必填,如果传入的ID是曾经未完成的需要续传功能的传输任务的ID,则会开始续传(用户需要保证ID的唯一性)

◆ kNIMNosTimeout

const char* kNIMNosTimeout = "timeout"
static

int HTTP通用配置,超时时间,单位ms,下载时最小10000,上传时最小30000,不设置默认30000

◆ kNIMNosUploadTag

const char* kNIMNosUploadTag = "upload_tag"
static

string, 上传文件时使用的场景标签(可参见nos删除策略)

◆ kNIMNosUploadTagName

const char* kNIMNosUploadTagName = "nim_nos_tag_name"
static

string tag的名称

◆ kNIMNosUploadTagSurvivalTime

const char* kNIMNosUploadTagSurvivalTime = "nim_nos_tag_survival_time"
static

int32_t 资源所对应的tag生命周期 s

◆ kNIMNosUploadType

const char* kNIMNosUploadType = "upload_type"
static

NIMNosUploadType HTTP上传任务的类型