fsutil

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) error

func FilesWithExtensions added in v0.16.0

func FilesWithExtensions(dir string, extensions []string) ([]string, error)

FilesWithExtensions returns a list of all files in directory that end in any of the extensions provided. top level only - does not recursively visit directories.

func RenameWithWindowsFallback

func RenameWithWindowsFallback(src, dst string) error

Types

type DefaultDetector added in v0.20.5

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

DefaultDetector implements Detector

func (*DefaultDetector) GetInfo added in v0.20.5

func (d *DefaultDetector) GetInfo(osReleaseContents string) OSInfo

GetInfo returns the OS distribution name and version from the contents of /etc/os-release

func (*DefaultDetector) HasSystemdFile added in v0.20.5

func (d *DefaultDetector) HasSystemdFile() bool

HasSystemdFile returns true if /etc/os-release exists with contents

func (*DefaultDetector) InfoOnce added in v0.20.5

func (d *DefaultDetector) InfoOnce(logger log.Logger)

InfoOnce logs an info message to the provided logger, but only once in the lifetime of the receiving DefaultDetector.

func (*DefaultDetector) ReadSystemdFile added in v0.20.5

func (d *DefaultDetector) ReadSystemdFile() (string, error)

ReadSystemdFile returns the contents of /etc/os-release

func (*DefaultDetector) StoredInfo added in v0.20.5

func (d *DefaultDetector) StoredInfo() *OSInfo

StoredInfo returns any OSInfo found during the last call to GetInfo

type Detector added in v0.17.0

type Detector interface {
	HasSystemdFile() bool
	ReadSystemdFile() (string, error)
	GetInfo(osReleaseContents string) OSInfo
	StoredInfo() *OSInfo
	InfoOnce(logger log.Logger)
}

type OSInfo added in v0.17.0

type OSInfo struct {
	Name    string
	Version string
}

Jump to

Keyboard shortcuts

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