config

package
Version: v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatJSON will be used to indicate a JSON file
	FormatJSON = uint(2)
	// FormatText will be used to indicate a text file, or when an unknown mimetype is found
	FormatText = uint(1)
	// FormatUnknown will be used to indicate a problem
	FormatUnknown = uint(0)
)

Variables

View Source
var (

	// EnvBasePath is the parent location used to prefix storage paths,
	// default value is filepath.Join(os.Getenv("HOME"), ".ssh", "cache")
	EnvBasePath string

	// EnvSSHDefaultUsername sets the default used in connections,
	// default value is os.Getenv("USER")
	EnvSSHDefaultUsername string

	// EnvSSHUsername is used to authenticate with SSH
	EnvSSHUsername = "SSH_MS_USERNAME"

	// EnvSSHIdentityFile is used for SSH authentication,
	// default value is filepath.Join("~", ".ssh", "id_ed25519")
	EnvSSHIdentityFile string

	// EnvVaultAddr is the default location for Vault,
	// default value is os.Getenv(vaultApi.EnvVaultAddress)
	EnvVaultAddr string

	// SecretPath is the location used for connection manangement
	SecretPath = "secret/ssh_ms"
)

Functions

func GetFileType

func GetFileType(fh *os.File) (uint, error)

GetFileType will return the mimetype of a file fh : file handle

func NormalizePath added in v1.2.2

func NormalizePath(path string) string

NormalizePath will handle the shell expansion of tilde

Types

type Settings

type Settings struct {
	LogLevel                                                     logrus.Level
	Debug, Simulate, StoredToken, Verbose, Version, VersionCheck bool
	ConfigComment, ConfigMotd, EnvSSHDefaultUsername, EnvSSHIdentityFile,
	CustomLocalForward, EnvSSHUsername, EnvVaultAddr, SecretPath, Show, StoragePath, User, VaultAddr, VaultToken, VaultVersion string
}

Settings contains the configuration details

func GetConfig

func GetConfig() *Settings

GetConfig returns an instance of Settings ensuring that only one instance is ever returned

func (*Settings) ToJSON

func (s *Settings) ToJSON() string

ToJSON returns the config in JSON format

Source Files

Jump to

Keyboard shortcuts

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