source

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package source is the source behavior: the syslog identifiers that wrote to the systemd journal of the host, read with journalctl on each Linux host.

Index

Constants

This section is empty.

Variables

View Source
var Behavior = behavior.Register(behavior.Define(
	"source", "The sources that write to the systemd journal",
	behavior.Title("Log source"),
	behavior.Node,
	behavior.Under(entry.Behavior),
	behavior.API,
	behavior.Area(area.Logs),
	behavior.CLI,
	behavior.Platform(behavior.PlatformLinux, newLinux),
	behavior.Read("list", List).
		NotAFact("the sources are what journald holds now, not a fact of the host").
		Runs("journalctl").
		Describe("List the sources of the journal").
		Explain("Runs journalctl --field=SYSLOG_IDENTIFIER: each syslog identifier "+
			"that has an entry, once, sorted. A name here is what log list "+
			"takes as unit when the source is a systemd unit.").
		Example("The sources", ListInput{}, []Source{{Name: "cron"}, {Name: "nginx"}, {Name: "sshd"}},
			behavior.Prints("journalctl --field=SYSLOG_IDENTIFIER", "sshd\nnginx\ncron\n\n"),
		),
))

Behavior is the sources of the systemd journal, under the log: each syslog identifier that has an entry. They are what journald holds now, not a fact of the host, so journalctl reads them, not gohai. It runs on each Linux host; macOS has no journal, and reports skipped.

Functions

This section is empty.

Types

type ListInput

type ListInput struct{}

ListInput takes nothing: it lists each source.

type Provider

type Provider interface {
	// Sources is each syslog identifier that has an entry, sorted.
	Sources(ctx context.Context) ([]string, error)
}

Provider reads the sources of the journal of the host.

type Source

type Source struct {
	Name string `json:"name" doc:"The syslog identifier, such as sshd"`
}

Source is one syslog identifier that has an entry in the journal.

func List

func List(
	ctx context.Context,
	p Provider,
	_ ListInput,
) ([]Source, error)

List is each source of the journal.

Directories

Path Synopsis
Package mocks holds the generated double of the source provider, for the methods' tests.
Package mocks holds the generated double of the source provider, for the methods' tests.

Jump to

Keyboard shortcuts

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