Documentation ¶
Index ¶
- Variables
- func GetAlias(ctx context.Context) string
- func GetCommitMessage(ctx context.Context) string
- func GetCommitTimestamp(ctx context.Context) time.Time
- func GetEmail(ctx context.Context) string
- func GetImportFunc(ctx context.Context) store.ImportCallback
- func GetUsername(ctx context.Context) string
- func HasAlias(ctx context.Context) bool
- func HasAlwaysYes(ctx context.Context) bool
- func HasCommitMessage(ctx context.Context) bool
- func HasCommitTimestamp(ctx context.Context) bool
- func HasExportKeys(ctx context.Context) bool
- func HasForce(ctx context.Context) bool
- func HasGitCommit(ctx context.Context) bool
- func HasGitInit(ctx context.Context) bool
- func HasImportFunc(ctx context.Context) bool
- func HasInteractive(ctx context.Context) bool
- func HasNoNetwork(ctx context.Context) bool
- func HasNoPager(ctx context.Context) bool
- func HasNotifications(ctx context.Context) bool
- func HasPasswordCallback(ctx context.Context) bool
- func HasProgressCallback(ctx context.Context) bool
- func HasShowParsing(ctx context.Context) bool
- func HasShowSafeContent(ctx context.Context) bool
- func HasStdin(ctx context.Context) bool
- func HasTerminal(ctx context.Context) bool
- func HasVerbose(ctx context.Context) bool
- func IsAlwaysYes(ctx context.Context) bool
- func IsExportKeys(ctx context.Context) bool
- func IsForce(ctx context.Context) bool
- func IsGitCommit(ctx context.Context) bool
- func IsGitInit(ctx context.Context) bool
- func IsHidden(ctx context.Context) bool
- func IsInteractive(ctx context.Context) bool
- func IsNoNetwork(ctx context.Context) bool
- func IsNoPager(ctx context.Context) bool
- func IsNotifications(ctx context.Context) bool
- func IsShowParsing(ctx context.Context) bool
- func IsShowSafeContent(ctx context.Context) bool
- func IsStdin(ctx context.Context) bool
- func IsTerminal(ctx context.Context) bool
- func IsVerbose(ctx context.Context) bool
- func WithAlias(ctx context.Context, alias string) context.Context
- func WithAlwaysYes(ctx context.Context, bv bool) context.Context
- func WithCommitMessage(ctx context.Context, sv string) context.Context
- func WithCommitTimestamp(ctx context.Context, ts time.Time) context.Context
- func WithEmail(ctx context.Context, sv string) context.Context
- func WithExportKeys(ctx context.Context, d bool) context.Context
- func WithForce(ctx context.Context, bv bool) context.Context
- func WithGitCommit(ctx context.Context, bv bool) context.Context
- func WithGitInit(ctx context.Context, bv bool) context.Context
- func WithGlobalFlags(c *cli.Context) context.Context
- func WithHidden(ctx context.Context, hidden bool) context.Context
- func WithImportFunc(ctx context.Context, imf store.ImportCallback) context.Context
- func WithInteractive(ctx context.Context, isInteractive bool) context.Context
- func WithNoNetwork(ctx context.Context, bv bool) context.Context
- func WithNoPager(ctx context.Context, bv bool) context.Context
- func WithNotifications(ctx context.Context, verbose bool) context.Context
- func WithPasswordCallback(ctx context.Context, cb PasswordCallback) context.Context
- func WithProgressCallback(ctx context.Context, cb ProgressCallback) context.Context
- func WithShowParsing(ctx context.Context, bv bool) context.Context
- func WithShowSafeContent(ctx context.Context, bv bool) context.Context
- func WithStdin(ctx context.Context, isStdin bool) context.Context
- func WithTerminal(ctx context.Context, isTerm bool) context.Context
- func WithUsername(ctx context.Context, sv string) context.Context
- func WithVerbose(ctx context.Context, verbose bool) context.Context
- type PasswordCallback
- type ProgressCallback
Constants ¶
This section is empty.
Variables ¶
var ErrNoCallback = fmt.Errorf("no callback")
ErrNoCallback is returned when no callback is set in the context.
Functions ¶
func GetAlias ¶ added in v1.8.4
GetAlias returns an alias if it has been set or an empty string otherwise.
func GetCommitMessage ¶ added in v1.14.4
GetCommitMessage returns the set commit message or an empty string.
func GetCommitTimestamp ¶ added in v1.14.4
GetCommitTimestamp returns the commit timestamp from the context if set or the default (now) otherwise.
func GetImportFunc ¶ added in v1.14.4
func GetImportFunc(ctx context.Context) store.ImportCallback
GetImportFunc will return the import callback or a default one returning true Note: will never return nil.
func GetUsername ¶ added in v1.14.4
GetUsername returns the username from the context.
func HasAlwaysYes ¶
HasAlwaysYes returns true if a value for AlwaysYes has been set in this context.
func HasCommitMessage ¶ added in v1.14.4
HasCommitMessage returns true if the commit message was set.
func HasCommitTimestamp ¶ added in v1.14.4
HasCommitTimestamp returns true if the value for the commit timestamp was set in the context.
func HasExportKeys ¶ added in v1.14.4
HasExportKeys returns true if Export Keys was set in the context.
func HasGitCommit ¶
HasGitCommit returns true if a value for GitCommit has been set in this context.
func HasGitInit ¶ added in v1.8.5
HasGitInit returns true if the git init flag was set.
func HasImportFunc ¶ added in v1.14.4
HasImportFunc returns true if a value for import func has been set in this context.
func HasInteractive ¶
HasInteractive returns true if a value for Interactive has been set in this context.
func HasNoNetwork ¶ added in v1.14.4
HasNoNetwork returns true if no network was set.
func HasNoPager ¶
HasNoPager returns true if a value for NoPager has been set in this context.
func HasNotifications ¶
HasNotifications returns true if a value for Notifications has been set in this context.
func HasPasswordCallback ¶ added in v1.14.4
HasPasswordCallback returns true if a password callback was set in the context.
func HasProgressCallback ¶ added in v1.8.2
HasProgressCallback returns true if a ProgressCallback has been set.
func HasShowParsing ¶ added in v1.14.4
HasShowParsing returns true if a value for ShowParsing has been set in this context.
func HasShowSafeContent ¶
HasShowSafeContent returns true if a value for ShowSafeContent has been set in this context.
func HasTerminal ¶
HasTerminal returns true if a value for Terminal has been set in this context.
func HasVerbose ¶
HasVerbose returns true if a value for Verbose has been set in this context.
func IsAlwaysYes ¶
IsAlwaysYes returns the value of always yes or the default (false).
func IsExportKeys ¶ added in v1.14.4
IsExportKeys returns the value of export keys or the default (true).
func IsGitCommit ¶
IsGitCommit returns the value of git commit or the default (true).
func IsGitInit ¶ added in v1.8.5
IsGitInit returns the value of the git init flag or ture if none was set.
func IsHidden ¶ added in v1.14.4
IsHidden returns true if any output should be hidden in this context.
func IsInteractive ¶
IsInteractive returns the value of interactive or the default (true).
func IsNoNetwork ¶ added in v1.14.4
IsNoNetwork returns the value of no network or false.
func IsNotifications ¶
IsNotifications returns the value of Notifications or the default (true).
func IsShowParsing ¶ added in v1.14.4
IsShowParsing returns the value of ShowParsing or the default (true).
func IsShowSafeContent ¶
IsShowSafeContent returns the value of ShowSafeContent or the default (false).
func IsStdin ¶
IsStdin returns the value of stdin, i.e. if it's true some data is being piped to stdin. If not set it returns the default value (false).
func IsTerminal ¶
IsTerminal returns the value of terminal or the default (true).
func WithAlwaysYes ¶
WithAlwaysYes returns a context with the value of always yes set.
func WithCommitMessage ¶ added in v1.14.4
WithCommitMessage returns a context with a commit message set.
func WithCommitTimestamp ¶ added in v1.14.4
WithCommitTimestamp returns a context with the value for the commit timestamp set.
func WithExportKeys ¶ added in v1.14.4
WithExportKeys returns a context with the value for export keys set.
func WithGitCommit ¶
WithGitCommit returns a context with the value of git commit set.
func WithGitInit ¶ added in v1.8.5
WithGitInit returns a context with the value for the git init flag set.
func WithGlobalFlags ¶ added in v1.14.4
WithGlobalFlags parses any global flags from the cli context and returns a regular context.
func WithHidden ¶ added in v1.14.4
WithHidden returns a context with the flag value for hidden set.
func WithImportFunc ¶ added in v1.14.4
WithImportFunc will return a context with the import callback set.
func WithInteractive ¶
WithInteractive returns a context with an explicit value for interactive.
func WithNoNetwork ¶ added in v1.14.4
WithNoNetwork returns a context with the value of no network set.
func WithNoPager ¶
WithNoPager returns a context with the value for pager set.
func WithNotifications ¶
WithNotifications returns a context with the value for Notifications set.
func WithPasswordCallback ¶ added in v1.14.4
func WithPasswordCallback(ctx context.Context, cb PasswordCallback) context.Context
WithPasswordCallback returns a context with the password callback set.
func WithProgressCallback ¶ added in v1.8.2
func WithProgressCallback(ctx context.Context, cb ProgressCallback) context.Context
WithProgressCallback returns a context with the value of ProgressCallback set.
func WithShowParsing ¶ added in v1.14.4
WithShowParsing returns a context with the value for ShowParsing set.
func WithShowSafeContent ¶
WithShowSafeContent returns a context with the value for ShowSafeContent set.
func WithStdin ¶
WithStdin returns a context with the value for Stdin set. If true some input is available on Stdin (e.g. something is being piped into it).
func WithTerminal ¶
WithTerminal returns a context with an explicit value for terminal.
func WithUsername ¶ added in v1.14.4
WithUsername returns a context with the username set in the context.
Types ¶
type PasswordCallback ¶ added in v1.14.4
PasswordCallback is a password prompt callback.
func GetPasswordCallback ¶ added in v1.14.4
func GetPasswordCallback(ctx context.Context) PasswordCallback
GetPasswordCallback returns the password callback or a default (which always fails).
type ProgressCallback ¶ added in v1.8.2
type ProgressCallback func()
ProgressCallback is a callback for updateing progress.
func GetProgressCallback ¶ added in v1.8.2
func GetProgressCallback(ctx context.Context) ProgressCallback
GetProgressCallback return the set progress callback or a default one. It never returns nil.