sys

package
v0.0.0-...-d2438c5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachePath

func CachePath(path ...string) string

CachePath returns the directory that THERM should its cache under. If THERM_DIR is set, this path is $THERM_DIR/cache, otherwise it is /var/cache/therm.

func LogPath

func LogPath(path ...string) string

LogPath returns the directory that THERM should put logs under. If THERM_DIR is set, this path is $THERM_DIR/logs, otherwise it is /var/log/therm.

func VarPath

func VarPath(path ...string) string

VarPath returns the provided path elements joined by a slash and appended to the end of $THERM_DIR, which defaults to /var/lib/therm.

Types

type OS

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

OS is a high-level facade for accessing all operating-system level functionality that therm uses.

func DefaultOS

func DefaultOS() *OS

DefaultOS returns a fresh uninitialized OS instance with default values.

func New

func New(varDir, cacheDir, logDir string) *OS

New creates a new OS with the various directories.

func (*OS) CacheDir

func (s *OS) CacheDir() string

CacheDir represents the Cache directory (e.g. /var/cache/therm/).

func (*OS) GlobalDatabaseDir

func (s *OS) GlobalDatabaseDir() string

GlobalDatabaseDir returns the path of the global database directory.

func (*OS) GlobalDatabasePath

func (s *OS) GlobalDatabasePath() string

GlobalDatabasePath returns the path of the global database SQLite file managed by dqlite.

func (*OS) HostNames

func (s *OS) HostNames() ([]string, error)

HostNames will generate a list of names for which the certificate will be valid. This will include the hostname and ip address

func (*OS) Hostname

func (s *OS) Hostname() (string, error)

Hostname returns the host name reported by the kernel.

func (*OS) Init

func (s *OS) Init(fileSystem fsys.FileSystem) error

Init our internal data structures.

func (*OS) LocalDatabasePath

func (s *OS) LocalDatabasePath() string

LocalDatabasePath returns the path of the local database file.

func (*OS) LocalNoncePath

func (s *OS) LocalNoncePath() string

LocalNoncePath returns the path of the nonce for the daemon

func (*OS) LogDir

func (s *OS) LogDir() string

LogDir represents the Log directory (e.g. /var/log/therm).

func (*OS) User

func (s *OS) User() (*user.User, error)

User returns the current user.

func (*OS) VarDir

func (s *OS) VarDir() string

VarDir represents the Data directory (e.g. /var/lib/therm/).

Jump to

Keyboard shortcuts

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