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) osserviceexit.Code
- func IsLookPathExist(serviceName 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 RestartMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- 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 StopMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func StopStartMultipleServices(isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, ...) (isSuccess bool)
- func VerifyExitCode(serviceName string, expectedExitCode osserviceexit.Code) *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 osservicerun.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) Enable() *Result
- 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) Restart() *Result
- func (it *Request) Run() *Result
- func (it *Request) SimplifiedErrorWrapper() *errorwrapper.Wrapper
- func (it *Request) Start() *Result
- func (it *Request) Status() *Result
- func (it *Request) Stop() *Result
- func (it *Request) StopSleepStart(sleep time.Duration) (stop, start *Result, isRunSuccess bool)
- func (it *Request) VerifyExitCode(exitCode osserviceexit.Code) *errorwrapper.Wrapper
- type Result
- 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) 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 osserviceexit.Code) *errorwrapper.Wrapper
- type Results
- func (it *Results) Add(action osservicerun.Action, serviceName string) osserviceexit.Code
- func (it *Results) AddServices(isContinueOnError bool, action osservicerun.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() osserviceexit.Code
- func (it *SimpleInstruction) OutputLines() *[]string
- func (it *SimpleInstruction) Run() *Result
- func (it *SimpleInstruction) Status() osserviceexit.Code
- 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) osserviceexit.Code
func IsLookPathExist ¶
func IsServiceExist ¶
func IsUnknownServiceExist ¶
func ReloadMultipleServices ¶
func ReloadMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func RestartMultipleServices ¶
func RestartMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func RunServices ¶
func RunServices( isDetailedError, isContinueOnErr bool, isIgnoreUnknownService bool, errCollection *errwrappers.Collection, action osservicerun.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 StopMultipleServices ¶
func StopMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, servicesNames ...string, ) (isSuccess bool)
func StopStartMultipleServices ¶
func StopStartMultipleServices( isDetailedError, isContinueOnErr bool, errCollection *errwrappers.Collection, sleep time.Duration, servicesNames ...string, ) (isSuccess bool)
func VerifyExitCode ¶
func VerifyExitCode( serviceName string, expectedExitCode osserviceexit.Code, ) *errorwrapper.Wrapper
Types ¶
type CoreServicesInstruction ¶
type CoreServicesInstruction struct { IsIgnoreUnknownService bool `json:"IsIgnoreUnknownService,omitempty"` Action osservicerun.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 osservicerun.Action, ) (isSuccess bool)
func (*ManyServicesInstructions) Status ¶
func (it *ManyServicesInstructions) Status( errCollection *errwrappers.Collection, ) (isSuccess bool)
type Request ¶
type Request struct { ServiceName string Action osservicerun.Action }
func (*Request) CompiledErrorWrapper ¶
func (it *Request) CompiledErrorWrapper() *errorwrapper.Wrapper
func (*Request) IsServiceExist ¶
func (*Request) IsUnknownService ¶
func (*Request) ReferenceValues ¶
func (*Request) SimplifiedErrorWrapper ¶
func (it *Request) SimplifiedErrorWrapper() *errorwrapper.Wrapper
func (*Request) StopSleepStart ¶
func (*Request) VerifyExitCode ¶
func (it *Request) VerifyExitCode(exitCode osserviceexit.Code) *errorwrapper.Wrapper
type Result ¶
type Result struct { Request Request CmdOnce *errcmd.CmdOnce ErrorWrapper *errorwrapper.Wrapper ExitCode osserviceexit.Code }
func GetStatusResult ¶
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) 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 osserviceexit.Code) *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 osservicerun.Action, servicesNames ...string, ) *Results
func (*Results) Add ¶
func (it *Results) Add(action osservicerun.Action, serviceName string) osserviceexit.Code
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 osservicerun.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() osserviceexit.Code
func (*SimpleInstruction) OutputLines ¶
func (it *SimpleInstruction) OutputLines() *[]string
func (*SimpleInstruction) Run ¶
func (it *SimpleInstruction) Run() *Result
func (*SimpleInstruction) Status ¶
func (it *SimpleInstruction) Status() osserviceexit.Code
type StateValidateInstruction ¶
type StateValidateInstruction struct { ServiceName string ExpectedExitCode osserviceexit.Code }
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
- IsLookPathExist.go
- IsRunning.go
- IsServiceExist.go
- IsUnknownServiceExist.go
- ManyServicesInstruction.go
- ManyServicesInstructions.go
- ReloadMultipleServices.go
- Request.go
- RestartMultipleServices.go
- Result.go
- Results.go
- Run.go
- RunServices.go
- RunServicesResults.go
- ServicesInstruction.go
- SimpleInstruction.go
- SimpleVerifyStatus.go
- StartMultipleServices.go
- StateValidateInstruction.go
- StateValidateInstructions.go
- StopMultipleServices.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.