Documentation
¶
Index ¶
- type Entry
- type HARStorage
- func (s *HARStorage) Add(req *http.Request, res *http.Response)
- func (s *HARStorage) Delete(id string) bool
- func (s *HARStorage) Entries() []*Entry
- func (s *HARStorage) Init()
- func (s *HARStorage) Load() error
- func (s *HARStorage) Save() error
- func (s *HARStorage) WithCurrentTimeOverride(fn func() time.Time)
- func (s *HARStorage) WithUUIDOverride(fn func() string)
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HARStorage ¶
type HARStorage struct {
// contains filtered or unexported fields
}
HARStorage is a Storage implementation that stores requests and responses in HAR format on disk.
func NewHARStorage ¶
func NewHARStorage(path string) *HARStorage
NewHARStorage creates a new HARStorage.
func (*HARStorage) Add ¶
func (s *HARStorage) Add(req *http.Request, res *http.Response)
Add converts the http.Request and http.Response to a har.Entry and adds it to the Fixture.
func (*HARStorage) Delete ¶
func (s *HARStorage) Delete(id string) bool
Delete removes the HAR entry with the given ID.
func (*HARStorage) Entries ¶
func (s *HARStorage) Entries() []*Entry
Entries converts HAR entries to a slice of Entry (http.Request and http.Response pairs).
func (*HARStorage) Init ¶
func (s *HARStorage) Init()
func (*HARStorage) WithCurrentTimeOverride ¶
func (s *HARStorage) WithCurrentTimeOverride(fn func() time.Time)
WithCurrentTimeOverride replaces the default s.currentTime() with the given function.
func (*HARStorage) WithUUIDOverride ¶
func (s *HARStorage) WithUUIDOverride(fn func() string)
WithUUIDOverride replaces the default s.newUUID() with the given function.
Click to show internal directories.
Click to hide internal directories.