check

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DistributionCentos string = "centos"
	DistributionUbuntu string = "ubuntu"
	DistributionRHEL   string = "rhel"
)

Variables

This section is empty.

Functions

func CheckCPUNums

func CheckCPUNums(cpuCore string, desiredCPUCore float64) error

check if CPU numbers larger or equal than desired cores

func CheckDockerVersion

func CheckDockerVersion(dockerVersion string, standardVersion string, comparedSymbol string) error

check docker version if version larger or equal than standard version

func CheckKernelVersion

func CheckKernelVersion(kernelVersion string, standardVersion string, checkStandard string) error

check if kernel version larger or equal than standard version

func CheckMemoryCapacity

func CheckMemoryCapacity(comparedMemory string, desiredMemory float64) error

check if memory capacity satisfied with minimal requirement

func CheckPortOccupied

func CheckPortOccupied(portSet string) (string, error)

check if port is occupied

func CheckRootDiskVolume

func CheckRootDiskVolume(rootDiskVolume string, desiredDiskVolume float64) error

check if root disk volume satisfied with desired disk volume

func CheckSystemDistribution

func CheckSystemDistribution(disName string) error

check if system distribution can be supported

func CheckSystemManager

func CheckSystemManager(systemManager string, desireSysManager string) error

check is system manager is systemd

Types

type CheckAction

type CheckAction interface {
	GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)
	CloseSSH()
	// contains filtered or unexported methods
}

type CheckCPUOperation

type CheckCPUOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckCPUOperation) CloseSSH

func (ckops *CheckCPUOperation) CloseSSH()

close ssh client

func (*CheckCPUOperation) GetOperations

func (ckops *CheckCPUOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckDistributionOperation

type CheckDistributionOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckDistributionOperation) CloseSSH

func (ckops *CheckDistributionOperation) CloseSSH()

close ssh client

func (*CheckDistributionOperation) GetOperations

func (ckops *CheckDistributionOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckDockerOperation

type CheckDockerOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckDockerOperation) CloseSSH

func (ckops *CheckDockerOperation) CloseSSH()

close ssh client

func (*CheckDockerOperation) GetOperations

func (ckops *CheckDockerOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckKernelOperation

type CheckKernelOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckKernelOperation) CloseSSH

func (ckops *CheckKernelOperation) CloseSSH()

close ssh client

func (*CheckKernelOperation) GetOperations

func (ckops *CheckKernelOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckMemoryOperation

type CheckMemoryOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckMemoryOperation) CloseSSH

func (ckops *CheckMemoryOperation) CloseSSH()

close ssh client

func (*CheckMemoryOperation) GetOperations

func (ckops *CheckMemoryOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckOperations

type CheckOperations struct {
	Script     string
	ScriptPath string
	Machine    machine.IMachine
}

type CheckPortOccupiedOperation

type CheckPortOccupiedOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckPortOccupiedOperation) CloseSSH

func (ckops *CheckPortOccupiedOperation) CloseSSH()

close ssh client

func (*CheckPortOccupiedOperation) GetOperations

func (ckops *CheckPortOccupiedOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckRootDiskOperation

type CheckRootDiskOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckRootDiskOperation) CloseSSH

func (ckops *CheckRootDiskOperation) CloseSSH()

close ssh client

func (*CheckRootDiskOperation) GetOperations

func (ckops *CheckRootDiskOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckSysPrefOperation

type CheckSysPrefOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckSysPrefOperation) CloseSSH

func (ckops *CheckSysPrefOperation) CloseSSH()

close ssh client

func (*CheckSysPrefOperation) GetOperations

func (ckops *CheckSysPrefOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type CheckSystemManagerOperation

type CheckSystemManagerOperation struct {
	operation.BaseOperation
	CheckOperations
	Machine machine.IMachine
}

func (*CheckSystemManagerOperation) CloseSSH

func (ckops *CheckSystemManagerOperation) CloseSSH()

close ssh client

func (*CheckSystemManagerOperation) GetOperations

func (ckops *CheckSystemManagerOperation) GetOperations(config *pb.NodeCheckConfig) (operation.Operation, error)

type ItemEnum

type ItemEnum string
const (
	Docker           ItemEnum = "docker"
	CPU              ItemEnum = "cpu"
	Kernel           ItemEnum = "kernel"
	Memory           ItemEnum = "memory"
	Disk             ItemEnum = "disk"
	Distribution     ItemEnum = "distribution"
	SystemPreference ItemEnum = "system-preference"
	SystemManager    ItemEnum = "system-manager"
	PortOccupied     ItemEnum = "port-occupied"
)

type OperationsGenerator

type OperationsGenerator struct {
	Node *pb.Node
}

func NewCheckOperations

func NewCheckOperations() *OperationsGenerator

func (*OperationsGenerator) CreateOperations

func (og *OperationsGenerator) CreateOperations(item ItemEnum) CheckAction

Jump to

Keyboard shortcuts

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