juju: github.com/juju/juju/service/windows Index | Files

package windows

import "github.com/juju/juju/service/windows"

Index

Package Files

service.go service_nix.go

Variables

var NewServiceManager = func() (ServiceManager, error) {
    return &SvcManager{}, nil
}

func IsRunning Uses

func IsRunning() (bool, error)

IsRunning returns whether or not windows is the local init system.

func ListCommand Uses

func ListCommand() string

ListCommand returns a command that will list the services on a host.

func ListServices Uses

func ListServices() ([]string, error)

ListServices returns the name of all installed services on the local host.

type Service Uses

type Service struct {
    common.Service
    // contains filtered or unexported fields
}

Service represents a service running on the current system

func NewService Uses

func NewService(name string, conf common.Conf) (*Service, error)

NewService returns a new Service type

func (*Service) Conf Uses

func (s *Service) Conf() common.Conf

Conf implements service.Service.

func (*Service) Exists Uses

func (s *Service) Exists() (bool, error)

Exists returns whether the service configuration reflects the desired state

func (*Service) Install Uses

func (s *Service) Install() error

Install installs and starts the service.

func (*Service) InstallCommands Uses

func (s *Service) InstallCommands() ([]string, error)

InstallCommands returns shell commands to install the service.

func (*Service) Installed Uses

func (s *Service) Installed() (bool, error)

Installed returns whether the service is installed

func (*Service) Name Uses

func (s *Service) Name() string

Name implements service.Service.

func (*Service) Remove Uses

func (s *Service) Remove() error

Remove deletes the service.

func (*Service) Running Uses

func (s *Service) Running() (bool, error)

func (*Service) Start Uses

func (s *Service) Start() error

Start starts the service.

func (*Service) StartCommands Uses

func (s *Service) StartCommands() ([]string, error)

StartCommands returns shell commands to start the service.

func (*Service) Stop Uses

func (s *Service) Stop() error

Stop stops the service.

func (*Service) Validate Uses

func (s *Service) Validate() error

Validate checks the service for invalid values.

type ServiceManager Uses

type ServiceManager interface {
    // Start starts a service.
    Start(name string) error
    // Stop stops a service.
    Stop(name string) error
    // Delete deletes a service.
    Delete(name string) error
    // Create creates a service with the given config.
    Create(name string, conf common.Conf) error
    // Running returns the status of a service.
    Running(name string) (bool, error)
    // Exists checks whether the config of the installed service matches the
    // config supplied to this function
    Exists(name string, conf common.Conf) (bool, error)
    // ChangeServicePassword can change the password of a service
    // as long as it belongs to the user defined in this package
    ChangeServicePassword(name, newPassword string) error
}

ServiceManager exposes methods needed to manage a windows service

type SvcManager Uses

type SvcManager struct{}

SvcManager implements ServiceManager interface

func (*SvcManager) ChangeServicePassword Uses

func (s *SvcManager) ChangeServicePassword(name, newPassword string) error

ChangeServicePassword can change the password of a service as long as it belongs to the user defined in this package

func (*SvcManager) Create Uses

func (s *SvcManager) Create(name string, conf common.Conf) error

Create creates a service with the given config.

func (*SvcManager) Delete Uses

func (s *SvcManager) Delete(name string) error

Delete deletes a service.

func (*SvcManager) Exists Uses

func (s *SvcManager) Exists(name string, conf common.Conf) (bool, error)

Exists checks whether the config of the installed service matches the config supplied to this function

func (*SvcManager) Running Uses

func (s *SvcManager) Running(name string) (bool, error)

Running returns the status of a service.

func (*SvcManager) Start Uses

func (s *SvcManager) Start(name string) error

Start starts a service.

func (*SvcManager) Stop Uses

func (s *SvcManager) Stop(name string) error

Stop stops a service.

Package windows imports 8 packages (graph) and is imported by 39 packages. Updated 2018-07-09. Refresh now. Tools for package owners.