Documentation
¶
Index ¶
- Constants
- type CommonError
- type Context
- func (c *Context) Error(message string)
- func (c *Context) Log(message string)
- func (c *Context) Progress(message string, percent int)
- func (c *Context) SetProgress(callback func(string, int))
- func (c *Context) WithCancel() (*Context, context.CancelFunc)
- func (c *Context) WithTimeout(timeout time.Duration) (*Context, context.CancelFunc)
- type ProgressUpdate
- type VolumeTarget
Constants ¶
const ( ErrCodeInvalidInput = "INVALID_INPUT" ErrCodeContainerAccess = "CONTAINER_ACCESS" ErrCodeVolumeNotFound = "VOLUME_NOT_FOUND" ErrCodePermission = "PERMISSION_DENIED" ErrCodeTimeout = "TIMEOUT" ErrCodeNotImplemented = "NOT_IMPLEMENTED" )
Common error codes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonError ¶
CommonError represents application-level errors
func NewError ¶
func NewError(code, message string, cause error) *CommonError
NewError creates a new CommonError
func (*CommonError) Error ¶
func (e *CommonError) Error() string
func (*CommonError) Unwrap ¶
func (e *CommonError) Unwrap() error
type Context ¶
type Context struct { context.Context // Output preferences OutputFormat string Verbose bool Quiet bool NoColor bool // Common timeouts DefaultTimeout time.Duration // Progress reporting ProgressCallback func(message string, percent int) }
Context holds application-wide configuration and state
func (*Context) SetProgress ¶
SetProgress sets the progress callback function
func (*Context) WithCancel ¶
func (c *Context) WithCancel() (*Context, context.CancelFunc)
WithCancel creates a cancellable context
func (*Context) WithTimeout ¶
WithTimeout creates a context with timeout
type ProgressUpdate ¶
type ProgressUpdate struct { Message string Completed int64 Total int64 StartedAt time.Time ElapsedTime time.Duration }
ProgressUpdate represents progress information
func (*ProgressUpdate) ETA ¶
func (p *ProgressUpdate) ETA() time.Duration
ETA estimates time to completion
func (*ProgressUpdate) Percent ¶
func (p *ProgressUpdate) Percent() int
Percent calculates completion percentage
func (*ProgressUpdate) Rate ¶
func (p *ProgressUpdate) Rate() float64
Rate calculates items per second
type VolumeTarget ¶
VolumeTarget represents volume selection across commands
func (*VolumeTarget) IsEmpty ¶
func (vt *VolumeTarget) IsEmpty() bool
IsEmpty returns true if no volume target is specified
func (*VolumeTarget) String ¶
func (vt *VolumeTarget) String() string
String returns a string representation of the volume target
func (*VolumeTarget) Validate ¶
func (vt *VolumeTarget) Validate() error
Validate ensures volume target is valid