Parses the URL strings and enqueues them as *Cmd. It returns the number of URLs successfully enqueued, and an error if the URL string cannot be parsed or the Queue has been closed.
(method string, rawurl []string)
| 221 | // successfully enqueued, and an error if the URL string cannot be parsed or |
| 222 | // the Queue has been closed. |
| 223 | func (q *Queue) sendWithMethod(method string, rawurl []string) (int, error) { |
| 224 | for i, v := range rawurl { |
| 225 | parsed, err := url.Parse(v) |
| 226 | if err != nil { |
| 227 | return i, err |
| 228 | } |
| 229 | if err := q.Send(&Cmd{U: parsed, M: method}); err != nil { |
| 230 | return i, err |
| 231 | } |
| 232 | } |
| 233 | return len(rawurl), nil |
| 234 | } |
| 235 | |
| 236 | // Start starts the Fetcher, and returns the Queue to use to send Commands to be fetched. |
| 237 | func (f *Fetcher) Start() *Queue { |
no test coverage detected