gopass: github.com/justwatchcom/gopass/pkg/ctxutil Index | Files

package ctxutil

import "github.com/justwatchcom/gopass/pkg/ctxutil"

Index

Package Files

ctxutil.go helper.go

func GetAlias Uses

func GetAlias(ctx context.Context) string

GetAlias returns an alias if it has been set or an empty string otherwise.

func GetClipTimeout Uses

func GetClipTimeout(ctx context.Context) int

GetClipTimeout returns the value of clip timeout or the default (45)

func GetCommitMessage Uses

func GetCommitMessage(ctx context.Context) string

GetCommitMessage returns the set commit message or an empty string

func GetConcurrency Uses

func GetConcurrency(ctx context.Context) int

GetConcurrency returns the value of concurrent threads or the default (1)

func GetEmail Uses

func GetEmail(ctx context.Context) string

GetEmail returns the email from the context

func GetImportFunc Uses

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 Uses

func GetUsername(ctx context.Context) string

GetUsername returns the username from the context

func HasAlias Uses

func HasAlias(ctx context.Context) bool

HasAlias returns true if a value for alias has been set.

func HasAlwaysYes Uses

func HasAlwaysYes(ctx context.Context) bool

HasAlwaysYes returns true if a value for AlwaysYes has been set in this context

func HasAutoClip Uses

func HasAutoClip(ctx context.Context) bool

HasAutoClip returns true if a value for AutoClip has been set in this context

func HasClipTimeout Uses

func HasClipTimeout(ctx context.Context) bool

HasClipTimeout returns true if a value for ClipTimeout has been set in this context

func HasColor Uses

func HasColor(ctx context.Context) bool

HasColor returns true if a value for Color has been set in this context

func HasCommitMessage Uses

func HasCommitMessage(ctx context.Context) bool

HasCommitMessage returns true if the commit message was set

func HasConcurrency Uses

func HasConcurrency(ctx context.Context) bool

HasConcurrency returns true if a value for Concurrency has been set in this context and is bigger than 1 since if it is equal to 1, we are not working concurrently.

func HasConfirm Uses

func HasConfirm(ctx context.Context) bool

HasConfirm returns true if a value for Confirm has been set in this context

func HasEditRecipients Uses

func HasEditRecipients(ctx context.Context) bool

HasEditRecipients returns true if a value for EditRecipients has been set in this context

func HasExportKeys Uses

func HasExportKeys(ctx context.Context) bool

HasExportKeys returns true if Export Keys was set in the context.

func HasForce Uses

func HasForce(ctx context.Context) bool

HasForce returns true if the context has the force flag set

func HasFuzzySearch Uses

func HasFuzzySearch(ctx context.Context) bool

HasFuzzySearch returns true if a value for FuzzySearch has been set in this context

func HasGitCommit Uses

func HasGitCommit(ctx context.Context) bool

HasGitCommit returns true if a value for GitCommit has been set in this context

func HasGitInit Uses

func HasGitInit(ctx context.Context) bool

HasGitInit returns true if the git init flag was set.

func HasImportFunc Uses

func HasImportFunc(ctx context.Context) bool

HasImportFunc returns true if a value for import func has been set in this context

func HasInteractive Uses

func HasInteractive(ctx context.Context) bool

HasInteractive returns true if a value for Interactive has been set in this context

func HasNoColor Uses

func HasNoColor(ctx context.Context) bool

HasNoColor returns true if a value for NoColor has been set in this context

func HasNoNetwork Uses

func HasNoNetwork(ctx context.Context) bool

HasNoNetwork returns true if no network was set

func HasNoPager Uses

func HasNoPager(ctx context.Context) bool

HasNoPager returns true if a value for NoPager has been set in this context

func HasNotifications Uses

func HasNotifications(ctx context.Context) bool

HasNotifications returns true if a value for Notifications has been set in this context

func HasPasswordCallback Uses

func HasPasswordCallback(ctx context.Context) bool

HasPasswordCallback returns true if a password callback was set in the context

func HasProgressCallback Uses

func HasProgressCallback(ctx context.Context) bool

HasProgressCallback returns true if a ProgressCallback has been set

func HasShowSafeContent Uses

func HasShowSafeContent(ctx context.Context) bool

HasShowSafeContent returns true if a value for ShowSafeContent has been set in this context

func HasStdin Uses

func HasStdin(ctx context.Context) bool

HasStdin returns true if a value for Stdin has been set in this context

func HasTerminal Uses

func HasTerminal(ctx context.Context) bool

HasTerminal returns true if a value for Terminal has been set in this context

func HasVerbose Uses

func HasVerbose(ctx context.Context) bool

HasVerbose returns true if a value for Verbose has been set in this context

func IsAlwaysYes Uses

func IsAlwaysYes(ctx context.Context) bool

IsAlwaysYes returns the value of always yes or the default (false)

func IsAutoClip Uses

func IsAutoClip(ctx context.Context) bool

IsAutoClip returns the value of AutoClip or the default (true)

func IsColor Uses

func IsColor(ctx context.Context) bool

IsColor returns the value of color or the default (true)

func IsConfirm Uses

func IsConfirm(ctx context.Context) bool

IsConfirm returns the value of ask for more or the default (false)

func IsEditRecipients Uses

func IsEditRecipients(ctx context.Context) bool

IsEditRecipients returns the value of EditRecipients or the default (false)

func IsExportKeys Uses

func IsExportKeys(ctx context.Context) bool

IsExportKeys returns the value of export keys or the default (true).

func IsForce Uses

func IsForce(ctx context.Context) bool

IsForce returns the force flag value of the default (false)

func IsFuzzySearch Uses

func IsFuzzySearch(ctx context.Context) bool

IsFuzzySearch return the value of fuzzy search or the default (true)

func IsGitCommit Uses

func IsGitCommit(ctx context.Context) bool

IsGitCommit returns the value of git commit or the default (true)

func IsGitInit Uses

func IsGitInit(ctx context.Context) bool

IsGitInit returns the value of the git init flag or ture if none was set.

func IsInteractive Uses

func IsInteractive(ctx context.Context) bool

IsInteractive returns the value of interactive or the default (true)

func IsNoColor Uses

func IsNoColor(ctx context.Context) bool

IsNoColor returns the value of ask for more or the default (false)

func IsNoNetwork Uses

func IsNoNetwork(ctx context.Context) bool

IsNoNetwork returns the value of no network or false

func IsNoPager Uses

func IsNoPager(ctx context.Context) bool

IsNoPager returns the value of ask for more or the default (false)

func IsNotifications Uses

func IsNotifications(ctx context.Context) bool

IsNotifications returns the value of Notifications or the default (true)

func IsShowSafeContent Uses

func IsShowSafeContent(ctx context.Context) bool

IsShowSafeContent returns the value of ShowSafeContent or the default (false)

func IsStdin Uses

func IsStdin(ctx context.Context) bool

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 Uses

func IsTerminal(ctx context.Context) bool

IsTerminal returns the value of terminal or the default (true)

func IsVerbose Uses

func IsVerbose(ctx context.Context) bool

IsVerbose returns the value of verbose or the default (false)

func WithAlias Uses

func WithAlias(ctx context.Context, alias string) context.Context

WithAlias returns an context with the alias set.

func WithAlwaysYes Uses

func WithAlwaysYes(ctx context.Context, bv bool) context.Context

WithAlwaysYes returns a context with the value of always yes set

func WithAutoClip Uses

func WithAutoClip(ctx context.Context, bv bool) context.Context

WithAutoClip returns a context with the value for AutoClip set

func WithClipTimeout Uses

func WithClipTimeout(ctx context.Context, to int) context.Context

WithClipTimeout returns a context with the value for clip timeout set

func WithColor Uses

func WithColor(ctx context.Context, color bool) context.Context

WithColor returns a context with an explicit value for color

func WithCommitMessage Uses

func WithCommitMessage(ctx context.Context, sv string) context.Context

WithCommitMessage returns a context with a commit message set

func WithConcurrency Uses

func WithConcurrency(ctx context.Context, to int) context.Context

WithConcurrency returns a context with the value for clip timeout set

func WithConfirm Uses

func WithConfirm(ctx context.Context, bv bool) context.Context

WithConfirm returns a context with the value for ask for more set

func WithEditRecipients Uses

func WithEditRecipients(ctx context.Context, bv bool) context.Context

WithEditRecipients returns a context with the value for EditRecipients set

func WithEmail Uses

func WithEmail(ctx context.Context, sv string) context.Context

WithEmail returns a context with the email set in the context

func WithExportKeys Uses

func WithExportKeys(ctx context.Context, d bool) context.Context

WithExportKeys returns a context with the value for export keys set.

func WithForce Uses

func WithForce(ctx context.Context, bv bool) context.Context

WithForce returns a context with the force flag set

func WithFuzzySearch Uses

func WithFuzzySearch(ctx context.Context, fuzzy bool) context.Context

WithFuzzySearch returns a context with the value for fuzzy search set

func WithGitCommit Uses

func WithGitCommit(ctx context.Context, bv bool) context.Context

WithGitCommit returns a context with the value of git commit set

func WithGitInit Uses

func WithGitInit(ctx context.Context, bv bool) context.Context

WithGitInit returns a context with the value for the git init flag set.

func WithGlobalFlags Uses

func WithGlobalFlags(c *cli.Context) context.Context

WithGlobalFlags parses any global flags from the cli context and returns a regular context

func WithImportFunc Uses

func WithImportFunc(ctx context.Context, imf store.ImportCallback) context.Context

WithImportFunc will return a context with the import callback set

func WithInteractive Uses

func WithInteractive(ctx context.Context, isInteractive bool) context.Context

WithInteractive returns a context with an explicit value for interactive

func WithNoColor Uses

func WithNoColor(ctx context.Context, bv bool) context.Context

WithNoColor returns a context with the value for ask for more set

func WithNoNetwork Uses

func WithNoNetwork(ctx context.Context, bv bool) context.Context

WithNoNetwork returns a context with the value of no network set

func WithNoPager Uses

func WithNoPager(ctx context.Context, bv bool) context.Context

WithNoPager returns a context with the value for ask for more set

func WithNotifications Uses

func WithNotifications(ctx context.Context, verbose bool) context.Context

WithNotifications returns a context with the value for Notifications set

func WithPasswordCallback Uses

func WithPasswordCallback(ctx context.Context, cb PasswordCallback) context.Context

WithPasswordCallback returns a context with the password callback set

func WithProgressCallback Uses

func WithProgressCallback(ctx context.Context, cb ProgressCallback) context.Context

WithProgressCallback returns a context with the value of ProgressCallback set

func WithShowSafeContent Uses

func WithShowSafeContent(ctx context.Context, bv bool) context.Context

WithShowSafeContent returns a context with the value for ShowSafeContent set

func WithStdin Uses

func WithStdin(ctx context.Context, isStdin bool) context.Context

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 Uses

func WithTerminal(ctx context.Context, isTerm bool) context.Context

WithTerminal returns a context with an explicit value for terminal

func WithUsername Uses

func WithUsername(ctx context.Context, sv string) context.Context

WithUsername returns a context with the username set in the context

func WithVerbose Uses

func WithVerbose(ctx context.Context, verbose bool) context.Context

WithVerbose returns a context with the value for verbose set

type PasswordCallback Uses

type PasswordCallback func(string) ([]byte, error)

PasswordCallback is a password prompt callback

func GetPasswordCallback Uses

func GetPasswordCallback(ctx context.Context) PasswordCallback

GetPasswordCallback returns the password callback or a default (which always fails)

type ProgressCallback Uses

type ProgressCallback func()

ProgressCallback is a callback for updateing progress

func GetProgressCallback Uses

func GetProgressCallback(ctx context.Context) ProgressCallback

GetProgressCallback return the set progress callback or a default one. It never returns nil

Package ctxutil imports 4 packages (graph) and is imported by 7 packages. Updated 2020-07-03. Refresh now. Tools for package owners.