Documentation
¶
Index ¶
- Variables
- func BuildPlatforms()
- func CleanForLog(str string) string
- func ColorString(str string) string
- func ExecCmd(cmd string, gf entity.GitFolder) entity.CmdInfo
- func GetPlatformType(host string) string
- func GetPublicKey(host string, spinner *tea.Program) string
- func GetPublicKeyPassword(host string, spinner *tea.Program) string
- func GetRootDir() string
- func GetToken(host string, spinner *tea.Program) string
- func HasInputConfig() bool
- func IsComplete(host string) bool
- func ListGitDirectories(searchDepth int) []entity.GitFolder
- func LiteralToken(host string) (string, bool)
- func OverrideLogFile()
- func PrintBanner()
- func PrintBannerWithColor()
- func PrintBannerWithoutColor()
- func PrintMorningTable(gitFolders []entity.GitFolderWithCmdInfos)
- func PrintSeparation()
- func PrintSimpleTable(gitFolders []entity.GitFolder)
- func PrintTable(gitFolders []entity.GitFolder)
- func ReloadConfig() error
- func SetWorkDir()
- func TokenQuietly(host string) (string, bool)
- func Trace(msg string, isDebug bool)
- func TraceWarn(msg string)
- func UseConfig()
- func VisualDisplayRepo(repo string) string
- type LineWriter
- type MorningRoutine
- type Platform
- type PlatformInfo
- type Source
Constants ¶
This section is empty.
Variables ¶
var ConfiguredPlatforms = make(map[string]Platform)
Functions ¶
func BuildPlatforms ¶ added in v0.5.2
func BuildPlatforms()
func CleanForLog ¶ added in v0.5.6
func ColorString ¶ added in v0.5.6
func GetPlatformType ¶ added in v0.5.2
func GetPublicKeyPassword ¶ added in v0.5.4
func GetRootDir ¶ added in v0.6.0
func GetRootDir() string
func HasInputConfig ¶ added in v0.5.2
func HasInputConfig() bool
func IsComplete ¶ added in v0.8.0
IsComplete tells whether a platform has both the type and the token Heimdall needs to use it. A platform missing one of them is still listed, so that it can be fixed, but it cannot be used.
func ListGitDirectories ¶ added in v0.6.0
func LiteralToken ¶ added in v0.8.0
LiteralToken returns the token of a platform when it is written in the configuration file itself, which is what the migration into the keyring needs to read. It is deliberately the only way to get a secret out of the configuration without resolving it, and deliberately easy to grep for.
func OverrideLogFile ¶
func OverrideLogFile()
func PrintBanner ¶
func PrintBanner()
func PrintBannerWithColor ¶ added in v0.5.6
func PrintBannerWithColor()
func PrintBannerWithoutColor ¶ added in v0.5.6
func PrintBannerWithoutColor()
func PrintMorningTable ¶ added in v0.6.0
func PrintMorningTable(gitFolders []entity.GitFolderWithCmdInfos)
func PrintSeparation ¶
func PrintSeparation()
func PrintSimpleTable ¶ added in v0.6.0
func PrintTable ¶
func ReloadConfig ¶ added in v0.8.0
func ReloadConfig() error
ReloadConfig reads the configuration file again and builds the platforms from it, so that a credential updated while Heimdall is running is taken into account without restarting it. It writes nothing on stdout, which the TUI forbids.
func SetWorkDir ¶ added in v0.6.0
func SetWorkDir()
func TokenQuietly ¶ added in v0.8.0
TokenQuietly resolves the token of a platform without reporting anything. It is what the credential check uses, because it reports the outcome of every platform itself.
func VisualDisplayRepo ¶ added in v0.6.0
Types ¶
type LineWriter ¶ added in v0.8.0
type LineWriter struct {
// contains filtered or unexported fields
}
LineWriter turns a byte stream into whole lines handed to emit.
It splits on \r as well as on \n, because the progress of git is a sideband which redraws itself in place : "Counting objects: 43%\rCounting objects: 57%\r…". Feeding that raw to a line based output would wreck it.
It is not safe for concurrent use : one clone at a time writes to it.
func NewLineWriter ¶ added in v0.8.0
func NewLineWriter(emit func(string)) *LineWriter
NewLineWriter returns a writer handing each line it reads to emit
func (*LineWriter) Close ¶ added in v0.8.0
func (w *LineWriter) Close() error
Close hands over what was written without a line ending, as the last line of a clone often is
type MorningRoutine ¶ added in v0.6.0
var MorningRoutineConfig MorningRoutine
func BuildMorningRoutine ¶ added in v0.6.0
func BuildMorningRoutine() MorningRoutine
func GetMorningRoutine ¶ added in v0.6.0
func GetMorningRoutine() MorningRoutine
type PlatformInfo ¶ added in v0.8.0
type PlatformInfo struct {
Host string
Type string
// TokenRef is the name of the keyring entry or of the environment variable the token is read
// from. It is empty when the token is written in the configuration file, because that value is
// the token itself : use TokenLocation to display where the token comes from.
TokenRef string
TokenSource Source
PublicKey string
PassphraseRef string
PassphraseSource Source
}
PlatformInfo describes how a platform is configured. It never holds a secret : when the value is written in the configuration file, the reference is left empty and only the source says there is one, so that a PlatformInfo can be displayed and logged freely.
func Platforms ¶ added in v0.8.0
func Platforms() []PlatformInfo
Platforms lists the configured platforms, sorted by host, without exposing any secret
func (PlatformInfo) Complete ¶ added in v0.8.0
func (p PlatformInfo) Complete() bool
Complete tells whether the platform has the type and the token Heimdall needs to use it
func (PlatformInfo) PassphraseLocation ¶ added in v0.8.0
func (p PlatformInfo) PassphraseLocation() string
PassphraseLocation names where the passphrase of the ssh key is read from, safe to display
func (PlatformInfo) TokenLocation ¶ added in v0.8.0
func (p PlatformInfo) TokenLocation() string
TokenLocation names where the token is read from, in a form which is always safe to display
type Source ¶ added in v0.8.0
type Source int
Source tells where the value of a credential is read from
const ( // SourceNone : the credential is not configured at all SourceNone Source = iota // SourceLiteral : the value is written in the configuration file SourceLiteral // SourceEnv : the configuration file references an environment variable SourceEnv // SourceKeyring : the configuration file references an entry of the keyring SourceKeyring )