MCPcopy Create free account
hub / github.com/PuerkitoBio/fetchbot / sendWithMethod

Method sendWithMethod

fetch.go:223–234  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

221// successfully enqueued, and an error if the URL string cannot be parsed or
222// the Queue has been closed.
223func (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.
237func (f *Fetcher) Start() *Queue {

Callers 3

SendStringMethod · 0.95
SendStringHeadMethod · 0.95
SendStringGetMethod · 0.95

Calls 1

SendMethod · 0.95

Tested by

no test coverage detected