Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultHistoryFileFinder ¶
func NewDefaultHistoryFileFinder() ports.HistoryFileFinder
NewDefaultHistoryFileFinder creates a new DefaultHistoryFileFinder.
func NewHistoryProvider ¶
func NewHistoryProvider(cmdExecutor ports.CommandExecutor, fileFinder ports.HistoryFileFinder) (ports.HistoryProvider, error)
NewHistoryProvider creates a new FileBasedHistoryProvider.
Types ¶
type DefaultHistoryFileFinder ¶
type DefaultHistoryFileFinder struct{}
DefaultHistoryFileFinder is the default implementation that uses the package-level findUserHistoryFile.
func (*DefaultHistoryFileFinder) Find ¶
func (d *DefaultHistoryFileFinder) Find() (string, error)
Find implements the ports.HistoryFileFinder interface.
type HistoryProvider ¶
type HistoryProvider struct { Shell string HistoryFile string // Stores the absolute path // contains filtered or unexported fields }
HistoryProvider provides access to shell command history stored in files. It implements the ports.HistoryProvider interface.
func (*HistoryProvider) GetCommandFrequencies ¶
func (hp *HistoryProvider) GetCommandFrequencies(scanLimit int, outputLimit int) ([]history.CommandFrequency, error)
GetCommandFrequencies implements the ports.HistoryProvider interface.
func (*HistoryProvider) GetHistoryFilePath ¶
func (hp *HistoryProvider) GetHistoryFilePath() string
func (*HistoryProvider) GetSourceIdentifier ¶
func (hp *HistoryProvider) GetSourceIdentifier() string
Click to show internal directories.
Click to hide internal directories.