Documentation ¶
Index ¶
- Variables
- func AddPrefix(ctx context.Context, prefix string) context.Context
- func Black(ctx context.Context, format string, args ...interface{})
- func Blue(ctx context.Context, format string, args ...interface{})
- func Cyan(ctx context.Context, format string, args ...interface{})
- func Error(ctx context.Context, format string, args ...interface{})
- func Green(ctx context.Context, format string, args ...interface{})
- func HasNewline(ctx context.Context) bool
- func IsHidden(ctx context.Context) bool
- func Magenta(ctx context.Context, format string, args ...interface{})
- func Prefix(ctx context.Context) string
- func Print(ctx context.Context, format string, args ...interface{})
- func Red(ctx context.Context, format string, args ...interface{})
- func White(ctx context.Context, format string, args ...interface{})
- func WithHidden(ctx context.Context, hidden bool) context.Context
- func WithNewline(ctx context.Context, nl bool) context.Context
- func WithPrefix(ctx context.Context, prefix string) context.Context
- func Yellow(ctx context.Context, format string, args ...interface{})
- type ProgressBar
Examples ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddPrefix ¶
AddPrefix returns a context with the given prefix added to end of the existing prefix
func HasNewline ¶
HasNewline returns the value of newline or the default (true)
func IsHidden ¶ added in v1.10.0
IsHidden returns true if any output should be hidden in this context
func WithHidden ¶ added in v1.10.0
WithHidden returns a context with the flag value for hidden set
func WithNewline ¶
WithNewline returns a context with the flag value for newline set
func WithPrefix ¶
WithPrefix returns a context with the given prefix set
Types ¶
type ProgressBar ¶ added in v1.10.0
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar is a gopass progress bar
Example ¶
ctx := context.Background() max := 100 pb := NewProgressBar(ctx, int64(max)) for i := 0; i < max+20; i++ { pb.Inc() time.Sleep(150 * time.Millisecond) } time.Sleep(5 * time.Second) pb.Done()
Output:
func NewProgressBar ¶ added in v1.10.0
func NewProgressBar(ctx context.Context, total int64) *ProgressBar
NewProgressBar creates a new progress bar
func (*ProgressBar) Clear ¶ added in v1.10.0
func (p *ProgressBar) Clear()
Clear removes the progress bar
func (*ProgressBar) Done ¶ added in v1.10.0
func (p *ProgressBar) Done()
Done finalizes the progress bar
func (*ProgressBar) Set ¶ added in v1.10.0
func (p *ProgressBar) Set(v int64)
Set sets an arbitrary progress
Click to show internal directories.
Click to hide internal directories.