QNPipeline.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // QNPipeline.h
  3. // QiniuSDK
  4. //
  5. // Created by BaiLong on 2017/7/25.
  6. // Copyright © 2017年 Qiniu. All rights reserved.
  7. //
  8. #ifndef QNPipeline_h
  9. #define QNPipeline_h
  10. @class QNResponseInfo;
  11. @interface QNPipelineConfig : NSObject
  12. /**
  13. * 上报打点域名
  14. */
  15. @property (copy, nonatomic, readonly) NSString *host;
  16. /**
  17. * 超时时间 单位 秒
  18. */
  19. @property (assign) UInt32 timeoutInterval;
  20. - (instancetype)initWithHost:(NSString *)host;
  21. - (instancetype)init;
  22. @end
  23. /**
  24. * 上传完成后的回调函数
  25. *
  26. * @param info 上下文信息,包括状态码,错误值
  27. * @param key 上传时指定的key,原样返回
  28. * @param resp 上传成功会返回文件信息,失败为nil; 可以通过此值是否为nil 判断上传结果
  29. */
  30. typedef void (^QNPipelineCompletionHandler)(QNResponseInfo *info);
  31. @interface QNPipeline : NSObject
  32. - (instancetype)init:(QNPipelineConfig *)config;
  33. - (void)pumpRepo:(NSString *)repo
  34. event:(NSDictionary *)data
  35. token:(NSString *)token
  36. handler:(QNPipelineCompletionHandler)handler;
  37. - (void)pumpRepo:(NSString *)repo
  38. events:(NSArray<NSDictionary *> *)data
  39. token:(NSString *)token
  40. handler:(QNPipelineCompletionHandler)handler;
  41. @end
  42. #endif /* QNPipeline_h */