Documentation ¶
Index ¶
- Variables
- func GetRPCClient(cmd *cobra.Command, targetRepo remotetypes.LocalRepo) (*client.RPCClient, error)
- func GetRemoteAddrFromRepo(repo remotetypes.LocalRepo, remoteName string) (string, int, bool)
- func GetRepoAndClient(cmd *cobra.Command, cfg *config.AppConfig, repoDir string) (remotetypes.LocalRepo, types2.Client)
- func MakePassEnvVar(appName string) string
- func MakeRepoScopedEnvVar(appName, repoName, varName string) string
- func ShowTxStatusTracker(stdout io.Writer, hash string, rpcClient types2.Client) error
- func UnlockKey(cfg *config.AppConfig, args *UnlockKeyArgs) (types.StoredKey, error)
- func WriteToPager(pagerCmd string, content io.Reader, stdOut, stdErr io.Writer)
- type PagerWriter
- type TxStatusTrackerFunc
- type UnlockKeyArgs
- type UnlockKeyFunc
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetRPCClient ¶
GetRPCClient returns an RPC client. If target repo is provided, the RPC server information will be extracted from one of the remote URLs. The target remote is set via viper's "remote.name" or "--remote" root flag.
func GetRemoteAddrFromRepo ¶
GetRemoteAddrFromRepo gets remote address from the given repo. It will return false if no (good) url was found.
func GetRepoAndClient ¶
func GetRepoAndClient(cmd *cobra.Command, cfg *config.AppConfig, repoDir string) (remotetypes.LocalRepo, types2.Client)
GetRepoAndClient opens a the repository on the current working directory and returns an RPC client.
func MakePassEnvVar ¶
MakePassEnvVar is the name of the env variable expected to contain a key's passphrase.
func MakeRepoScopedEnvVar ¶
MakeRepoScopedEnvVar returns a repo-specific env variable
func ShowTxStatusTracker ¶
ShowTxStatusTracker tracks transaction status and displays updates to stdout.
func UnlockKey ¶
UnlockKey takes a key address or index, unlocks it and returns the key. - It will using the given passphrase if set, otherwise - if the target repo is set, it will try to get it from the git config (user.passphrase). - If passphrase is still unknown, it will attempt to get it from an environment variable. - On success, args.Passphrase is updated with the passphrase used to unlock the key.
Types ¶
type PagerWriter ¶
pagerWriter describes a function for writing a specified content to a pager program
type TxStatusTrackerFunc ¶
type UnlockKeyArgs ¶
type UnlockKeyArgs struct { // KeyStoreID is the index or address of the key on the keystore KeyStoreID string // Passphrase is the passphrase to use for unlocking the key Passphrase string // TargetRepo is the target repository in the current working directory. // It's config `user.passphrase` is checked for the passphrase. TargetRepo remotetypes.LocalRepo // NoPrompt if true, will launch a prompt if passphrase was not gotten from other means NoPrompt bool // Prompt is a message to print out when launching a prompt. Prompt string Stdout io.Writer }
UnlockKeyArgs contains arguments for UnlockKey
type UnlockKeyFunc ¶
UnlockKeyFunc describes a function for unlocking a keystore key.