command

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceInit    = "init"
	ServiceSystemd = "systemd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AmazonCommand

type AmazonCommand struct {
	RedhatCommand
}

func (*AmazonCommand) String

func (c *AmazonCommand) String() string

type BaseCommand

type BaseCommand struct {
	// contains filtered or unexported fields
}

func (*BaseCommand) AddGroup

func (c *BaseCommand) AddGroup(group string, options map[string]string) string

func (*BaseCommand) AddUser

func (c *BaseCommand) AddUser(user string, options map[string]string) string

func (*BaseCommand) ChangeFileGroup

func (c *BaseCommand) ChangeFileGroup(file string, group string, recursive bool) string

func (*BaseCommand) ChangeFileMode

func (c *BaseCommand) ChangeFileMode(file string, mode string, recursive bool) string

func (*BaseCommand) ChangeFileOwner

func (c *BaseCommand) ChangeFileOwner(file string, owner string, group string, recursive bool) string

func (*BaseCommand) CheckFileIsBlockDevice

func (c *BaseCommand) CheckFileIsBlockDevice(file string) string

func (*BaseCommand) CheckFileIsCharacterDevice

func (c *BaseCommand) CheckFileIsCharacterDevice(file string) string

func (*BaseCommand) CheckFileIsDirectory

func (c *BaseCommand) CheckFileIsDirectory(file string) string

func (*BaseCommand) CheckFileIsFile

func (c *BaseCommand) CheckFileIsFile(file string) string
func (c *BaseCommand) CheckFileIsLink(link string) string

func (*BaseCommand) CheckFileIsLinkedTo

func (c *BaseCommand) CheckFileIsLinkedTo(link, target string) string

func (*BaseCommand) CheckFileIsPipe

func (c *BaseCommand) CheckFileIsPipe(file string) string

func (*BaseCommand) CheckFileIsSocket

func (c *BaseCommand) CheckFileIsSocket(file string) string
func (c *BaseCommand) CheckFileIsSymlink(file string) string

func (*BaseCommand) CheckGroupExists

func (c *BaseCommand) CheckGroupExists(group string) string

func (*BaseCommand) CheckGroupHasGid

func (c *BaseCommand) CheckGroupHasGid(group string, gid string) string

func (*BaseCommand) CheckPackageIsInstalled

func (c *BaseCommand) CheckPackageIsInstalled(packagename string, version string) string

func (*BaseCommand) CheckServiceIsEnabledUnderProvider

func (c *BaseCommand) CheckServiceIsEnabledUnderProvider(provider string, name string) string

func (*BaseCommand) CheckServiceIsRunningUnderProvider

func (c *BaseCommand) CheckServiceIsRunningUnderProvider(provider string, name string) string

func (*BaseCommand) CheckUserBelongsToGroup

func (c *BaseCommand) CheckUserBelongsToGroup(user, group string) string

func (*BaseCommand) CheckUserBelongsToPrimaryGroup

func (c *BaseCommand) CheckUserBelongsToPrimaryGroup(user, group string) string

func (*BaseCommand) CheckUserExists

func (c *BaseCommand) CheckUserExists(user string) string

func (*BaseCommand) CheckUserHasAuthorizedKey

func (c *BaseCommand) CheckUserHasAuthorizedKey(user, key string) string

func (*BaseCommand) CheckUserHasHomeDirectory

func (c *BaseCommand) CheckUserHasHomeDirectory(user, pathToHome string) string

func (*BaseCommand) CheckUserHasLoginShell

func (c *BaseCommand) CheckUserHasLoginShell(user, pathToShell string) string

func (*BaseCommand) CheckUserHasUid

func (c *BaseCommand) CheckUserHasUid(user, uid string) string

func (*BaseCommand) CreateFileAsDirectory

func (c *BaseCommand) CreateFileAsDirectory(file string) string

func (*BaseCommand) DefaultServiceProvider

func (c *BaseCommand) DefaultServiceProvider() string

func (*BaseCommand) DisableServiceUnderProvider

func (c *BaseCommand) DisableServiceUnderProvider(provider string, name string) string

func (*BaseCommand) EnableServiceUnderProvider

func (c *BaseCommand) EnableServiceUnderProvider(provider string, name string) string

func (*BaseCommand) GetFileLinkTarget

func (c *BaseCommand) GetFileLinkTarget(link string) string

func (*BaseCommand) GetFileMode

func (c *BaseCommand) GetFileMode(file string) string

func (*BaseCommand) GetFileOwnerGroup

func (c *BaseCommand) GetFileOwnerGroup(file string) string

func (*BaseCommand) GetFileOwnerUser

func (c *BaseCommand) GetFileOwnerUser(file string) string

func (*BaseCommand) GetGroupGid

func (c *BaseCommand) GetGroupGid(group string) string

func (*BaseCommand) GetPackageVersion

func (c *BaseCommand) GetPackageVersion(packagename string, option string) string

func (*BaseCommand) GetUserEncryptedPassword

func (c *BaseCommand) GetUserEncryptedPassword(user string) string

func (*BaseCommand) GetUserGid

func (c *BaseCommand) GetUserGid(user string) string

func (*BaseCommand) GetUserHomeDirectory

func (c *BaseCommand) GetUserHomeDirectory(user string) string

func (*BaseCommand) GetUserLoginShell

func (c *BaseCommand) GetUserLoginShell(user string) string

func (*BaseCommand) GetUserUid

func (c *BaseCommand) GetUserUid(user string) string

func (*BaseCommand) InstallPackage

func (c *BaseCommand) InstallPackage(packagename string, version string, option string) string

func (*BaseCommand) LinkFileTo

func (c *BaseCommand) LinkFileTo(link string, target string, force bool) string

func (*BaseCommand) MoveFile

func (c *BaseCommand) MoveFile(src, dest string) string

func (*BaseCommand) OSFamily

func (c *BaseCommand) OSFamily() string

func (*BaseCommand) OSInfo added in v0.3.0

func (c *BaseCommand) OSInfo() string

func (*BaseCommand) OSRelease

func (c *BaseCommand) OSRelease() string

func (*BaseCommand) ReloadServiceUnderProvider

func (c *BaseCommand) ReloadServiceUnderProvider(provider string, name string) string

func (*BaseCommand) RemoveFile

func (c *BaseCommand) RemoveFile(file string) string

func (*BaseCommand) RemovePackage

func (c *BaseCommand) RemovePackage(packagename string, option string) string

func (*BaseCommand) RestartServiceUnderProvider

func (c *BaseCommand) RestartServiceUnderProvider(provider string, name string) string

func (*BaseCommand) SetOSFamily

func (c *BaseCommand) SetOSFamily(v string)

func (*BaseCommand) SetOSRelease

func (c *BaseCommand) SetOSRelease(v string)

func (*BaseCommand) StartServiceUnderProvider

func (c *BaseCommand) StartServiceUnderProvider(provider string, name string) string

func (*BaseCommand) StopServiceUnderProvider

func (c *BaseCommand) StopServiceUnderProvider(provider string, name string) string

func (*BaseCommand) String

func (c *BaseCommand) String() string

func (*BaseCommand) UpdateGroupGid

func (c *BaseCommand) UpdateGroupGid(group string, gid string) string

func (*BaseCommand) UpdateUserEncryptedPassword

func (c *BaseCommand) UpdateUserEncryptedPassword(user, encryptedPassword string) string

func (*BaseCommand) UpdateUserGid

func (c *BaseCommand) UpdateUserGid(user, gid string) string

func (*BaseCommand) UpdateUserHomeDirectory

func (c *BaseCommand) UpdateUserHomeDirectory(user, dir string) string

func (*BaseCommand) UpdateUserLoginShell

func (c *BaseCommand) UpdateUserLoginShell(user, shell string) string

func (*BaseCommand) UpdateUserUid

func (c *BaseCommand) UpdateUserUid(user, uid string) string

type CommandFactory

type CommandFactory interface {
	// misc
	String() string
	SetOSFamily(string)
	SetOSRelease(string)
	OSFamily() string
	OSRelease() string
	OSInfo() string
	DefaultServiceProvider() string

	// file
	CheckFileIsFile(file string) string
	CheckFileIsDirectory(file string) string
	CheckFileIsPipe(file string) string
	CheckFileIsSocket(file string) string
	CheckFileIsBlockDevice(file string) string
	CheckFileIsCharacterDevice(file string) string
	CheckFileIsSymlink(file string) string
	GetFileMode(file string) string
	GetFileOwnerUser(file string) string
	GetFileOwnerGroup(file string) string
	CheckFileIsLinkedTo(link, target string) string
	CheckFileIsLink(link string) string
	GetFileLinkTarget(link string) string
	ChangeFileMode(file string, mode string, recursive bool) string
	ChangeFileOwner(file string, owner string, group string, recursive bool) string
	ChangeFileGroup(file string, group string, recursive bool) string
	CreateFileAsDirectory(file string) string
	LinkFileTo(link string, target string, force bool) string
	RemoveFile(file string) string
	MoveFile(src, dest string) string

	// group
	CheckGroupExists(group string) string
	CheckGroupHasGid(group string, gid string) string
	GetGroupGid(group string) string
	UpdateGroupGid(group string, gid string) string
	AddGroup(group string, options map[string]string) string

	// user
	CheckUserExists(user string) string
	CheckUserBelongsToGroup(user, group string) string
	CheckUserBelongsToPrimaryGroup(user, group string) string
	CheckUserHasUid(user, uid string) string
	CheckUserHasHomeDirectory(user, pathToHome string) string
	CheckUserHasLoginShell(user, pathToShell string) string
	CheckUserHasAuthorizedKey(user, key string) string

	GetUserUid(user string) string
	GetUserGid(user string) string
	GetUserHomeDirectory(user string) string
	GetUserLoginShell(user string) string
	UpdateUserHomeDirectory(user, dir string) string
	UpdateUserLoginShell(user, shell string) string
	UpdateUserUid(user, uid string) string
	UpdateUserGid(user, gid string) string
	AddUser(user string, options map[string]string) string
	UpdateUserEncryptedPassword(user, encryptedPassword string) string
	GetUserEncryptedPassword(user string) string

	// package
	CheckPackageIsInstalled(packagename string, version string) string
	GetPackageVersion(packagename string, option string) string
	InstallPackage(packagename string, version string, option string) string
	RemovePackage(packagename string, option string) string

	// service with provider
	CheckServiceIsRunningUnderProvider(provider string, name string) string
	CheckServiceIsEnabledUnderProvider(provider string, name string) string
	StartServiceUnderProvider(provider string, name string) string
	StopServiceUnderProvider(provider string, name string) string
	RestartServiceUnderProvider(provider string, name string) string
	ReloadServiceUnderProvider(provider string, name string) string
	EnableServiceUnderProvider(provider string, name string) string
	DisableServiceUnderProvider(provider string, name string) string
}

type DarwinCommand

type DarwinCommand struct {
	BaseCommand
}

func (*DarwinCommand) CheckFileIsLinkedTo

func (c *DarwinCommand) CheckFileIsLinkedTo(link, target string) string

func (*DarwinCommand) GetFileMode

func (c *DarwinCommand) GetFileMode(file string) string

func (*DarwinCommand) GetFileOwnerGroup

func (c *DarwinCommand) GetFileOwnerGroup(file string) string

func (*DarwinCommand) GetFileOwnerUser

func (c *DarwinCommand) GetFileOwnerUser(file string) string

func (*DarwinCommand) String

func (c *DarwinCommand) String() string

type DebianCommand added in v0.8.0

type DebianCommand struct {
	LinuxCommand
}

func (*DebianCommand) CheckPackageIsInstalled added in v0.8.0

func (c *DebianCommand) CheckPackageIsInstalled(packagename string, version string) string

func (*DebianCommand) GetPackageVersion added in v0.8.0

func (c *DebianCommand) GetPackageVersion(packagename string, option string) string

func (*DebianCommand) InstallPackage added in v0.8.0

func (c *DebianCommand) InstallPackage(packagename string, version string, option string) string

func (*DebianCommand) RemovePackage added in v0.8.0

func (c *DebianCommand) RemovePackage(packagename string, option string) string

func (*DebianCommand) String added in v0.8.0

func (c *DebianCommand) String() string

type DebianV6Command added in v0.8.0

type DebianV6Command struct {
	DebianCommand
}

func (*DebianV6Command) CheckServiceIsEnabledUnderProvider added in v0.8.0

func (c *DebianV6Command) CheckServiceIsEnabledUnderProvider(provider string, name string) string

func (*DebianV6Command) DisableServiceUnderProvider added in v0.8.0

func (c *DebianV6Command) DisableServiceUnderProvider(provider string, name string) string

func (*DebianV6Command) EnableServiceUnderProvider added in v0.8.0

func (c *DebianV6Command) EnableServiceUnderProvider(provider string, name string) string

func (*DebianV6Command) String added in v0.8.0

func (c *DebianV6Command) String() string

type DebianV8Command added in v0.8.0

type DebianV8Command struct {
	DebianCommand
}

func (*DebianV8Command) DefaultServiceProvider added in v0.8.0

func (c *DebianV8Command) DefaultServiceProvider() string

func (*DebianV8Command) String added in v0.8.0

func (c *DebianV8Command) String() string

type DebianV9Command added in v0.8.0

type DebianV9Command struct {
	DebianCommand
}

func (*DebianV9Command) DefaultServiceProvider added in v0.8.0

func (c *DebianV9Command) DefaultServiceProvider() string

func (*DebianV9Command) String added in v0.8.0

func (c *DebianV9Command) String() string

type FedoraCommand

type FedoraCommand struct {
	RedhatCommand
}

func (*FedoraCommand) String

func (c *FedoraCommand) String() string

type LinuxCommand

type LinuxCommand struct {
	BaseCommand
}

func (*LinuxCommand) String

func (c *LinuxCommand) String() string

type RedhatCommand

type RedhatCommand struct {
	LinuxCommand
}

func (*RedhatCommand) CheckPackageIsInstalled

func (c *RedhatCommand) CheckPackageIsInstalled(packagename string, version string) string

func (*RedhatCommand) GetPackageVersion

func (c *RedhatCommand) GetPackageVersion(packagename string, option string) string

func (*RedhatCommand) InstallPackage

func (c *RedhatCommand) InstallPackage(packagename string, version string, option string) string

func (*RedhatCommand) RemovePackage

func (c *RedhatCommand) RemovePackage(packagename string, option string) string

func (*RedhatCommand) String

func (c *RedhatCommand) String() string

type RedhatV5Command

type RedhatV5Command struct {
	RedhatCommand
}

func (*RedhatV5Command) String

func (c *RedhatV5Command) String() string

type RedhatV7Command

type RedhatV7Command struct {
	RedhatCommand
}

func (*RedhatV7Command) DefaultServiceProvider

func (c *RedhatV7Command) DefaultServiceProvider() string

func (*RedhatV7Command) String

func (c *RedhatV7Command) String() string

type UbuntuCommand added in v0.8.0

type UbuntuCommand struct {
	DebianCommand
}

func (*UbuntuCommand) String added in v0.8.0

func (c *UbuntuCommand) String() string

type UbuntuV1604Command added in v0.8.0

type UbuntuV1604Command struct {
	UbuntuCommand
}

func (*UbuntuV1604Command) DefaultServiceProvider added in v0.8.0

func (c *UbuntuV1604Command) DefaultServiceProvider() string

func (*UbuntuV1604Command) String added in v0.8.0

func (c *UbuntuV1604Command) String() string

type UbuntuV1804Command added in v0.8.0

type UbuntuV1804Command struct {
	UbuntuCommand
}

func (*UbuntuV1804Command) DefaultServiceProvider added in v0.8.0

func (c *UbuntuV1804Command) DefaultServiceProvider() string

func (*UbuntuV1804Command) String added in v0.8.0

func (c *UbuntuV1804Command) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL