history

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHistoryItem

func FormatHistoryItem(item models.HistoricalHttpRequest, index int) string

FormatHistoryItem formats a history item for display

func SortByTime

func SortByTime(items []models.HistoricalHttpRequest)

SortByTime sorts history items by time (newest first)

func SortByURL

func SortByURL(items []models.HistoricalHttpRequest)

SortByURL sorts history items by URL alphabetically

Types

type HistoryManager

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

HistoryManager manages request history

func NewHistoryManager

func NewHistoryManager(dataDir string) (*HistoryManager, error)

NewHistoryManager creates a new history manager

func (*HistoryManager) Add

func (hm *HistoryManager) Add(request *models.HttpRequest) error

Add adds a request to history

func (*HistoryManager) Clear

func (hm *HistoryManager) Clear() error

Clear clears all history

func (*HistoryManager) GetAll

GetAll returns all history items

func (*HistoryManager) GetByIndex

func (hm *HistoryManager) GetByIndex(index int) (*models.HistoricalHttpRequest, error)

GetByIndex returns a history item by index (0 = most recent)

func (*HistoryManager) GetRecent

func (hm *HistoryManager) GetRecent(n int) []models.HistoricalHttpRequest

GetRecent returns the most recent n items

func (*HistoryManager) GetStats

func (hm *HistoryManager) GetStats() HistoryStats

GetStats returns statistics about the history

func (*HistoryManager) Remove

func (hm *HistoryManager) Remove(index int) error

Remove removes a history item by index

func (*HistoryManager) Search

func (hm *HistoryManager) Search(query string) []models.HistoricalHttpRequest

Search searches history by URL or method

type HistoryStats

type HistoryStats struct {
	TotalRequests int
	MethodCounts  map[string]int
	DomainCounts  map[string]int
	OldestRequest time.Time
	NewestRequest time.Time
}

HistoryStats returns statistics about the history

Jump to

Keyboard shortcuts

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