Apply executes fetch operations: - get:URL: Fetches content from URL, returns text content
(operation string, value string)
| 34 | // Apply executes fetch operations: |
| 35 | // - get:URL: Fetches content from URL, returns text content |
| 36 | func (p *FetchPlugin) Apply(operation string, value string) (string, error) { |
| 37 | debugf("Fetch: operation=%q value=%q", operation, value) |
| 38 | |
| 39 | switch operation { |
| 40 | case "get": |
| 41 | return p.fetch(value) |
| 42 | default: |
| 43 | return "", fmt.Errorf(i18n.T("fetch_unknown_operation"), operation) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // isTextContent checks if the content type is text-based |
| 48 | func (p *FetchPlugin) isTextContent(contentType string) bool { |