Documentation
¶
Index ¶
- func NewCommand() *cli.Command
- type CompressionStat
- type ErrorsWatcher
- type ErrorsWatcherOption
- type StatsCollector
- type StatsStorage
- func (s *StatsStorage) Close()
- func (s *StatsStorage) History() []CompressionStat
- func (s *StatsStorage) Push(ctx context.Context, stat CompressionStat)
- func (s *StatsStorage) TotalCompressedSize() (total uint64)
- func (s *StatsStorage) TotalFiles() (total uint32)
- func (s *StatsStorage) TotalOriginalSize() (total uint64)
- func (s *StatsStorage) TotalSavedBytes() (total int64)
- func (s *StatsStorage) Watch(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompressionStat ¶
CompressionStat represents a single compression stat.
type ErrorsWatcher ¶
type ErrorsWatcher chan error
func (ErrorsWatcher) Watch ¶
func (w ErrorsWatcher) Watch(ctx context.Context, errorsLimit uint, options ...ErrorsWatcherOption)
type ErrorsWatcherOption ¶
type ErrorsWatcherOption func(*errorsWatcherOptions)
func WithLimitExceededHandler ¶
func WithLimitExceededHandler(h func()) ErrorsWatcherOption
func WithOnErrorHandler ¶
func WithOnErrorHandler(h func(error)) ErrorsWatcherOption
type StatsCollector ¶
type StatsCollector interface { Watch(context.Context) // starts collecting stats Push(context.Context, CompressionStat) // pushes a new stat Close() // stops collecting stats History() []CompressionStat // returns all collected stats TotalOriginalSize() uint64 // returns total original size of all files TotalCompressedSize() uint64 // returns total compressed size of all files TotalSavedBytes() int64 // returns total saved bytes of all files TotalFiles() uint32 // returns total number of files }
type StatsStorage ¶
type StatsStorage struct {
// contains filtered or unexported fields
}
StatsStorage is a storage for compression stats.
func NewStatsStorage ¶
func NewStatsStorage(expectedHistoryLen int) *StatsStorage
NewStatsStorage creates a new StatsStorage.
func (*StatsStorage) Close ¶
func (s *StatsStorage) Close()
func (*StatsStorage) History ¶
func (s *StatsStorage) History() []CompressionStat
func (*StatsStorage) Push ¶
func (s *StatsStorage) Push(ctx context.Context, stat CompressionStat)
func (*StatsStorage) TotalCompressedSize ¶
func (s *StatsStorage) TotalCompressedSize() (total uint64)
func (*StatsStorage) TotalFiles ¶
func (s *StatsStorage) TotalFiles() (total uint32)
func (*StatsStorage) TotalOriginalSize ¶
func (s *StatsStorage) TotalOriginalSize() (total uint64)
func (*StatsStorage) TotalSavedBytes ¶
func (s *StatsStorage) TotalSavedBytes() (total int64)
func (*StatsStorage) Watch ¶
func (s *StatsStorage) Watch(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.