Categorygithub.com/alexript/cocoon
modulepackage
0.0.0-20190909125854-a8ac6214ecd0
Repository: https://github.com/alexript/cocoon.git
Documentation: pkg.go.dev

# README

cocoon

Runtime container

# Functions

AttachConsole call win32 AttachConsole.
CloseLog close log.
DefaultCocoon creates new Cocoon object with default values.
DefaultMessageBox is win32 MessageBox in information mode.
ErrorMessageBox is win32 MessageBox in error mode.
FreeConsole call win32 FreeConsole.
GetAbsolutePath transforms given path to the absolute path in myself dir if relative.
GetCocoonAssetName returns filename, produced by cocoon exe file name without extension + given extension.
GetConfigFileName returns config file name.
GetLogLevel returns current log level.
GetMyselfDir returns folder where executable file is.
GetMyselfName returns abs filepath to executable file.
GetNpipeName constructs npipe name by pid.
GetOutputs creates stdout and stderr files in specific folder and returns file handlers.
HasConfig checks is config file is available.
InitCocoon initialize cocoon.
Initlog log initialization.
Is64bitOS try to call win32 IsWow64Process.
ListenNpipe starts npipe listener.
LoadConfig if config file is not exists then creates default and load config file.
LogError log as error.
LogFatal panic.
LogInfo log as information.
LogWarning log as warinig.
MetamorphoseChrysalisDir sets new values in [chrystalis] config section.
MetamorphoseCocoonLoglevel sets new [cocoon].log.level config value.
MetamorphoseCocoonLogname sets new [cocoon].log.file config value.
MetamorphoseCocoonStartup sets new [cocoon].startup config value.
MetamorphoseCocoonUsepipe sets new [cocoon].usepipe value.
MetamorphoseDate write new metamorphose date into config.
MetamorphoseInjectChrysalis extract zip into [chrysalis].dir.base and updates config.
MetamorphoseLarvaStartup sets new [larva].startup config value.
NewCocoon creates new Coocon object, based on config file content.
ParseLogLevel convert string to Severity.
SetLogLevel sets log level.
ShouldMetamorph returns true if params contain "metamorphose" keyword.
Start cocoon container.
StartCmdScript starts %COMSPEC% (cmd.exe expected) with scriptName as /C argument value.
StartCmdScripts creates sequence '"script1" && "script2" && ...' and call %COMSPEC% (cmd.exe) with this sequence as /C value.
No description provided by the author

# Structs

Cocoon configuration structure.

# Type aliases

Severity is log severity level.