Documentation
¶
Index ¶
- Variables
- func GetHomeDir(isRoot bool, user *user.User) (string, error)
- func GetLdaBinaryPath() (string, error)
- func GetLdaDir(homeDir string, user *user.User) (string, error)
- func GetShell() (map[ShellType]string, error)
- func GetUserConfig() (*user.User, bool, error)
- func SetupConfig(ldaDir string, user *user.User)
- func SetupSysConfig()
- type Config
- type OSType
- type ShellType
- type SystemConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "0.0.0" Commit = "xxx" Branch = "undefined" )
View Source
var (
SupportedShells = []string{"/bin/bash", "/bin/zsh", "/bin/fish"}
)
Functions ¶
func GetHomeDir ¶
GetHomeDir returns the user home directory
func GetLdaBinaryPath ¶
GetLdaBinaryPath returns the path to the lda binary
func GetUserConfig ¶
GetUserConfig returns the user configuration
func SetupConfig ¶
SetupConfig initialize the configuration instance
func SetupSysConfig ¶
func SetupSysConfig()
SetupSysConfig initialize the system configuration instance
Types ¶
type Config ¶
type Config struct {
// Debug persists the debug mode, so we don't have to pass it via flag, flag will override this
Debug bool `mapstructure:"debug"`
// ProcessInterval interval in seconds to tick and collect general information about processes - defaults to 120 seconds
ProcessInterval int `mapstructure:"process_interval"`
// CommandInterval interval in which to collect process information when command has been executed - defaults to 1 second
CommandInterval int `mapstructure:"command_interval"`
// CommandIntervalMultiplier multiplier for the command interval - defaults to 3 (cubic)
CommandIntervalMultiplier float64 `mapstructure:"command_interval_multiplier"`
// MaxDuration max duration that collection can run for
MaxDuration int `mapstructure:"max_duration"`
// MaxConcurrentCommands maximum number of concurrent commands to collect - defaults to 20
MaxConcurrentCommands int `mapstructure:"max_concurrent_commands"`
// RemoteCollection flag to enable remote collection - defaults to false
RemoteCollection bool `mapstructure:"remote_collection"`
// ServerAddress host to connect to for remote collection
ServerAddress string `mapstructure:"server_host"`
// SecureConnection flag to enable secure connection to the server
SecureConnection bool `mapstructure:"secure_connection"`
// CertFile path to the certificate file
CertFile string `mapstructure:"cert_file"`
// ExcludeRegex regular expression to exclude processes from collection
ExcludeRegex string `mapstructure:"exclude_regex"`
// ProcessCollectionType type of process collection to use, ps or psutil
ProcessCollectionType string `mapstructure:"process_collection_type"`
// TeamID is the team identifier for the workspace
TeamID string `mapstructure:"team_id"`
// UserID is the user identifier for the workspace
UserID string `mapstructure:"user_id"`
// UserEmail is the user identifier for the workspace
UserEmail string `mapstructure:"user_email"`
// WorkspaceID is the workspace identifier
WorkspaceID string `mapstructure:"workspace_id"`
}
Config config definition
var AppConfig *Config
AppConfig is the global configuration instance
type ShellType ¶
type ShellType int
ShellType is the type of the shell that is supported
func GetShellType ¶
type SystemConfig ¶
type SystemConfig struct {
// Out is the output writer for printing information
Out io.Writer
// ErrOut is the error output writer for printing errors
ErrOut io.Writer
}
SystemConfig Configuration that is not available via the configuration file
var SysConfig *SystemConfig
SysConfig is the global system configuration instance
Click to show internal directories.
Click to hide internal directories.