Documentation
¶
Index ¶
- Constants
- func NewReader(r io.Reader, updates chan<- v1.Update) io.Reader
- func PullMsg(update v1.Update) string
- func PushMsg(update v1.Update) string
- func WriteError(w io.Writer, message string) error
- func WriteProgress(w io.Writer, msg string, imageSize, layerSize, current uint64, layerID string) error
- func WriteSuccess(w io.Writer, message string) error
- type Layer
- type Message
- type Reader
- type Reporter
Constants ¶
View Source
const MinBytesForUpdate = 1024 * 1024 // 1MB
MinBytesForUpdate defines the minimum number of bytes that need to be transferred before sending a progress update
View Source
const UpdateInterval = 100 * time.Millisecond
UpdateInterval defines how often progress updates should be sent
Variables ¶
This section is empty.
Functions ¶
func NewReader ¶
NewReader returns a reader that reports progress to the given channel while reading.
func WriteError ¶
WriteError writes an error message
Types ¶
type Message ¶
type Message struct {
Type string `json:"type"` // "progress", "success", or "error"
Message string `json:"message"` // Deprecated: the message should be defined by clients based on Message.Total and Message.Layer
Total uint64 `json:"total"`
Pulled uint64 `json:"pulled"` // Deprecated: use Layer.Current
Layer Layer `json:"layer"` // Current layer information
}
Message represents a structured message for progress reporting
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
func NewProgressReporter ¶
Click to show internal directories.
Click to hide internal directories.