cmd

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultJournalctlBin = "/usr/bin/journalctl"
	DefaultSystemctlBin  = "/usr/bin/systemctl"
)

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute executes the root command.

func NewSystemd

func NewSystemd(cmdContext execContext, unitName string, journalctl string, systemctl string) *systemdRunner

Types

type MessageWrapper

type MessageWrapper struct {
	RawText       string
	ResticMessage *ResticMsg
}

MessageWrap handles intercepting MESSAGE field values.

func (*MessageWrapper) UnmarshalJSON

func (mw *MessageWrapper) UnmarshalJSON(data []byte) (err error)

type ResticMsg

type ResticMsg struct {
	MessageType         string  `json:"message_type"`
	FilesNew            uint64  `json:"files_new"`
	FilesChanged        uint64  `json:"files_changed"`
	FilesUnmodified     uint64  `json:"files_unmodified"`
	DirsNew             uint64  `json:"dirs_new"`
	DirsChanged         uint64  `json:"dirs_changed"`
	DirsUnmodified      uint64  `json:"dirs_unmodified"`
	TotalFilesProcessed uint64  `json:"total_files_processed"`
	TotalBytesProcessed uint64  `json:"total_bytes_processed"`
	TotalDuration       float64 `json:"total_duration"`
	SnapshotId          string  `json:"snapshot_id"`
}

ResticMsg contains the data from parsed JSON output by the restic backup tool.

type SyslogEntry

type SyslogEntry struct {
	SyslogId           string         `json:"SYSLOG_IDENTIFIER"`
	MonotonicTimestamp uint64         `json:"__MONOTONIC_TIMESTAMP,string"`
	InvocationId       string         `json:"_SYSTEMD_INVOCATION_ID"`
	SystemdUnit        string         `json:"_SYSTEMD_UNIT"`
	MachineId          string         `json:"_MACHINE_ID"`
	Hostname           string         `json:"_HOSTNAME"`
	Message            MessageWrapper `json:"MESSAGE,omitempty"`
}

SyslogEntry contains the contents of a single systemd journal entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL