Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeService

type FakeService struct {
	*FakeServiceData
	common.Service

	DataDir string
}

FakeService is a Service implementation for testing.

func NewFakeService

func NewFakeService(name string, conf common.Conf) *FakeService

NewFakeService returns a new FakeService.

func (*FakeService) Conf

func (ss *FakeService) Conf() common.Conf

Conf implements Service.

func (*FakeService) Exists

func (ss *FakeService) Exists() (bool, error)

Exists implements Service.

func (*FakeService) Install

func (ss *FakeService) Install() error

Install implements Service.

func (*FakeService) InstallCommands

func (ss *FakeService) InstallCommands() ([]string, error)

InstallCommands implements Service.

func (*FakeService) Installed

func (ss *FakeService) Installed() (bool, error)

Installed implements Service.

func (*FakeService) Name

func (ss *FakeService) Name() string

Name implements Service.

func (*FakeService) Remove

func (ss *FakeService) Remove() error

Remove implements Service.

func (*FakeService) RemoveOldService

func (ss *FakeService) RemoveOldService() error

RemoveOldService implements UpgradableService.

func (*FakeService) Running

func (ss *FakeService) Running() (bool, error)

Running implements Service.

func (*FakeService) Start

func (ss *FakeService) Start() error

Start implements Service.

func (*FakeService) StartCommands

func (ss *FakeService) StartCommands() ([]string, error)

StartCommands implements Service.

func (*FakeService) Stop

func (ss *FakeService) Stop() error

Stop implements Service.

func (*FakeService) WriteService

func (ss *FakeService) WriteService() error

WriteService implements UpgradableService.

type FakeServiceData

type FakeServiceData struct {
	testing.Stub
	// contains filtered or unexported fields
}

FakeServiceData holds the results of Service method calls.

func NewFakeServiceData

func NewFakeServiceData(names ...string) *FakeServiceData

NewFakeServiceData returns a new FakeServiceData.

func (*FakeServiceData) GetInstalled

func (f *FakeServiceData) GetInstalled(name string) ServiceInfo

GetInstalled returns the installed service that matches name. If name is not found, the method panics.

func (*FakeServiceData) Installed

func (f *FakeServiceData) Installed() []ServiceInfo

Installed returns a copy of the list of installed Services

func (*FakeServiceData) InstalledNames

func (f *FakeServiceData) InstalledNames() []string

InstalledNames returns a copy of the list of the installed names.

func (*FakeServiceData) Removed

func (f *FakeServiceData) Removed() []ServiceInfo

Removed returns a copy of the list of removed Services

func (*FakeServiceData) SetStatus

func (f *FakeServiceData) SetStatus(name, status string) error

SetStatus updates the status of the named service.

type ServiceInfo

type ServiceInfo interface {
	Name() string
	Conf() common.Conf
}

Source Files