Get gets a Crawler.
(crawlerID string, withConfig bool)
| 213 | |
| 214 | // Get gets a Crawler. |
| 215 | func (c *Client) Get(crawlerID string, withConfig bool) (*Crawler, error) { |
| 216 | var res Crawler |
| 217 | path := fmt.Sprintf("crawlers/%s", crawlerID) |
| 218 | params := map[string]string{ |
| 219 | "withConfig": fmt.Sprintf("%t", withConfig), |
| 220 | } |
| 221 | |
| 222 | err := c.request(&res, http.MethodGet, path, nil, params) |
| 223 | if err != nil { |
| 224 | return nil, err |
| 225 | } |
| 226 | |
| 227 | return &res, nil |
| 228 | } |
| 229 | |
| 230 | // Run runs a Crawler. |
| 231 | // It returns the Task ID if successful. |