Documentation ¶
Index ¶
Constants ¶
View Source
const (
SystemCtl = "systemctl"
)
Variables ¶
This section is empty.
Functions ¶
func EmptyThenDefault ¶
EmptyThenDefault return the default value if the val is empty
Types ¶
type CommonService ¶
type ContainerOption ¶
type ServerFeatureOption ¶
type Service ¶
type Service interface { Start() (string, error) // start the service Stop() (string, error) // stop the service gracefully Restart() (string, error) // restart the service gracefully Status() (string, error) // status of the service Install() (string, error) // install the service Uninstall() (string, error) // uninstall the service Available() bool }
Service is the interface of service
func GetAvailableService ¶
func GetAvailableService(mode ServiceMode, containerOption ContainerOption, service CommonService) (svc Service, err error)
func NewContainerService ¶
func NewContainerService(service CommonService, client string, containerOption ContainerOption) (svc Service)
func NewService ¶
func NewService(svc CommonService) (service Service, err error)
type ServiceMode ¶
type ServiceMode string
const ( ServiceModeOS ServiceMode = "os" ServiceModeContainer ServiceMode = "container" ServiceModePodman ServiceMode = "podman" ServiceModeDocker ServiceMode = "docker" )
func (ServiceMode) All ¶
func (s ServiceMode) All() []ServiceMode
func (ServiceMode) String ¶
func (s ServiceMode) String() string
Click to show internal directories.
Click to hide internal directories.