MCPcopy Create free account
hub / github.com/algolia/cli / List

Method List

api/crawler/client.go:168–189  ·  view source on GitHub ↗

List lists Crawlers.

(itemsPerPage, page int, name, appID string)

Source from the content-addressed store, hash-verified

166
167// List lists Crawlers.
168func (c *Client) List(itemsPerPage, page int, name, appID string) (*CrawlersResponse, error) {
169 var res CrawlersResponse
170 path := "crawlers"
171 params := map[string]string{
172 "itemsPerPage": fmt.Sprintf("%d", itemsPerPage),
173 "page": fmt.Sprintf("%d", page),
174 }
175
176 if name != "" {
177 params["name"] = name
178 }
179 if appID != "" {
180 params["appId"] = appID
181 }
182
183 err := c.request(&res, http.MethodGet, path, nil, params)
184 if err != nil {
185 return nil, err
186 }
187
188 return &res, nil
189}
190
191// ListAll lists all Crawlers
192func (c *Client) ListAll(name, appID string) ([]*CrawlerListItem, error) {

Callers 1

ListAllMethod · 0.95

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected