paraprogress

package
v0.4.1-73-g22cdef1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2023 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file expect in compliance with the License.

Index

Constants

View Source
const (
	INDENTS = 4
	LOGLEN  = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ParaProgress

type ParaProgress struct {
	// contains filtered or unexported fields
}

func NewParaProgress

func NewParaProgress(ctx context.Context, processes []*Process, opts ...ParaProgressOption) (*ParaProgress, error)

func (ParaProgress) Init

func (md ParaProgress) Init() tea.Cmd

func (*ParaProgress) Start

func (pd *ParaProgress) Start() error

func (*ParaProgress) Update

func (md *ParaProgress) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ParaProgress) View

func (md ParaProgress) View() string

type ParaProgressOption

type ParaProgressOption func(md *ParaProgress) error

func IsParallel

func IsParallel(parallel bool) ParaProgressOption

func WithFailFast

func WithFailFast(failFast bool) ParaProgressOption

func WithRenderer

func WithRenderer(norender bool) ParaProgressOption

type Process

type Process struct {
	Name      string
	NameWidth int
	Status    ProcessStatus
	// contains filtered or unexported fields
}

Process ...

func NewProcess

func NewProcess(name string, processFunc func(context.Context, func(float64)) error) *Process

func (*Process) Init

func (p *Process) Init() tea.Cmd

func (*Process) Start

func (p *Process) Start() tea.Cmd

func (*Process) Update

func (d *Process) Update(msg tea.Msg) (*Process, tea.Cmd)

func (Process) View

func (p Process) View() string

func (*Process) Write

func (p *Process) Write(b []byte) (int, error)

Write implements `io.Writer` so we can correctly direct the output from the process to an inline fancy logger

type ProcessStatus

type ProcessStatus uint
const (
	StatusPending ProcessStatus = iota
	StatusRunning
	StatusFailed
	StatusSuccess
)

type ProgressMsg

type ProgressMsg struct {
	ID int
	// contains filtered or unexported fields
}

ProgressMsg is sent when an update in the progress percentage occurs.

type StatusMsg

type StatusMsg struct {
	ID int
	// contains filtered or unexported fields
}

StatusMsg is sent when the stopwatch should start or stop.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL