Documentation
¶
Index ¶
- func Debugf(s string, args ...any)
- func Debugln(s any)
- func Errorf(s string, args ...any)
- func Errorln(s any)
- func Fatalf(s string, args ...any) error
- func Fatalln(s any) error
- func FormatBytes(i int64) string
- func Infof(s string, args ...any)
- func Infoln(s any)
- func Logf(level LogLevel, s string, args ...any)
- func Logln(level LogLevel, s any)
- func NewDownloadProgress() (*DownloadProgressBar, *ProgressLogger)
- func ProgressEnabled() bool
- func SafeDebugf(s string, args ...any)
- func SafeDebugln(s any)
- func SafeLogf(level LogLevel, s string, args ...any)
- func SafeLogln(level LogLevel, s any)
- func SetErr(w io.Writer)
- func SetLogLevel(level LogLevel)
- func SetLogLevelFromString(level string) error
- func SetOut(w io.Writer)
- func SetProgressBars(style string)
- func SystemInfof(s string, args ...any)
- func SystemInfoln(s any)
- func TarProgress(total int64, tw *tar.Writer) (*ProgressTar, *ProgressLogger)
- func WrapClient(c remote.Client) remote.Client
- type DownloadProgressBar
- type LogLevel
- type LoggingClient
- type ProgressBar
- type ProgressLogger
- func (pw *ProgressLogger) Debugf(s string, args ...any)
- func (pw *ProgressLogger) Debugln(s any)
- func (pw *ProgressLogger) Infof(s string, args ...any)
- func (pw *ProgressLogger) Infoln(s any)
- func (pw *ProgressLogger) Logf(level LogLevel, s string, args ...any)
- func (pw *ProgressLogger) Logln(level LogLevel, s any)
- func (pw *ProgressLogger) Wait()
- type ProgressTar
- type PullProgress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fatalf ¶
Fatalf is the equivalent of Errorf except it returns a basic error to signal the command has failed
func Fatalln ¶
Fatalln is the equivalent of Errorln except it returns a basic error to signal the command has failed
func FormatBytes ¶
func NewDownloadProgress ¶
func NewDownloadProgress() (*DownloadProgressBar, *ProgressLogger)
func ProgressEnabled ¶
func ProgressEnabled() bool
func SafeDebugf ¶
SafeDebugf is the same as Debugf except it will only print if progress bars are disabled to avoid confusing output
func SafeDebugln ¶
func SafeDebugln(s any)
SafeDebugln is the same as Debugln except it will only print if progress bars are disabled to avoid confusing output
func SetLogLevel ¶
func SetLogLevel(level LogLevel)
func SetLogLevelFromString ¶
func SetProgressBars ¶
func SetProgressBars(style string)
func SystemInfof ¶
SystemInfof is like Infof except it logs to stderr. This should be used for system messages such as update notifications
func SystemInfoln ¶
func SystemInfoln(s any)
SystemInfoLn is like Infoln except it logs to stderr. This should be used for system messages such as update notifications
func TarProgress ¶
func TarProgress(total int64, tw *tar.Writer) (*ProgressTar, *ProgressLogger)
Types ¶
type DownloadProgressBar ¶
type DownloadProgressBar struct {
// contains filtered or unexported fields
}
func (*DownloadProgressBar) Done ¶
func (pb *DownloadProgressBar) Done()
func (*DownloadProgressBar) TrackDownload ¶
func (pb *DownloadProgressBar) TrackDownload(rc io.ReadCloser, name string, totalSize int64) io.ReadCloser
type LoggingClient ¶
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
func GenericProgressBar ¶
func GenericProgressBar(name, doneMsg string, total int64) *ProgressBar
func (*ProgressBar) Done ¶
func (b *ProgressBar) Done()
func (*ProgressBar) Increment ¶
func (b *ProgressBar) Increment()
type ProgressLogger ¶
type ProgressLogger struct {
// contains filtered or unexported fields
}
ProgressLogger allows for printing info and debug lines while a progress bar is filling, and should be used instead of the standard output functions to prevent progress bars from removing log lines. Once the progress bar is done, the Wait() method should be called.
func WrapTarget ¶
func WrapTarget(wrap oras.Target) (oras.Target, *ProgressLogger)
WrapTarget wraps an oras.Target so that calls to Push print a progress bar. If output is configured to not print progress bars, this is a no-op.
func WrapUnpackReadCloser ¶
func WrapUnpackReadCloser(size int64, rc io.ReadCloser) (io.ReadCloser, *ProgressLogger)
func (*ProgressLogger) Debugf ¶
func (pw *ProgressLogger) Debugf(s string, args ...any)
func (*ProgressLogger) Debugln ¶
func (pw *ProgressLogger) Debugln(s any)
func (*ProgressLogger) Infof ¶
func (pw *ProgressLogger) Infof(s string, args ...any)
func (*ProgressLogger) Infoln ¶
func (pw *ProgressLogger) Infoln(s any)
func (*ProgressLogger) Logln ¶
func (pw *ProgressLogger) Logln(level LogLevel, s any)
func (*ProgressLogger) Wait ¶
func (pw *ProgressLogger) Wait()
Wait will call Wait() on the underlying mpb.Progress, if present. Otherwise, this is a no-op.
type ProgressTar ¶
type ProgressTar struct {
// contains filtered or unexported fields
}
func (*ProgressTar) Close ¶
func (t *ProgressTar) Close() error
func (*ProgressTar) WriteHeader ¶
func (t *ProgressTar) WriteHeader(hdr *tar.Header) error
type PullProgress ¶
type PullProgress struct {
ProgressLogger
// contains filtered or unexported fields
}
func NewPullProgress ¶
func NewPullProgress(ctx context.Context) *PullProgress
func (*PullProgress) Done ¶
func (p *PullProgress) Done()