storage

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID              int64
	Method          string
	Scheme          string // "http" or "https"
	Host            string
	Path            string
	Query           string
	RequestHeaders  http.Header
	RequestBody     []byte
	StatusCode      int
	ResponseHeaders http.Header
	ResponseBody    []byte
	Timestamp       time.Time
	DurationMs      int64
}

type SQLiteStore

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

func NewSQLiteStore

func NewSQLiteStore(dbPath string) (*SQLiteStore, error)

func (*SQLiteStore) Clear added in v0.3.2

func (s *SQLiteStore) Clear() error

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

func (*SQLiteStore) Get

func (s *SQLiteStore) Get(id int64) (*Entry, error)

func (*SQLiteStore) List

func (s *SQLiteStore) List(limit, offset int) ([]*Entry, error)

func (*SQLiteStore) ListAfter added in v0.3.2

func (s *SQLiteStore) ListAfter(afterID int64, limit int) ([]*Entry, error)

func (*SQLiteStore) Save

func (s *SQLiteStore) Save(entry *Entry) error

func (*SQLiteStore) Search

func (s *SQLiteStore) Search(params SearchParams) ([]*Entry, error)

type SearchParams

type SearchParams struct {
	Method  string   // exact match
	Host    string   // supports glob wildcard (*.domain.com)
	Domains []string // suffix match
	Path    string   // prefix or glob
	Status  int      // exact match
	Limit   int
	Offset  int
}

type Store

type Store interface {
	Save(entry *Entry) error
	Get(id int64) (*Entry, error)
	List(limit, offset int) ([]*Entry, error)
	ListAfter(afterID int64, limit int) ([]*Entry, error)
	Search(params SearchParams) ([]*Entry, error)
	Clear() error
	Close() error
}

Jump to

Keyboard shortcuts

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