history

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoHistory = errors.New("no history")

Functions

func NewHandler

func NewHandler(filepath string) *fileHandler

Types

type Entry

type Entry struct {
	Timestamp time.Time   `json:"timestamp"`
	Method    string      `json:"method"`
	URL       string      `json:"url"`
	Header    http.Header `json:"headers"`
	Body      []byte      `json:"body"`
}

func NewEntry

func NewEntry(req *http.Request) (Entry, error)

type Handler

type Handler interface {
	GetAll() ([]Entry, error)
	GetByIndex(index uint16) (Entry, error)
	Append(*http.Request, []byte) (Entry, error)
	Latest() (Entry, error)
	Write() error
	Clear() error
}

Jump to

Keyboard shortcuts

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