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

Method executeUpload

workflow/executor.go:1060–1072  ·  view source on GitHub ↗

executeUpload uploads a file to the beacon's current working directory

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

Source from the content-addressed store, hash-verified

1058
1059// executeUpload uploads a file to the beacon's current working directory
1060func (e *Executor) executeUpload(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {
1061 localPath, ok := action.Parameters["local_path"].(string)
1062 if !ok {
1063 return "", fmt.Errorf("local_path parameter required for upload")
1064 }
1065
1066 resp, err := client.Upload(ctx, beaconID, localPath)
1067 if err != nil {
1068 return "", err
1069 }
1070
1071 return e.waitForOutput(ctx, client, resp.TaskID)
1072}
1073
1074// executeDownload downloads a file from the beacon
1075func (e *Executor) executeDownload(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) {

Callers 1

executeActionMethod · 0.95

Calls 1

waitForOutputMethod · 0.95

Tested by

no test coverage detected