history

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 9 Imported by: 0

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

Jump to

Keyboard shortcuts

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