ilog

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "060102.150405"

Variables

This section is empty.

Functions

func ProgressBar

func ProgressBar(max int64, visible bool) *progressbar.ProgressBar

Types

type Category

type Category string
const (
	Upsert         Category = "upsert"
	Verify         Category = "verify"
	Duplicates     Category = "duplicates"
	Contains       Category = "contains"
	Style          Category = "style"
	ExtensionStats Category = "extension stats"
)

func (Category) ToUpper

func (c Category) ToUpper() string

type ContainedLog

type ContainedLog struct {
	Hash          string
	RelativePaths []string
}

func (*ContainedLog) AddRelativePath

func (l *ContainedLog) AddRelativePath(path string)

type ContainedSummary

type ContainedSummary struct {
	ExecutionTime  time.Duration
	TotalFiles     int64
	TotalBytes     int64
	ContainedFiles int64
	ContainedBytes int64
	DuplicateFiles int64
	DuplicateBytes int64
}

type DuplicateLog

type DuplicateLog struct {
	Hash          string
	RelativePaths []string
}

func (*DuplicateLog) AddRelativePath

func (l *DuplicateLog) AddRelativePath(path string)

type DuplicateSummary

type DuplicateSummary struct {
	ExecutionTime  time.Duration
	TotalFiles     int64
	TotalBytes     int64
	DuplicateFiles int64
	DuplicateBytes int64
}

type ExtensionStatsLog added in v1.1.1

type ExtensionStatsLog struct {
	Name       string
	Bytes      int64
	Percentage float64
}

type ExtensionStatsSummary added in v1.1.1

type ExtensionStatsSummary struct {
	ExecutionTime    time.Duration
	TotalBytes       int64
	UniqueExtensions int
}

type IssueType

type IssueType string
const (
	HIERARCHY_ISSUE IssueType = "HIERARCHY ISSUE"
	NAMING_ISSUE    IssueType = "NAMING ISSUE"
	LENGTH_ISSUE    IssueType = "LENGTH ISSUE"
)

type LogFileBuffer

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

func NewAutomaticLogBuffer

func NewAutomaticLogBuffer(basePath string, category Category, maxItems uint64, options Options) LogFileBuffer

func NewManualLogBuffer

func NewManualLogBuffer(basePath string, category Category, options Options) LogFileBuffer

func (*LogFileBuffer) Append

func (lf *LogFileBuffer) Append(log serializable) *LogFileBuffer

func (*LogFileBuffer) AppendAll

func (lf *LogFileBuffer) AppendAll(logs []serializable) *LogFileBuffer

func (*LogFileBuffer) AppendUpsertLog

func (lf *LogFileBuffer) AppendUpsertLog(operation UpsertOperation, relativePath string) *LogFileBuffer

func (*LogFileBuffer) AppendVerifyLog

func (lf *LogFileBuffer) AppendVerifyLog(status VerifyStatus, relativePath string, reason error) *LogFileBuffer

func (*LogFileBuffer) AutomaticFlush

func (lf *LogFileBuffer) AutomaticFlush() bool

func (*LogFileBuffer) Flush

func (lf *LogFileBuffer) Flush()

func (*LogFileBuffer) RequiresFlush

func (lf *LogFileBuffer) RequiresFlush() bool

type Options

type Options struct {
	Console bool
	File    bool
}

type StyleLog

type StyleLog struct {
	IssueType    IssueType
	Reason       string
	RelativePath string
}

func (StyleLog) String

func (l StyleLog) String() string

type StyleSummary

type StyleSummary struct {
	ExecutionTime   time.Duration
	HierarchyIssues int
	NamingIssues    int
	LengthIssues    int
	TotalDirs       int64
}

type UpsertLog

type UpsertLog struct {
	Created      time.Time
	Operation    UpsertOperation
	RelativePath string
}

type UpsertOperation

type UpsertOperation string
const (
	NEW    UpsertOperation = "NEW"
	UPDATE UpsertOperation = "UPDATE"
	DELETE UpsertOperation = "DELETE"
	SKIP   UpsertOperation = "SKIP"
)

type UpsertSummary

type UpsertSummary struct {
	ExecutionTime time.Duration
	TotalBytes    int64
	HashedBytes   int64
	SkippedFiles  int64
	NewFiles      int64
	UpdatedFiles  int64
	DeletedFiles  int64
}

func (*UpsertSummary) AddHashedBytes

func (us *UpsertSummary) AddHashedBytes(bytes int64)

type VerifyLog

type VerifyLog struct {
	Created      time.Time
	Status       VerifyStatus
	RelativePath string
	Reason       error
}

type VerifyStatus

type VerifyStatus string
const (
	OK    VerifyStatus = "OK"
	ERROR VerifyStatus = "ERROR"
)

type VerifySummary

type VerifySummary struct {
	ExecutionTime time.Duration
	TotalBytes    int64
	ValidFiles    int64
	InvalidFiles  int64
}

Jump to

Keyboard shortcuts

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