NodeSDK-Base
v1.0.2
Published
node.js module simulates php sdk base functions, such as curl, syslog and etc.
Downloads
3
Maintainers
Readme
[sdk-base] 中文文档
简介
sdk-base是所有nodejs的服务sdk的基础依赖,所有的sdk均需要引入sdk-base来实现基础的curl,syslog等功能。 在具体的代码中,sdk-base以父类的形式存在。
version: 1.x.x 使用的是旧版node-gyp 和 gcc, node版本需要v0.12.7,不能使用新的node版本,否则modern-syslog编译会出错。 version: 2.x.x 解决了1.x.x的问题,node,npm版本均可以升级到最新版本,需要将gcc升级到4。
参数
{Object} config 传入配置对象
- hostname: 域名。必填,当域名解析时,直接使用域名即可。
- port: 端口号。 必填。如8360端口。
- logType: 必填,syslog类型名。一般会有具体业务SDK传入。
- logTag: 必填,syslog标签名。一般会有具体业务SDK传入。
- ip: IP地址。 选填,当域名没有解析的时候,传入IP地址则是必须的,与hostname配合使用
- host: 最终curl的URI。选填,host最终会包装成 (hostname|ip):port 的形式, 所以如非必要可以不用这个属性。