fs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GID = uint32(os.Getgid())
View Source
var UID = uint32(os.Getuid())
View Source
var UNIT_TYPES = []string{
	"automount",
	"device",
	"mount",
	"path",
	"scope",
	"service",
	"slice",
	"socket",
	"swap",
	"target",
	"timer",
}

UNIT_TYPES represents the list of systemd unit types for which there can be journal entries

This forms the list of directories under a UnitTypesDir

Functions

This section is empty.

Types

type FS

type FS struct {
	// contains filtered or unexported fields
}

func NewFS

func NewFS(journalCache *journalcache.JournalCache) *FS

func (*FS) Root

func (fs *FS) Root() (bzfs.Node, error)

type Root

type Root struct {
	*UnitTypesDir
	// contains filtered or unexported fields
}

func NewRoot

func NewRoot(journalCache *journalcache.JournalCache) *Root

type UnitLogFile

type UnitLogFile struct {
	Unit string
	// contains filtered or unexported fields
}

func NewUnitLogFile

func NewUnitLogFile(jc *journalcache.JournalCache, unit string) *UnitLogFile

func (*UnitLogFile) Attr

func (f *UnitLogFile) Attr(ctx context.Context, attr *fuse.Attr) error

func (*UnitLogFile) Open added in v0.2.0

func (f *UnitLogFile) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenResponse) (fs.Handle, error)

func (*UnitLogFile) Read

func (f *UnitLogFile) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

func (*UnitLogFile) String

func (f *UnitLogFile) String() string

type UnitLogsDir

type UnitLogsDir struct {
	Type string
	// contains filtered or unexported fields
}

func NewUnitLogsDir

func NewUnitLogsDir(jc *journalcache.JournalCache, unitType string) *UnitLogsDir

func (*UnitLogsDir) Attr

func (d *UnitLogsDir) Attr(ctx context.Context, attr *fuse.Attr) error

func (*UnitLogsDir) Lookup

func (d *UnitLogsDir) Lookup(ctx context.Context, name string) (bzfs.Node, error)

func (*UnitLogsDir) ReadDirAll

func (d *UnitLogsDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

type UnitTypesDir

type UnitTypesDir struct {
	// contains filtered or unexported fields
}

UnitTypesDir is a filesystem node that lists directories which correspond to systemd unit types for which there may be journal entries.

These directories in turn list log files which map to journal entries for units of their given unit type (see UnitLogsDir)

e.g service/ssh.log => "ssh.service" logs e.g timer/some.log => "some.timer" logs

func NewUnitTypesDir

func NewUnitTypesDir(journalCache *journalcache.JournalCache) *UnitTypesDir

NewUnitTypesDir returns a new UnitTypesDir

These directories in turn list log files which map to journal entries for units of their given unit type (see UnitLogsDir)

e.g services/ssh.log corresponding to "ssh.service" logs

func (*UnitTypesDir) Attr

func (d *UnitTypesDir) Attr(ctx context.Context, attr *fuse.Attr) error

Attr populates filesystem metadata for a UnitTypesDir

func (*UnitTypesDir) Lookup

func (d *UnitTypesDir) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup looks up a node by name within a UnitTypesDir

func (*UnitTypesDir) ReadDirAll

func (d *UnitTypesDir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

ReadDirAll enumerates directory entries for a UnitTypesDir

Jump to

Keyboard shortcuts

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