mageutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorBlue  = "\033[0;34m"
	ColorGreen = "\033[0;32m"
	ColorRed   = "\033[0;31m"
	ColorReset = "\033[0m"
)

Variables

View Source
var (
	OpenIMRoot               string
	OpenIMOutputConfig       string
	OpenIMOutput             string
	OpenIMOutputTools        string
	OpenIMOutputTmp          string
	OpenIMOutputLogs         string
	OpenIMOutputBin          string
	OpenIMOutputBinPath      string
	OpenIMOutputBinToolPath  string
	OpenIMInitErrLogFile     string
	OpenIMInitLogFile        string
	OpenIMOutputHostBin      string
	OpenIMOutputHostBinTools string
)
View Source
var (
	MaxFileDescriptors int
)

Functions

func CheckAndReportBinariesStatus

func CheckAndReportBinariesStatus()

CheckAndReportBinariesStatus checks the running status of all binary files and reports it.

func CheckBinariesRunning

func CheckBinariesRunning() error

CheckBinariesRunning checks if all binary files are running as expected and returns any errors encountered.

func CheckBinariesStop

func CheckBinariesStop() error

CheckBinariesStop checks if all binary files have stopped and returns an error if there are any binaries still running.

func CheckProcessNames

func CheckProcessNames(processPath string, expectedCount int) error

func CheckProcessNamesExist

func CheckProcessNamesExist(processPath string) bool

CheckProcessNamesExist checks if there are any processes running that match the specified path.

func CompileForPlatform

func CompileForPlatform(platform string)

CompileForPlatform Main compile function

func DetectPlatform

func DetectPlatform() string

DetectPlatform detects the operating system and architecture.

func FindPIDsByBinaryPath

func FindPIDsByBinaryPath(binaryPath string) ([]int, error)

FindPIDsByBinaryPath finds all matching process PIDs by binary path.

func GetBinFullPath

func GetBinFullPath(binName string) string

GetBinFullPath constructs and returns the full path for the given binary name.

func GetToolFullPath

func GetToolFullPath(toolName string) string

GetToolFullPath constructs and returns the full path for the given tool name.

func InitForSSC

func InitForSSC()

func KillExistBinaries

func KillExistBinaries()

KillExistBinaries iterates over all binary files and kills their corresponding processes.

func KillExistBinary

func KillExistBinary(binaryPath string)

KillExistBinary kills all processes matching the given binary file path.

func OsArch

func OsArch() string

func PrintBinaryPorts

func PrintBinaryPorts(binaryPath string)

PrintBinaryPorts prints the ports listened by the process of a specified binary file along with its command line arguments.

func PrintBlue

func PrintBlue(message string)

func PrintBlueTwoLine

func PrintBlueTwoLine(message string)

func PrintGreen

func PrintGreen(message string)

func PrintGreenNoTimeStamp

func PrintGreenNoTimeStamp(message string)

func PrintGreenToStdOut

func PrintGreenToStdOut(a ...interface{}) (n int, err error)

func PrintGreenTwoLine

func PrintGreenTwoLine(message string)

func PrintListenedPortsByBinaries

func PrintListenedPortsByBinaries()

PrintListenedPortsByBinaries iterates over all binary files and prints the ports they are listening on.

func PrintRed

func PrintRed(message string)

func PrintRedNoTimeStamp

func PrintRedNoTimeStamp(message string)

func PrintRedToStdErr

func PrintRedToStdErr(a ...interface{}) (n int, err error)

func Protocol

func Protocol() error

func RemoveOmitemptyFromFile

func RemoveOmitemptyFromFile(filePath string) error

func StartBinaries

func StartBinaries() error

StartBinaries Start all binary services.

func StartTools

func StartTools() error

StartTools starts all tool binaries.

func StartToolsAndServices

func StartToolsAndServices()

StartToolsAndServices starts the process for tools and services.

func StopAndCheckBinaries

func StopAndCheckBinaries()

StopAndCheckBinaries stops all binary processes and checks if they have all stopped.

func StopBinaries

func StopBinaries()

StopBinaries iterates over all binary files and terminates their corresponding processes.

Types

type Config

type Config struct {
	ServiceBinaries    map[string]int `yaml:"serviceBinaries"`
	ToolBinaries       []string       `yaml:"toolBinaries"`
	MaxFileDescriptors int            `yaml:"maxFileDescriptors"`
}

Jump to

Keyboard shortcuts

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