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

Function StartServices

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

Source from the content-addressed store, hash-verified

29}
30
31func StartServices(ctx context.Context, w io.Writer, serviceName, projectDir string) error {
32 path := fmt.Sprintf("/process/start/%s", serviceName)
33
34 body, status, err := clientRequest(path, http.MethodPost, projectDir)
35 if err != nil {
36 return err
37 }
38
39 switch status {
40 case http.StatusOK:
41 fmt.Fprintf(w, "Service %s started.\n", serviceName)
42 return nil
43 default:
44 return fmt.Errorf("error starting service %s: %s", serviceName, body)
45 }
46}
47
48func StopServices(ctx context.Context, serviceName, projectDir string, w io.Writer) error {
49 path := fmt.Sprintf("/process/stop/%s", serviceName)

Callers 1

StartServicesMethod · 0.92

Calls 1

clientRequestFunction · 0.85

Tested by

no test coverage detected