QNPipeline.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 QNHttpResponseInfo;
  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. */
  28. typedef void (^QNPipelineCompletionHandler)(QNHttpResponseInfo *info);
  29. @interface QNPipeline : NSObject
  30. - (instancetype)init:(QNPipelineConfig *)config;
  31. - (void)pumpRepo:(NSString *)repo
  32. event:(NSDictionary *)data
  33. token:(NSString *)token
  34. handler:(QNPipelineCompletionHandler)handler;
  35. - (void)pumpRepo:(NSString *)repo
  36. events:(NSArray<NSDictionary *> *)data
  37. token:(NSString *)token
  38. handler:(QNPipelineCompletionHandler)handler;
  39. @end
  40. #endif /* QNPipeline_h */