Documentation
¶
Index ¶
Constants ¶
View Source
const ( // InputFormatURLListGet 输入格式为url列表,一行一个url InputFormatURLListGet string = "url_list_get" // InputFormatJSON 输入格式为json,一行一条json数据 InputFormatJSON string = "json" )
View Source
const Version string = "v1.0.2020040414"
Version 版本信息
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // 数据源 Input string // 数据输入格式 InputFormat string // 发送并发数,worker的数量 Conc uint // 待发送队列长度 RequestQueueSize uint32 // 调试模式 Trace bool // 超时时间 TimeoutMs uint // log前缀 LogFileName string Retry uint // 内容输出文件 OutFileName string }
Config 程序配置
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
func (*Input) ParserStreamLine ¶
func (*Input) RegistPaserFn ¶
func (i *Input) RegistPaserFn(name string, fn InputParserFn)
type InputFormatJSONRequest ¶
type InputFormatJSONRequest struct { ID string `json:"id"` Method string `json:"method"` URL string `json:"url"` Header map[string]string `json:"header"` Body string `json:"body"` }
func (*InputFormatJSONRequest) String ¶
func (jr *InputFormatJSONRequest) String() string
type Response ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker 一个worker(实际进行网络操作的worker)
func (*Worker) TalkWithHTTP ¶
TalkWithHTTP HTTP协议的交互
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool worker工作池
func NewWorkerPoolWithConfig ¶
func NewWorkerPoolWithConfig(config *Config, input *Input) *WorkerPool
NewWorkerPoolWithConfig 创建worker工作池对象
Click to show internal directories.
Click to hide internal directories.