Documentation
¶
Index ¶
- Constants
- func DisableMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func EnableMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func GetStatus(serviceName string) linuxservicestate.ExitCode
- func IsNamePathExist(name string) bool
- func IsRunning(serviceName string) bool
- func IsServiceExist(serviceName string) bool
- func IsUnknownServiceExist(serviceName string) bool
- func ReloadMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func ReloadQuick(servicesName string) *errorwrapper.Wrapper
- func RestartMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func RestartQuick(servicesName string) *errorwrapper.Wrapper
- func RunServices(isDetailedError, isContinueOnErr bool, isIgnoreUnknownService bool, ...) (isSuccess bool)
- func SimpleVerifyStatus(serviceName string) *errorwrapper.Wrapper
- func StartMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func StartQuick(servicesName string) *errorwrapper.Wrapper
- func StopMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func StopQuick(servicesName string) *errorwrapper.Wrapper
- func StopStartMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func VerifyExitCode(serviceName string, expectedExitCode linuxservicestate.ExitCode) *errorwrapper.Wrapper
- type CoreServicesInstruction
- type ManyServicesInstruction
- func (it *ManyServicesInstruction) Apply(errCollection *errwrappers.Collection) (isSuccess bool)
- func (it *ManyServicesInstruction) IsEmpty() bool
- func (it *ManyServicesInstruction) Results(errCollection *errwrappers.Collection) *Results
- func (it *ManyServicesInstruction) Status(errCollection *errwrappers.Collection) (isSuccess bool)
- type ManyServicesInstructions
- func (it *ManyServicesInstructions) Apply(errCollection *errwrappers.Collection) (isSuccess bool)
- func (it *ManyServicesInstructions) IsEmpty() bool
- func (it *ManyServicesInstructions) Run(errCollection *errwrappers.Collection, action servicestate.Action) (isSuccess bool)
- func (it *ManyServicesInstructions) Status(errCollection *errwrappers.Collection) (isSuccess bool)
- type Request
- func (it Request) CompiledErrorWrapper() *errorwrapper.Wrapper
- func (it Request) Disable() *Result
- func (it *Request) Dispose()
- func (it Request) Enable() *Result
- func (it Request) Exec(isDetailedError, isIgnoreUnknownService bool) (*Result, *errorwrapper.Wrapper)
- func (it Request) ExecDefault() (*Result, *errorwrapper.Wrapper)
- func (it Request) ExecDetailed() (*Result, *errorwrapper.Wrapper)
- func (it Request) ExecDetailedError() *errorwrapper.Wrapper
- func (it Request) ExecError(isDetailedError bool) *errorwrapper.Wrapper
- func (it Request) ExecSimple() (*Result, *errorwrapper.Wrapper)
- func (it Request) ExecSimpleError() *errorwrapper.Wrapper
- func (it Request) IsRunning() bool
- func (it Request) IsServiceExist() bool
- func (it Request) IsUnknownService() bool
- func (it Request) ReferenceValues() []ref.Value
- func (it Request) Reload() *Result
- func (it Request) ReloadError(isDetailed bool) *errorwrapper.Wrapper
- func (it Request) Restart() *Result
- func (it Request) RestartError(isDetailed bool) *errorwrapper.Wrapper
- func (it Request) Run() *Result
- func (it Request) SimplifiedErrorWrapper() *errorwrapper.Wrapper
- func (it Request) Start() *Result
- func (it Request) StartError(isDetailed bool) *errorwrapper.Wrapper
- func (it Request) Status() *Result
- func (it Request) Stop() *Result
- func (it Request) StopError(isDetailed bool) *errorwrapper.Wrapper
- func (it Request) StopSleepStart(sleep time.Duration) (stop, start *Result, isRunSuccess bool)
- func (it Request) VerifyExitCode(exitCode linuxservicestate.ExitCode) *errorwrapper.Wrapper
- type Result
- func GetStatusResult(serviceName string) *Result
- func Restart(isDetailedError, isIgnoreUnknownService bool, action servicestate.Action, ...) (*Result, *errorwrapper.Wrapper)
- func Run(action servicestate.Action, serviceName string) *Result
- func RunAction(isDetailedError, isIgnoreUnknownService bool, action servicestate.Action, ...) (*Result, *errorwrapper.Wrapper)
- func (it *Result) CollectError(errCollection *errwrappers.Collection, isSimpleError bool) bool
- func (it *Result) CollectSimpleError(errCollection *errwrappers.Collection) bool
- func (it *Result) CompiledErrorWrapper() *errorwrapper.Wrapper
- func (it *Result) Dispose()
- func (it *Result) DisposeWithoutErrorWrapper()
- func (it *Result) ErrorWrapperUsingOpt(isDetailedErr bool) *errorwrapper.Wrapper
- func (it *Result) IsEmpty() bool
- func (it *Result) IsFailed() bool
- func (it *Result) IsSuccess() bool
- func (it *Result) IsUnknownService() bool
- func (it *Result) ServiceName() string
- func (it *Result) SimplifiedError() *errorwrapper.Wrapper
- func (it *Result) VerifyExitCode(expectedExitCode linuxservicestate.ExitCode) *errorwrapper.Wrapper
- type Results
- func (it *Results) Add(action servicestate.Action, serviceName string) linuxservicestate.ExitCode
- func (it *Results) AddServices(isContinueOnError bool, action servicestate.Action, servicesNames ...string) *Results
- func (it *Results) HasAnyFailed() bool
- func (it *Results) HasAnyItem() bool
- func (it *Results) IsAllSuccess() bool
- func (it *Results) IsEmpty() bool
- func (it *Results) Length() int
- type ServicesInstruction
- func (it *ServicesInstruction) Apply(errCollection *errwrappers.Collection) (isSuccess bool)
- func (it *ServicesInstruction) HasDisableServicesNames() bool
- func (it *ServicesInstruction) HasEnableServicesNames() bool
- func (it *ServicesInstruction) HasRestartServicesNames() bool
- func (it *ServicesInstruction) HasServices() bool
- func (it *ServicesInstruction) HasStartServicesNames() bool
- func (it *ServicesInstruction) HasStatusServicesNames() bool
- func (it *ServicesInstruction) HasStopServicesNames() bool
- func (it *ServicesInstruction) HasValidations() bool
- type SimpleInstruction
- func (it *SimpleInstruction) Apply() *errorwrapper.Wrapper
- func (it *SimpleInstruction) ApplyOnErrorCollection(errCollection *errwrappers.Collection) (isSuccess bool)
- func (it *SimpleInstruction) CommandLine() string
- func (it *SimpleInstruction) CompiledError() *errorwrapper.Wrapper
- func (it *SimpleInstruction) DetailedOutput() string
- func (it *SimpleInstruction) LazyRun() *Result
- func (it *SimpleInstruction) LazyStatus() linuxservicestate.ExitCode
- func (it *SimpleInstruction) OutputLines() []string
- func (it *SimpleInstruction) Run() *Result
- func (it *SimpleInstruction) Status() linuxservicestate.ExitCode
- type StateValidateInstruction
- type StateValidateInstructions
Constants ¶
View Source
const (
SystemdSystemPath = "/etc/systemd/system/"
)
Variables ¶
This section is empty.
Functions ¶
func DisableMultipleServices ¶
func DisableMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames []string, ) (isSuccess bool)
func EnableMultipleServices ¶
func EnableMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func GetStatus ¶
func GetStatus(serviceName string) linuxservicestate.ExitCode
func IsNamePathExist ¶ added in v0.8.9
IsNamePathExist
Refers to environment, binary, or look path for the given name.
func IsServiceExist ¶
func IsUnknownServiceExist ¶
func ReloadMultipleServices ¶
func ReloadMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func ReloadQuick ¶ added in v0.8.9
func ReloadQuick( servicesName string, ) *errorwrapper.Wrapper
func RestartMultipleServices ¶
func RestartMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func RestartQuick ¶ added in v0.8.9
func RestartQuick( servicesName string, ) *errorwrapper.Wrapper
func RunServices ¶
func RunServices( isDetailedError, isContinueOnErr bool, isIgnoreUnknownService bool, errCollection *errwrappers.Collection, action servicestate.Action, servicesNames ...string, ) (isSuccess bool)
func SimpleVerifyStatus ¶
func SimpleVerifyStatus(serviceName string) *errorwrapper.Wrapper
func StartMultipleServices ¶
func StartMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func StartQuick ¶ added in v0.8.9
func StartQuick( servicesName string, ) *errorwrapper.Wrapper
func StopMultipleServices ¶
func StopMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func StopQuick ¶ added in v0.8.9
func StopQuick( servicesName string, ) *errorwrapper.Wrapper
func StopStartMultipleServices ¶
func StopStartMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, sleep time.Duration, servicesNames ...string, ) (isSuccess bool)
func VerifyExitCode ¶
func VerifyExitCode( serviceName string, expectedExitCode linuxservicestate.ExitCode, ) *errorwrapper.Wrapper
Types ¶
type CoreServicesInstruction ¶
type CoreServicesInstruction struct { IsIgnoreUnknownService bool `json:"IsIgnoreUnknownService,omitempty"` Action servicestate.Action `json:"Action"` ServicesNames []string `json:"ServicesNames,omitempty"` }
type ManyServicesInstruction ¶
type ManyServicesInstruction struct { IsDetailedError bool `json:"IsDetailedError,omitempty"` IsContinueOnError bool `json:"IsContinueOnError,omitempty"` CoreServicesInstruction }
func (*ManyServicesInstruction) Apply ¶
func (it *ManyServicesInstruction) Apply(errCollection *errwrappers.Collection) (isSuccess bool)
func (*ManyServicesInstruction) IsEmpty ¶
func (it *ManyServicesInstruction) IsEmpty() bool
func (*ManyServicesInstruction) Results ¶
func (it *ManyServicesInstruction) Results(errCollection *errwrappers.Collection) *Results
func (*ManyServicesInstruction) Status ¶
func (it *ManyServicesInstruction) Status(errCollection *errwrappers.Collection) (isSuccess bool)
type ManyServicesInstructions ¶
type ManyServicesInstructions struct { IsDetailedError bool `json:"IsDetailedError,omitempty"` IsContinueOnError bool `json:"IsContinueOnError,omitempty"` Instructions []CoreServicesInstruction `json:"Instructions,omitempty"` }
func (*ManyServicesInstructions) Apply ¶
func (it *ManyServicesInstructions) Apply( errCollection *errwrappers.Collection, ) (isSuccess bool)
func (*ManyServicesInstructions) IsEmpty ¶
func (it *ManyServicesInstructions) IsEmpty() bool
func (*ManyServicesInstructions) Run ¶
func (it *ManyServicesInstructions) Run( errCollection *errwrappers.Collection, action servicestate.Action, ) (isSuccess bool)
func (*ManyServicesInstructions) Status ¶
func (it *ManyServicesInstructions) Status( errCollection *errwrappers.Collection, ) (isSuccess bool)
type Request ¶
type Request struct { ServiceName string Action servicestate.Action }
func (Request) CompiledErrorWrapper ¶
func (it Request) CompiledErrorWrapper() *errorwrapper.Wrapper
func (Request) Exec ¶ added in v0.8.9
func (it Request) Exec( isDetailedError, isIgnoreUnknownService bool, ) (*Result, *errorwrapper.Wrapper)
func (Request) ExecDefault ¶ added in v0.8.9
func (it Request) ExecDefault() (*Result, *errorwrapper.Wrapper)
ExecDefault
Returns error for detailed action, use ExecSimple or Exec for simple error
func (Request) ExecDetailed ¶ added in v0.8.9
func (it Request) ExecDetailed() (*Result, *errorwrapper.Wrapper)
func (Request) ExecDetailedError ¶ added in v0.8.9
func (it Request) ExecDetailedError() *errorwrapper.Wrapper
func (Request) ExecError ¶ added in v0.8.9
func (it Request) ExecError(isDetailedError bool) *errorwrapper.Wrapper
func (Request) ExecSimple ¶ added in v0.8.9
func (it Request) ExecSimple() (*Result, *errorwrapper.Wrapper)
func (Request) ExecSimpleError ¶ added in v0.8.9
func (it Request) ExecSimpleError() *errorwrapper.Wrapper
func (Request) IsServiceExist ¶
func (Request) IsUnknownService ¶
func (Request) ReferenceValues ¶
func (Request) ReloadError ¶ added in v0.8.9
func (it Request) ReloadError(isDetailed bool) *errorwrapper.Wrapper
func (Request) RestartError ¶ added in v0.8.9
func (it Request) RestartError(isDetailed bool) *errorwrapper.Wrapper
func (Request) SimplifiedErrorWrapper ¶
func (it Request) SimplifiedErrorWrapper() *errorwrapper.Wrapper
func (Request) StartError ¶ added in v0.8.9
func (it Request) StartError(isDetailed bool) *errorwrapper.Wrapper
func (Request) StopError ¶ added in v0.8.9
func (it Request) StopError(isDetailed bool) *errorwrapper.Wrapper
func (Request) StopSleepStart ¶
func (Request) VerifyExitCode ¶
func (it Request) VerifyExitCode(exitCode linuxservicestate.ExitCode) *errorwrapper.Wrapper
type Result ¶
type Result struct { Request Request CmdOnce *errcmd.CmdOnce ErrorWrapper *errorwrapper.Wrapper ExitCode linuxservicestate.ExitCode }
func GetStatusResult ¶
func Restart ¶ added in v0.8.9
func Restart( isDetailedError, isIgnoreUnknownService bool, action servicestate.Action, servicesName string, ) (*Result, *errorwrapper.Wrapper)
func RunAction ¶ added in v0.8.9
func RunAction( isDetailedError, isIgnoreUnknownService bool, action servicestate.Action, servicesName string, ) (*Result, *errorwrapper.Wrapper)
func (*Result) CollectError ¶
func (it *Result) CollectError( errCollection *errwrappers.Collection, isSimpleError bool, ) bool
func (*Result) CollectSimpleError ¶
func (it *Result) CollectSimpleError( errCollection *errwrappers.Collection, ) bool
func (*Result) CompiledErrorWrapper ¶
func (it *Result) CompiledErrorWrapper() *errorwrapper.Wrapper
func (*Result) DisposeWithoutErrorWrapper ¶ added in v0.8.9
func (it *Result) DisposeWithoutErrorWrapper()
func (*Result) ErrorWrapperUsingOpt ¶
func (it *Result) ErrorWrapperUsingOpt(isDetailedErr bool) *errorwrapper.Wrapper
func (*Result) IsUnknownService ¶
func (*Result) ServiceName ¶
func (*Result) SimplifiedError ¶
func (it *Result) SimplifiedError() *errorwrapper.Wrapper
func (*Result) VerifyExitCode ¶
func (it *Result) VerifyExitCode(expectedExitCode linuxservicestate.ExitCode) *errorwrapper.Wrapper
type Results ¶
type Results struct {
Items []*Result
}
func EmptyResults ¶
func EmptyResults() *Results
func NewResults ¶
func RunServicesResults ¶
func RunServicesResults( isDetailedError, isContinueOnErr bool, isIgnoreUnknownService bool, errCollection *errwrappers.Collection, action servicestate.Action, servicesNames ...string, ) *Results
func (*Results) Add ¶
func (it *Results) Add(action servicestate.Action, serviceName string) linuxservicestate.ExitCode
func (*Results) AddServices ¶
func (*Results) HasAnyFailed ¶
func (*Results) HasAnyItem ¶
func (*Results) IsAllSuccess ¶
type ServicesInstruction ¶
type ServicesInstruction struct { IsDetailedError bool `json:"IsDetailedError,omitempty"` IsContinueOnError bool `json:"IsContinueOnError,omitempty"` StopServicesNames []string `json:"StopServicesNames,omitempty"` StartServicesNames []string `json:"StartServicesNames,omitempty"` RestartServicesNames []string `json:"RestartServicesNames,omitempty"` DisableServicesNames []string `json:"DisableServicesNames,omitempty"` EnableServicesNames []string `json:"EnableServicesNames,omitempty"` StatusServicesNames []string `json:"StatusServicesNames,omitempty"` Services ManyServicesInstructions `json:"Instructions,omitempty"` Validations *StateValidateInstructions `json:"Validations,omitempty"` }
func (*ServicesInstruction) Apply ¶
func (it *ServicesInstruction) Apply(errCollection *errwrappers.Collection) (isSuccess bool)
func (*ServicesInstruction) HasDisableServicesNames ¶
func (it *ServicesInstruction) HasDisableServicesNames() bool
func (*ServicesInstruction) HasEnableServicesNames ¶
func (it *ServicesInstruction) HasEnableServicesNames() bool
func (*ServicesInstruction) HasRestartServicesNames ¶
func (it *ServicesInstruction) HasRestartServicesNames() bool
func (*ServicesInstruction) HasServices ¶
func (it *ServicesInstruction) HasServices() bool
func (*ServicesInstruction) HasStartServicesNames ¶
func (it *ServicesInstruction) HasStartServicesNames() bool
func (*ServicesInstruction) HasStatusServicesNames ¶
func (it *ServicesInstruction) HasStatusServicesNames() bool
func (*ServicesInstruction) HasStopServicesNames ¶
func (it *ServicesInstruction) HasStopServicesNames() bool
func (*ServicesInstruction) HasValidations ¶
func (it *ServicesInstruction) HasValidations() bool
type SimpleInstruction ¶
type SimpleInstruction struct { ServiceName string Action servicestate.Action IsDetailedError bool // contains filtered or unexported fields }
func (*SimpleInstruction) Apply ¶
func (it *SimpleInstruction) Apply() *errorwrapper.Wrapper
func (*SimpleInstruction) ApplyOnErrorCollection ¶
func (it *SimpleInstruction) ApplyOnErrorCollection( errCollection *errwrappers.Collection, ) (isSuccess bool)
func (*SimpleInstruction) CommandLine ¶
func (it *SimpleInstruction) CommandLine() string
func (*SimpleInstruction) CompiledError ¶
func (it *SimpleInstruction) CompiledError() *errorwrapper.Wrapper
func (*SimpleInstruction) DetailedOutput ¶
func (it *SimpleInstruction) DetailedOutput() string
func (*SimpleInstruction) LazyRun ¶
func (it *SimpleInstruction) LazyRun() *Result
func (*SimpleInstruction) LazyStatus ¶
func (it *SimpleInstruction) LazyStatus() linuxservicestate.ExitCode
func (*SimpleInstruction) OutputLines ¶
func (it *SimpleInstruction) OutputLines() []string
func (*SimpleInstruction) Run ¶
func (it *SimpleInstruction) Run() *Result
func (*SimpleInstruction) Status ¶
func (it *SimpleInstruction) Status() linuxservicestate.ExitCode
type StateValidateInstruction ¶
type StateValidateInstruction struct { ServiceName string ExpectedExitCode linuxservicestate.ExitCode }
func (*StateValidateInstruction) Apply ¶
func (it *StateValidateInstruction) Apply() *errorwrapper.Wrapper
func (*StateValidateInstruction) ApplyUsingErrCollection ¶
func (it *StateValidateInstruction) ApplyUsingErrCollection( errCollection *errwrappers.Collection, ) (isSuccess bool)
func (*StateValidateInstruction) IsEmpty ¶
func (it *StateValidateInstruction) IsEmpty() bool
type StateValidateInstructions ¶
type StateValidateInstructions struct { IsContinueOnError bool Validations []StateValidateInstruction `json:"Validations,omitempty"` }
func (*StateValidateInstructions) ApplyUsingErrCollection ¶
func (it *StateValidateInstructions) ApplyUsingErrCollection( errCollection *errwrappers.Collection, ) (isSuccess bool)
func (*StateValidateInstructions) HasValidations ¶
func (it *StateValidateInstructions) HasValidations() bool
func (*StateValidateInstructions) IsEmpty ¶
func (it *StateValidateInstructions) IsEmpty() bool
Source Files
¶
- CoreServicesInstruction.go
- DisableMultipleServices.go
- EnableMultipleServices.go
- GetStatus.go
- GetStatusResult.go
- IsNamePathExist.go
- IsRunning.go
- IsServiceExist.go
- IsUnknownServiceExist.go
- ManyServicesInstruction.go
- ManyServicesInstructions.go
- ReloadMultipleServices.go
- ReloadQuick.go
- Request.go
- Restart.go
- RestartMultipleServices.go
- RestartQuick.go
- Result.go
- Results.go
- Run.go
- RunAction.go
- RunServices.go
- RunServicesResults.go
- ServicesInstruction.go
- SimpleInstruction.go
- SimpleVerifyStatus.go
- StartMultipleServices.go
- StartQuick.go
- StateValidateInstruction.go
- StateValidateInstructions.go
- StopMultipleServices.go
- StopQuick.go
- StopStartMultipleServices.go
- VerifyExitCode.go
- consts.go
- exitCodeToMappedError.go
- getCmdOnce.go
- hasServiceCmdLookPath.go
- hasSystemctlCmdLookPath.go
- vars.go
Click to show internal directories.
Click to hide internal directories.