Skip to content

Commit

Permalink
service: rename Service.Remove to Service.Uninstall.
Browse files Browse the repository at this point in the history
  • Loading branch information
kardianos committed Jan 18, 2015
1 parent 46a24fd commit 0de2108
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ type Service interface {
// greater rights. Will return an error if it is already installed.
Install() error

// Remove removes the given service from the OS service manager. This may require
// Uninstall removes the given service from the OS service manager. This may require
// greater rights. Will return an error if the service is not present.
Remove() error
Uninstall() error

// Opens and returns a system logger. If the user program is running
// interactively rather then as a service, the returned logger will write to
Expand All @@ -270,7 +270,7 @@ type Service interface {
}

// ControlAction list valid string texts to use in Control.
var ControlAction = [5]string{"start", "stop", "restart", "install", "remove"}
var ControlAction = [5]string{"start", "stop", "restart", "install", "uninstall"}

// Control issues control functions to the service from a given action string.
func Control(s Service, action string) error {
Expand All @@ -285,7 +285,7 @@ func Control(s Service, action string) error {
case ControlAction[3]:
err = s.Install()
case ControlAction[4]:
err = s.Remove()
err = s.Uninstall()
default:
err = fmt.Errorf("Unknown action %s", action)
}
Expand Down
2 changes: 1 addition & 1 deletion service_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (s *darwinLaunchdService) Install() error {
return t.Execute(f, to)
}

func (s *darwinLaunchdService) Remove() error {
func (s *darwinLaunchdService) Uninstall() error {
s.Stop()

confPath, err := s.getServiceFilePath()
Expand Down
2 changes: 1 addition & 1 deletion service_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (s *linuxService) Install() error {
return nil
}

func (s *linuxService) Remove() error {
func (s *linuxService) Uninstall() error {
if flavor == initSystemd {
exec.Command("systemctl", "disable", s.Name+".service").Run()
}
Expand Down
2 changes: 1 addition & 1 deletion service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (ws *windowsService) Install() error {
return nil
}

func (ws *windowsService) Remove() error {
func (ws *windowsService) Uninstall() error {
m, err := mgr.Connect()
if err != nil {
return err
Expand Down

0 comments on commit 0de2108

Please sign in to comment.