Documentation
¶
Index ¶
- func AttachConsole() (ok bool)
- func CloseLog()
- func DefaultMessageBox(caption, text string) (result int)
- func ErrorMessageBox(text string) (result int)
- func FreeConsole() (ok bool)
- func GetAbsolutePath(somepath string) string
- func GetCocoonAssetName(extension string) string
- func GetConfigFileName() string
- func GetMyselfDir() string
- func GetMyselfName() (string, error)
- func GetNpipeName() string
- func GetOutputs(folder string, filenamePrefix string) (stdout *os.File, stderr *os.File, err error)
- func HasConfig() bool
- func InitCocoon()
- func Initlog(title string, exeFileName string)
- func Is64bitOS() bool
- func ListenNpipe() *npipe.PipeListener
- func LoadConfig() (*initfile.File, error)
- func LogError(v ...interface{})
- func LogFatal(v ...interface{})
- func LogInfo(v ...interface{})
- func LogWarning(v ...interface{})
- func MetamorphoseChrysalisDir(value string, cfg *initfile.File) bool
- func MetamorphoseCocoonLoglevel(value string, cfg *initfile.File) bool
- func MetamorphoseCocoonLogname(value string, cfg *initfile.File) bool
- func MetamorphoseCocoonStartup(value string, cfg *initfile.File) bool
- func MetamorphoseCocoonUsepipe(value string, cfg *initfile.File) bool
- func MetamorphoseDate(cfg *initfile.File)
- func MetamorphoseInjectChrysalis(injectName, injectZip, dropRuntimes string, cfg *initfile.File) bool
- func MetamorphoseLarvaStartup(value string, cfg *initfile.File) bool
- func SetLogLevel(level Severity)
- func ShouldMetamorph(params []string) bool
- func Start(startupCmdFile, logFileName string, cocoon *Cocoon)
- func StartCmdScript(scriptName string, attr *os.ProcAttr) *os.Process
- func StartCmdScripts(scriptNames []string, attr *os.ProcAttr) *os.Process
- func Stop()
- type Cocoon
- type Severity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMessageBox ¶
DefaultMessageBox is win32 MessageBox in information mode
func ErrorMessageBox ¶
ErrorMessageBox is win32 MessageBox in error mode
func GetAbsolutePath ¶
GetAbsolutePath transforms given path to the absolute path in myself dir if relative. Returns as is if path is absolute.
func GetCocoonAssetName ¶
GetCocoonAssetName returns filename, produced by cocoon exe file name without extension + given extension
func GetMyselfDir ¶
func GetMyselfDir() string
GetMyselfDir returns folder where executable file is.
func GetMyselfName ¶
GetMyselfName returns abs filepath to executable file
func GetOutputs ¶
GetOutputs creates stdout and stderr files in specific folder and returns file handlers
func Is64bitOS ¶
func Is64bitOS() bool
Is64bitOS try to call win32 IsWow64Process. Our application must be 32bit to have correct result.
func LoadConfig ¶
LoadConfig if config file is not exists then creates default and load config file
func MetamorphoseChrysalisDir ¶
MetamorphoseChrysalisDir sets new values in [chrystalis] config section
func MetamorphoseCocoonLoglevel ¶
MetamorphoseCocoonLoglevel sets new cocoon.log.level config value
func MetamorphoseCocoonLogname ¶
MetamorphoseCocoonLogname sets new cocoon.log.file config value
func MetamorphoseCocoonStartup ¶
MetamorphoseCocoonStartup sets new cocoon.startup config value
func MetamorphoseCocoonUsepipe ¶
MetamorphoseCocoonUsepipe sets new cocoon.usepipe value
func MetamorphoseDate ¶
MetamorphoseDate write new metamorphose date into config
func MetamorphoseInjectChrysalis ¶
func MetamorphoseInjectChrysalis(injectName, injectZip, dropRuntimes string, cfg *initfile.File) bool
MetamorphoseInjectChrysalis extract zip into [chrysalis].dir.base and updates config
func MetamorphoseLarvaStartup ¶
MetamorphoseLarvaStartup sets new [larva].startup config value
func ShouldMetamorph ¶
ShouldMetamorph returns true if params contain "metamorphose" keyword
func StartCmdScript ¶
StartCmdScript starts %COMSPEC% (cmd.exe expected) with scriptName as /C argument value.
func StartCmdScripts ¶
StartCmdScripts creates sequence '"script1" && "script2" && ...' and call %COMSPEC% (cmd.exe) with this sequence as /C value
Types ¶
type Cocoon ¶
type Cocoon struct { ArchStr string Path string `validate:"fileExists"` Startup string ChrystalisPath string `validate:"fileExists"` ChrystalisStartup string LarvaPath string `validate:"fileExists"` LarvaStartup string `validate:"fileExists"` UsePipe bool LogPath string }
Cocoon configuration structure
func DefaultCocoon ¶
DefaultCocoon creates new Cocoon object with default values.
type Severity ¶
type Severity int
Severity is log severity level.
func ParseLogLevel ¶
ParseLogLevel convert string to Severity