MCPcopy
hub / github.com/danielmiessler/Fabric / Apply

Method Apply

internal/plugins/template/fetch.go:36–45  ·  view source on GitHub ↗

Apply executes fetch operations: - get:URL: Fetches content from URL, returns text content

(operation string, value string)

Source from the content-addressed store, hash-verified

34// Apply executes fetch operations:
35// - get:URL: Fetches content from URL, returns text content
36func (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
48func (p *FetchPlugin) isTextContent(contentType string) bool {

Callers 1

TestFetchPluginFunction · 0.95

Calls 3

fetchMethod · 0.95
TFunction · 0.92
debugfFunction · 0.85

Tested by 1

TestFetchPluginFunction · 0.76