MCPcopy
hub / github.com/v2ray/v2ray-core / Execute

Method Execute

infra/control/fetch.go:27–38  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

25}
26
27func (c *FetchCommand) Execute(args []string) error {
28 if len(args) < 1 {
29 return newError("empty url")
30 }
31 content, err := FetchHTTPContent(args[0])
32 if err != nil {
33 return newError("failed to read HTTP response").Base(err)
34 }
35
36 os.Stdout.Write(content)
37 return nil
38}
39
40// FetchHTTPContent dials https for remote content
41func FetchHTTPContent(target string) ([]byte, error) {

Callers

nothing calls this directly

Calls 4

BaseMethod · 0.80
newErrorFunction · 0.70
FetchHTTPContentFunction · 0.70
WriteMethod · 0.65

Tested by

no test coverage detected