Documentation ¶
Index ¶
- Constants
- func CheckEnv(c *Config, osEnvs, dotEnvs []string, includeNoSpec bool) (results []EnvCheckResult, envs *EnvVar)
- func DumpCommand(stdout io.Writer, command string, args []string, dryRun bool)
- func Exec(stdout, stderr io.Writer, config *Config, command string, args []string, ...) error
- func Generate(stdout io.Writer, format string) error
- func ParseAndVerifyConfig(workingDir string, stdout, stderr io.Writer, configFlag, dotEnvFlag string) (*Config, *EnvVar, error)
- func SearchFiles(patterns, cwd string) ([]string, error)
- type Config
- type DependsOn
- type DependsOnCheckResult
- type Env
- type EnvCheckResult
- type EnvVar
- func (e EnvVar) EnvsForExec() (result []string)
- func (e EnvVar) Expand(value string) string
- func (e EnvVar) FindSuggest(missingKey string) (result []string)
- func (e EnvVar) Get(key string) (string, string, source, bool)
- func (e *EnvVar) Import(src source, envs []string)
- func (e *EnvVar) Register(src source, key, value string) int
- type File
- type FileCheckResult
- type HealthCheck
- type LogConfig
- type LogOutput
- type LogOutputs
- type LogType
- type Logger
- func (l *Logger) Close()
- func (l *Logger) StartOutput(eg *errgroup.Group, reader io.ReadCloser)
- func (l *Logger) Write(line string)
- func (l *Logger) WriteMap(log map[string]interface{})
- func (l *Logger) WriteMetrics(memUsage uint64, memPercent float32, cpuPercent float64)
- func (l *Logger) WriteProcessResult(exitAt time.Time, status string, wallClock, user, sys time.Duration)
- func (l *Logger) WriteProcessStart(startAt time.Time, pid int, dir, cmd string, args []string)
- type Process
- type Rewrite
Constants ¶
View Source
const ( StdOut LogType = iota + 1 StdErr LogLevelKey = "level" LogDocradleLogKey = "docradle-log" )
Variables ¶
This section is empty.
Functions ¶
func CheckEnv ¶
func CheckEnv(c *Config, osEnvs, dotEnvs []string, includeNoSpec bool) (results []EnvCheckResult, envs *EnvVar)
CheckEnv checks environment variables
func Exec ¶
func Exec(stdout, stderr io.Writer, config *Config, command string, args []string, envvar *EnvVar) error
Exec executes command
func ParseAndVerifyConfig ¶
func ParseAndVerifyConfig(workingDir string, stdout, stderr io.Writer, configFlag, dotEnvFlag string) (*Config, *EnvVar, error)
ParseAndVerifyConfig reads and verify configs
It dumps config status and error message to stdout, stderr
func SearchFiles ¶
SearchFiles searches filepathes to match pattern
Types ¶
type Config ¶
type Config struct { Env []Env Stdout LogConfig Stderr LogConfig DashboardPort int DelvePort int Files []File DependsOn []DependsOn Process Process HealthCheck HealthCheck LogLevel string }
Config stores all config about execution environment
type DependsOnCheckResult ¶
type DependsOnCheckResult struct {
// contains filtered or unexported fields
}
DependsOnCheckResult is a collection of dependency check
func WaitForDependencies ¶
func WaitForDependencies(ctx context.Context, dependsOns []DependsOn) (result []DependsOnCheckResult)
func (DependsOnCheckResult) Error ¶
func (r DependsOnCheckResult) Error() error
func (DependsOnCheckResult) String ¶
func (r DependsOnCheckResult) String() string
type EnvCheckResult ¶
type EnvCheckResult struct {
// contains filtered or unexported fields
}
EnvCheckResult is a collection of envvar check
func (EnvCheckResult) Error ¶
func (c EnvCheckResult) Error() error
func (EnvCheckResult) String ¶
func (c EnvCheckResult) String() string
type EnvVar ¶
type EnvVar struct {
// contains filtered or unexported fields
}
func (EnvVar) EnvsForExec ¶
func (EnvVar) FindSuggest ¶
type FileCheckResult ¶
type FileCheckResult struct {
// contains filtered or unexported fields
}
FileCheckResult contains file check result
func ProcessFiles ¶
func ProcessFiles(config *Config, cwd string, envs *EnvVar) (results []FileCheckResult)
ProcessFiles checks file existing test, upcate contents and so on.
func (FileCheckResult) String ¶
func (c FileCheckResult) String() string
type HealthCheck ¶
type LogOutputs ¶
type LogOutputs []LogOutput
func DumpAndSummaryDependsOnResult ¶
func DumpAndSummaryDependsOnResult(results []DependsOnCheckResult) LogOutputs
DumpAndSummaryDependsOnResult dumps depends-on check result
func DumpAndSummaryEnvResult ¶
func DumpAndSummaryEnvResult(results []EnvCheckResult) LogOutputs
DumpAndSummaryEnvResult dumps environment variable check result
func DumpAndSummaryFileResult ¶
func DumpAndSummaryFileResult(results []FileCheckResult) LogOutputs
func (LogOutputs) Dump ¶
func (l LogOutputs) Dump(errorOnly bool) bool
func (LogOutputs) HasError ¶
func (l LogOutputs) HasError() bool
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) StartOutput ¶
func (l *Logger) StartOutput(eg *errgroup.Group, reader io.ReadCloser)
func (*Logger) WriteMetrics ¶
func (*Logger) WriteProcessResult ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.