Documentation
¶
Overview ¶
Package config defines the application's configuration structure.
Index ¶
Constants ¶
View Source
const (
DefaultSelectTargetCommand = "ssh-agent-mux-select"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigFilePath ¶ added in v0.6.0
func DefineAndBindFlags ¶
DefineAndBindFlags defines the application's command-line flags on the provided FlagSet and binds them to Viper configuration keys.
Parameters:
- fs: The pflag.FlagSet instance on which to define the flags.
Returns:
- error: An error if any flag binding operation fails.
func LoadViperConfig ¶
func ResolveConfigFilePath ¶ added in v0.6.0
Types ¶
type AppConfig ¶
type AppConfig struct {
// Listen is the socket path or address for the multiplexer to listen on.
// If empty, "<directory of ConfigFilePathUsed or current dir>/agent.sock" is used.
Listen string `toml:"listen"`
// Targets is a list of paths to target SSH agents to proxy for read-only operations.
Targets []string `toml:"targets"`
// AddTargets is a list of paths to target SSH agents that can handle adding keys via ssh-add.
AddTargets []string `toml:"add_targets"`
// SelectTargetCommand is the command to execute to select a target agent
// when multiple AddTargets are specified and an ssh-add operation occurs.
SelectTargetCommand string `toml:"select_target_command"`
// Debug enables debug logging.
Debug bool `toml:"debug"`
// ConfigFilePathUsed stores the path of the configuration file that was loaded.
// This will be empty if no configuration file was used.
ConfigFilePathUsed string `toml:"-"`
}
AppConfig holds the application's configuration values, typically populated from command-line flags and a configuration file.
func DefaultAppConfig ¶ added in v0.6.0
func DefaultAppConfig() *AppConfig
func GetAppConfig ¶
GetAppConfig populates and returns an AppConfig struct from a Viper instance. This function should be called *after* pflag.Parse() has been executed, so that Viper reflects any command-line overrides.
Parameters:
- v: The Viper instance, which has been updated by parsed command-line flags.
- configFileUsedPath: The path of the configuration file that was loaded, if any.
Returns:
- *AppConfig: The populated application configuration.
func (*AppConfig) MarshalZerologObject ¶
MarshalZerologObject implements zerolog.LogObjectMarshaler.
Click to show internal directories.
Click to hide internal directories.