Documentation
¶
Index ¶
- Constants
- Variables
- func Decrypt(encryptedText string) (clearText string, err error)
- func Encrypt(clearText string) (encryptedText string, err error)
- func GetAuthors() []string
- func GetStringFromCmd(cmd string) (string, error)
- func GetStringFromEnv(envVar string) (string, error)
- func GetStringFromFile(filePath string) (string, error)
- func Hide(clearText string) (hiddenText string, err error)
- func Multipass(multipassString string) (password string, err error)
- func Reveal(hiddenText string) (clearText string, err error)
Constants ¶
const ( ProgramName = "multipass" // programName is the canonical command name used in usage and messages. Description = "A password retrieval Go library and tool" Copyright = "Copyright: (C) 2026 Alexander Kulbartsch" License = "LGPL-2.1-or-later (GNU Lesser General Public License version 2.1 or later)" Source = "https://git.sr.ht/~kulbartsch/multipass" )
Variables ¶
var Compatibility = true
Compatibility is a boolean that indicates whether plain text passwords without a protocol prefix are still supported. This is for compatibility with usual config files that have a "password" option. It is set to true by default, but can be changed by the caller of the library to false to disable this behavior.
var FirstLine = true
FirstLine is a boolean that indicates whether only the first line of the password source should be used. This is useful for commands (CMD) or files (FIL) that return multi-line output, but only the first line is relevant.
var Manual string
Manual is the embedded project README used for CLI help output.
var RecursionDepthMax = 5
RecursionDepthMax limits recursive Multipass resolution depth (for example ENR chains). This prevents stack overflows on long chains or loops. The default is 5, but applications can raise it if they need deeper chains.
var Symmetric string
Symmetric configures the key source for ENC encryption and decryption.
It accepts plain text keys and the TXT/ENV/ENR/FIL/CMD/HID protocols. ENC is explicitly rejected to avoid recursive key resolution.
var Version string
Version is the canonical version string, embedded from the VERSION file.
Functions ¶
func Encrypt ¶
Encrypt is a utility function that symmetrically encrypts a clear text password using the ENC protocol and returns an encoded VALUE payload.
func GetStringFromCmd ¶
GetStringFromCmd executes an external command and returns its output as a string.
func GetStringFromEnv ¶
func GetStringFromFile ¶
func Hide ¶
Hide is a utility function that obfuscates a clear text password using the HID protocol.
Types ¶
This section is empty.