MCPcopy Index your code
hub / github.com/jetify-com/devbox / StopServices

Function StopServices

internal/services/client.go:48–63  ·  view source on GitHub ↗
(ctx context.Context, serviceName, projectDir string, w io.Writer)

Source from the content-addressed store, hash-verified

46}
47
48func StopServices(ctx context.Context, serviceName, projectDir string, w io.Writer) error {
49 path := fmt.Sprintf("/process/stop/%s", serviceName)
50
51 body, status, err := clientRequest(path, http.MethodPatch, projectDir)
52 if err != nil {
53 return err
54 }
55
56 switch status {
57 case http.StatusOK:
58 fmt.Fprintf(w, "Service %s stopped.\n", serviceName)
59 return nil
60 default:
61 return fmt.Errorf("error stopping service %s: %s", serviceName, body)
62 }
63}
64
65func RestartServices(ctx context.Context, serviceName, projectDir string, w io.Writer) error {
66 path := fmt.Sprintf("/process/restart/%s", serviceName)

Callers 1

StopServicesMethod · 0.92

Calls 1

clientRequestFunction · 0.85

Tested by

no test coverage detected