Skip to content

Commit

Permalink
Add Exit call
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender committed Sep 24, 2024
1 parent c97692d commit 3118e82
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/rpc/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,29 @@ func (s *DaemonService) RunningServices() (*RunningServicesResponse, *http.Respo
return r, resp, nil
}

// ExitResponse shows information about the services that were stopped
type ExitResponse struct {
Response
ServicesStopped []ServiceFullName `json:"services_stopped"`
}

// Exit tells the daemon to exit
func (s *DaemonService) Exit() (*ExitResponse, *http.Response, error) {
request, err := s.NewRequest("exit", nil)
if err != nil {
return nil, nil, err
}

r := &ExitResponse{}

resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}

return r, resp, nil
}

// DaemonDeleteAllKeysOpts options for delete all keys request
type DaemonDeleteAllKeysOpts struct{}

Expand Down

0 comments on commit 3118e82

Please sign in to comment.