config

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config - DO NOT EDIT

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

	// EnvRenewWarningOptOut will disable warnings normally sent when a token is due to expire
	// default value is os.Getenv("SSH_MS_RENEW_WARNING_OPTOUT")
	EnvRenewWarningOptOut 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, RenewWarningOptOut, Simulate, StoredToken, Verbose, Version, VersionCheck bool
	ConfigComment, ConfigMotd, EnvSSHDefaultUsername, EnvSSHIdentityFile,
	CustomLocalForward, EnvSSHUsername, EnvVaultAddr, NameSpace, SecretPath, Show, StoragePath, User, VaultAddr, VaultToken, VaultAPIVersion, VaultSDKVersion 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

Jump to

Keyboard shortcuts

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