Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JournalTailer ¶
type JournalTailer struct {
// contains filtered or unexported fields
}
JournalTailer is an exec of the journalctl command line
func NewJournalTailer ¶
NewJournalTailer instantiate a new JournalTailer. The parameter are: - unit name "example.service" - since show entries not older than the specified date - follow to enable the tailing
func (*JournalTailer) GetCommandLine ¶ added in v0.3.0
func (j *JournalTailer) GetCommandLine() string
GetCommandLine returns the command line as a single joined string
func (*JournalTailer) GetUnitName ¶ added in v0.3.0
func (j *JournalTailer) GetUnitName() string
GetUnitName is a getter to returns the unit name to display
func (*JournalTailer) IsRunning ¶ added in v0.5.0
func (j *JournalTailer) IsRunning() bool
IsRunning returns if the process and the pipe are still running
func (*JournalTailer) RestartTail ¶ added in v0.5.0
func (j *JournalTailer) RestartTail() error
RestartTail execute a StopTail and a StartTail. Basically it allows to stop and start over
func (*JournalTailer) StartTail ¶
func (j *JournalTailer) StartTail() error
StartTail build and start the journalctl process with the adapted flags It creates a pipe to display the logs over stdout
func (*JournalTailer) StopTail ¶
func (j *JournalTailer) StopTail() error
StopTail close the pipe, send a SIGTERM to the journalctl process and then wait its completion
func (*JournalTailer) Wait ¶ added in v0.3.0
func (j *JournalTailer) Wait() error
Wait on the journalctl process, needed to reap the process