Documentation
¶
Index ¶
- Constants
- func ArchiveProject(archiveOptions *ArchiveOptions) error
- func BatchKillExistBinaries(binaryPaths []string) error
- func Build(services []string, tools []string, pathOpts *PathOptions, ...) error
- func CheckAndReportServicesStatus() error
- func CheckProcessInMap(processMap map[string]int, processPath string) bool
- func CheckProcessNames(processPath string, expectedCount int, processMap map[string]int) error
- func CheckServicesRunning() error
- func CheckServicesStopped() error
- func CompileForPlatform(buildOpt *BuildOptions, platform string, serviceTargets, toolTargets []string) error
- func DetectPlatform() (string, error)
- func EnsureRootRelPaths(paths ...string) (map[string]string, error)
- func ExportMageLauncherArchived(overrideMappingPaths map[string]string, exportOpt *ExportOptions) error
- func FetchProcesses() (map[string]int, error)
- func FindPIDsByBinaryPath() (map[string][]int, error)
- func GetAllRootFilesExcludeIgnore() ([]string, error)
- func GetDefaultExportMappingPaths(exclude []string) (map[string]string, error)
- func GetSharedLogFile() (*os.File, error)
- func GetSharedLogFileWithoutError() *os.File
- func GetStderrInnerLogWriter() io.Writer
- func GetStdoutInnerLogWriter() io.Writer
- func KillExistBinary(binaryPath string) error
- func KillExistingServices() error
- func LoadStartConfig() error
- func OsArch() string
- func ParseArgList(arg *string) []string
- func Print(opt PrintOptions) error
- func PrintBinaryPorts(binaryPath string, pidMap map[string][]int)
- func PrintBlue(message string)
- func PrintErr(err error)
- func PrintErrNoTimeStamp(err error)
- func PrintErrPtr(err *error)
- func PrintGreen(message string)
- func PrintListenedPortsByServices() error
- func PrintYellow(message string)
- func Protocol() error
- func RefreshSpinner()
- func RemoveOmitemptyFromFile(filePath string) error
- func StartServices(services []string) error
- func StartTools(tools []string) error
- func StartToolsAndServices(tools []string, services []string, pathOpts *PathOptions) error
- func StopAndCheckServices() error
- func StopServices() error
- func StopSpinner()
- func UpdateGlobalPaths(opts *PathOptions) error
- func WithSpinner(message string, fn func())
- func WithSpinnerR[R any](message string, fn func() R) R
- type ArchiveOptions
- type BuildOptions
- type Cmd
- func (c *Cmd) CombinedOutput() ([]byte, error)
- func (c *Cmd) Output() ([]byte, error)
- func (c *Cmd) Run() error
- func (c *Cmd) Start() error
- func (c *Cmd) String() string
- func (c *Cmd) Wait() error
- func (c *Cmd) WithArgs(args ...string) *Cmd
- func (c *Cmd) WithDir(dir string) *Cmd
- func (c *Cmd) WithEnv(env map[string]string) *Cmd
- func (c *Cmd) WithPriority(priority priority.Level) *Cmd
- func (c *Cmd) WithStderr(stderr io.Writer) *Cmd
- func (c *Cmd) WithStdin(stdin io.Reader) *Cmd
- func (c *Cmd) WithStdout(stdout io.Writer) *Cmd
- type ExportOptions
- type PathConfig
- type PathOptions
- type PrintOptions
- type Spinner
- type StartConfig
Constants ¶
const ( ColorBlue = "\033[0;34m" ColorGreen = "\033[0;32m" ColorRed = "\033[0;31m" ColorYellow = "\033[33m" ColorMagenta = "\033[35m" ColorReset = "\033[0m" )
const ( MountConfigFilePath = "CONFIG_PATH" DeploymentType = "DEPLOYMENT_TYPE" KUBERNETES = "kubernetes" // Directory command constants ConfigDir = "config" OutputDir = "_output" SrcDir = "cmd" ToolsDir = "tools" TmpDir = "tmp" ExportDir = "export" ArchiveDir = "archive" LogDir = "logs" BinDir = "bin" PlatformsDir = "platforms" )
Path constants
const (
StartConfigFile = "start-config.yml"
)
Variables ¶
This section is empty.
Functions ¶
func ArchiveProject ¶ added in v0.0.18
func ArchiveProject(archiveOptions *ArchiveOptions) error
func BatchKillExistBinaries ¶ added in v0.0.8
func Build ¶ added in v0.0.13
func Build(services []string, tools []string, pathOpts *PathOptions, buildOpt *BuildOptions) error
func CheckAndReportServicesStatus ¶ added in v0.0.18
func CheckAndReportServicesStatus() error
func CheckProcessInMap ¶ added in v0.0.9
func CheckProcessNames ¶
CheckProcessNames checks if the number of processes running that match the specified path equals the expected count.
func CheckServicesRunning ¶ added in v0.0.18
func CheckServicesRunning() error
CheckServicesRunning checks whether all configured services are running as expected.
func CheckServicesStopped ¶ added in v0.0.18
func CheckServicesStopped() error
CheckServicesStopped returns an error if any configured services are still running.
func CompileForPlatform ¶
func CompileForPlatform(buildOpt *BuildOptions, platform string, serviceTargets, toolTargets []string) error
func DetectPlatform ¶
DetectPlatform detects the operating system and architecture.
func EnsureRootRelPaths ¶ added in v0.0.16
func ExportMageLauncherArchived ¶ added in v0.0.16
func ExportMageLauncherArchived(overrideMappingPaths map[string]string, exportOpt *ExportOptions) error
func FetchProcesses ¶ added in v0.0.9
FetchProcesses returns a map of executable paths to their running count.
func FindPIDsByBinaryPath ¶
FindPIDsByBinaryPath returns a map of executable paths to slices of PIDs.
func GetAllRootFilesExcludeIgnore ¶ added in v0.0.16
func GetDefaultExportMappingPaths ¶ added in v0.0.16
func GetSharedLogFile ¶ added in v0.0.18
func GetSharedLogFileWithoutError ¶ added in v0.0.18
func GetStderrInnerLogWriter ¶ added in v0.0.18
func GetStdoutInnerLogWriter ¶ added in v0.0.18
func KillExistBinary ¶
KillExistBinary kills all processes matching the given binary file path.
func KillExistingServices ¶ added in v0.0.18
func KillExistingServices() error
KillExistingServices kills all configured service processes.
func LoadStartConfig ¶ added in v0.0.18
func LoadStartConfig() error
func ParseArgList ¶ added in v0.0.18
func Print ¶ added in v0.0.16
func Print(opt PrintOptions) error
func PrintBinaryPorts ¶
func PrintErrNoTimeStamp ¶ added in v0.0.18
func PrintErrNoTimeStamp(err error)
func PrintErrPtr ¶ added in v0.0.18
func PrintErrPtr(err *error)
func PrintGreen ¶
func PrintGreen(message string)
func PrintListenedPortsByServices ¶ added in v0.0.18
func PrintListenedPortsByServices() error
PrintListenedPortsByServices prints the ports listened to by configured services.
func PrintYellow ¶ added in v0.0.4
func PrintYellow(message string)
func RefreshSpinner ¶ added in v0.0.18
func RefreshSpinner()
func RemoveOmitemptyFromFile ¶ added in v0.0.14
func StartServices ¶ added in v0.0.18
StartServices starts all configured services or the specified ones.
func StartTools ¶
StartTools starts all tool binaries or specified ones.
func StartToolsAndServices ¶
func StartToolsAndServices(tools []string, services []string, pathOpts *PathOptions) error
func StopAndCheckServices ¶ added in v0.0.18
func StopAndCheckServices() error
func StopServices ¶ added in v0.0.18
func StopServices() error
StopServices terminates all configured service processes.
func StopSpinner ¶ added in v0.0.16
func StopSpinner()
func UpdateGlobalPaths ¶ added in v0.0.16
func UpdateGlobalPaths(opts *PathOptions) error
UpdateGlobalPaths updates the global Paths variable with new options
func WithSpinner ¶ added in v0.0.16
func WithSpinner(message string, fn func())
func WithSpinnerR ¶ added in v0.0.18
Types ¶
type ArchiveOptions ¶ added in v0.0.18
type ArchiveOptions struct {
ProjectName *string
}
func (*ArchiveOptions) GetProjectName ¶ added in v0.0.18
func (opt *ArchiveOptions) GetProjectName() string
type BuildOptions ¶ added in v0.0.16
func ResolveBuildOptions ¶ added in v0.0.16
func ResolveBuildOptions(codeOpt *BuildOptions, envOpt *BuildOptions) *BuildOptions
func (*BuildOptions) GetCgoEnabled ¶ added in v0.0.16
func (opt *BuildOptions) GetCgoEnabled() string
func (*BuildOptions) GetCompress ¶ added in v0.0.16
func (opt *BuildOptions) GetCompress() bool
func (*BuildOptions) GetPlatforms ¶ added in v0.0.16
func (opt *BuildOptions) GetPlatforms() []string
func (*BuildOptions) GetRelease ¶ added in v0.0.16
func (opt *BuildOptions) GetRelease() bool
type Cmd ¶ added in v0.0.18
type Cmd struct {
// contains filtered or unexported fields
}
func (*Cmd) CombinedOutput ¶ added in v0.0.18
func (*Cmd) WithPriority ¶ added in v0.0.18
type ExportOptions ¶ added in v0.0.16
type ExportOptions struct {
ProjectName *string
BuildOpt *BuildOptions
}
func (*ExportOptions) GetBuildOpt ¶ added in v0.0.16
func (opt *ExportOptions) GetBuildOpt() *BuildOptions
func (*ExportOptions) GetProjectName ¶ added in v0.0.16
func (opt *ExportOptions) GetProjectName() string
type PathConfig ¶ added in v0.0.16
type PathConfig struct {
Root string
Config string
K8sConfig string
Output string
OutputTools string
OutputTmp string
OutputExport string
OutputArchive string
OutputLog string
OutputBin string
OutputBinServicePath string
OutputBinToolPath string
OutputHostBinService string
OutputHostBinTool string
Cmd string // Source cmd directory
Tools string // Source tools directory
}
PathConfig represents the path configuration structure
var Paths *PathConfig
func NewPathConfig ¶ added in v0.0.16
func NewPathConfig(opts *PathOptions) (*PathConfig, error)
NewPathConfig creates a new path configuration with optional settings
func (*PathConfig) GetBinServiceFullPath ¶ added in v0.0.18
func (p *PathConfig) GetBinServiceFullPath(binName string) string
GetBinServiceFullPath returns the full path for a binary file
func (*PathConfig) GetBinToolFullPath ¶ added in v0.0.18
func (p *PathConfig) GetBinToolFullPath(toolName string) string
GetBinToolFullPath GetToolFullPath returns the full path for a tool
type PathOptions ¶ added in v0.0.16
type PathOptions struct {
RootDir *string // Custom root directory, default is current working directory(./)
OutputDir *string // Custom output directory command, default is "_output"
ConfigDir *string // Custom config directory command, default is "config"
SrcDir *string // Custom cmd source directory command, default is "cmd"
ToolsDir *string // Custom tools source directory command, default is "tools"
}
type PrintOptions ¶ added in v0.0.16
type Spinner ¶ added in v0.0.16
type Spinner struct {
// contains filtered or unexported fields
}