MCPcopy Create free account
hub / github.com/Xenov-X/csbot / executeDownloadPayload

Method executeDownloadPayload

workflow/executor_server.go:204–217  ·  view source on GitHub ↗

executeDownloadPayload downloads a previously generated payload

(ctx context.Context, client *csclient.Client, action Action)

Source from the content-addressed store, hash-verified

202
203// executeDownloadPayload downloads a previously generated payload
204func (e *Executor) executeDownloadPayload(ctx context.Context, client *csclient.Client, action Action) (string, error) {
205 fileName, ok := action.Parameters["file_name"].(string)
206 if !ok {
207 return "", fmt.Errorf("file_name parameter required for download_payload")
208 }
209
210 e.logInfo("Downloading payload: %s", fileName)
211 _, err := client.DownloadPayload(ctx, fileName)
212 if err != nil {
213 return "", fmt.Errorf("download payload failed: %w", err)
214 }
215 // Note: actual binary data handling would need a file write destination
216 return fmt.Sprintf("payload '%s' downloaded", fileName), nil
217}
218
219// --- Server Config Operations ---
220

Callers 1

executeActionMethod · 0.95

Calls 1

logInfoMethod · 0.95

Tested by

no test coverage detected