Documentation ¶
Index ¶
- Constants
- func GetSystemPackages(info OS) (packages []storage.SystemPackage)
- func HasInterface(addr string) error
- func NetworkInterfaces() (result []storage.NetworkInterface, err error)
- func New() (*storage.SystemV2, error)
- func ResolvFromFile(filename string) (*storage.ResolvConf, error)
- func ResolvFromReader(rdr io.Reader) (*storage.ResolvConf, error)
- type FilesystemInfo
- type OS
- type User
Constants ¶
const (
// PackageLVM refers to logical volume management facilities on Linux
PackageLVM = "lvm2"
)
const RedHat = "rhel"
RedHat identifies a RedHat Enterprise Linux system or one of its descent
Variables ¶
This section is empty.
Functions ¶
func GetSystemPackages ¶
func GetSystemPackages(info OS) (packages []storage.SystemPackage)
GetSystemPackages queries the system for a set of installed packages
func HasInterface ¶
HasInterface returns nil if the machine the method executes on has the specified network interface
func NetworkInterfaces ¶
func NetworkInterfaces() (result []storage.NetworkInterface, err error)
NetworkInterfaces returns the list of all network interfaces with IPv4 addresses on the host
func ResolvFromFile ¶
func ResolvFromFile(filename string) (*storage.ResolvConf, error)
ResolvFromFile reads the given resolv.conf file
func ResolvFromReader ¶
func ResolvFromReader(rdr io.Reader) (*storage.ResolvConf, error)
ResolvFromReader reads the given resolv.conf as an io.Reader
Types ¶
type FilesystemInfo ¶
type FilesystemInfo struct { // Filesystem describes a filesystem on host Filesystem storage.Filesystem // Usage is a usage information (total, free bytes) Usage storage.FilesystemUsage }
FilesystemInfo groups a filesystem and usage statistics
func FilesystemForDir ¶
func FilesystemForDir(system storage.System, dirName string) (*FilesystemInfo, error)
FilesystemForDir returns information about the file system where the directory dirName is mounted. If dirName is not explicitly mounted, the function will return filesystem information about one of its parent directories.
func (FilesystemInfo) FreeBytes ¶
func (r FilesystemInfo) FreeBytes() uint64
FreeBytes reports free disk space in KiB (kibibits or 1024 bits)
func (FilesystemInfo) TotalBytes ¶
func (r FilesystemInfo) TotalBytes() uint64
TotalBytes reports usage in KiB (kibibits or 1024 bits)
type OS ¶
OS aliases operating system info
type User ¶
type User struct { // Name is the user name Name string `json:"name"` // UID is user id UID int `json:"uid"` // GID is group id GID int `json:"gid"` }
User describes a system user
func DefaultServiceUser ¶
func DefaultServiceUser() *User
DefaultServiceUser returns the default service user
func LookupUserByName ¶
LookupUserByName finds a user by name
func LookupUserByUID ¶
LookupUserByUID finds a user by ID
func NewUser ¶
NewUser creates a new user with the specified name and group.
If group ID has been specified, the group is created with the given ID. If user ID has been specified, the user is created with the given ID
func UserFromOSUser ¶
UserFromOSUser returns a new user from the specified storage user