Documentation
¶
Index ¶
- Constants
- Variables
- func AddMonitorFlags(cmd *cobra.Command)
- func ErrorExit(log *logger.Logger, err error, exitCode int)
- func GetMonitorContextFromFlags(ctx context.Context, logger logr.Logger) (context.Context, context.CancelFunc)
- func LogVersion(log logr.Logger, programStartMsg string) func(_ *cobra.Command, _ []string)
- func MonitorPid(ctx context.Context, pid process.Pid_t, expectedProcessStartTime time.Time, ...) (context.Context, context.CancelFunc, error)
- func NewVersionCommand(log logr.Logger) (*cobra.Command, error)
Constants ¶
const (
// If set, the value of this variable will be written to the log file as one of the first log messages.
DCP_LOGGING_CONTEXT = "DCP_LOGGING_CONTEXT"
)
Variables ¶
var ( Version = defaultVersion CommitHash = "" BuildTimestamp = "" )
Functions ¶
func AddMonitorFlags ¶
func GetMonitorContextFromFlags ¶
func GetMonitorContextFromFlags(ctx context.Context, logger logr.Logger) (context.Context, context.CancelFunc)
Returns a context (derived from the passed parent context) that will be cancelled when the process specified by the monitor flags (--monitor and --monitor-identity-time) exits . If the flags are not present at startup, the returned context is just a regular cancellable context with no additional semantics. If an error occurs (e.g. the process cannot be found, or the monitor flag values are invalid), the context is still returned, but it will be cancelled immediately.
func LogVersion ¶
func MonitorPid ¶
func MonitorPid( ctx context.Context, pid process.Pid_t, expectedProcessStartTime time.Time, pollInterval uint8, logger logr.Logger, ) (context.Context, context.CancelFunc, error)
Starts monitoring a process with a given PID and (optional) start time. Returns a context that will be cancelled when the monitored process exits, or if the returned cancellation function is called. The returned context (and the cancellation function) is valid even if an error occurs (e.g. the process cannot be found), but it will be already cancelled in that case.
Types ¶
This section is empty.