@@ -18,6 +18,8 @@ import (
18
18
// requests and their responses to text files in basepath.
19
19
// Requests are named according to a hash of their contents.
20
20
// Responses are named according to the request that made them.
21
+ //
22
+ // Deprecated: Use reqtest.Record.
21
23
func Record (rt http.RoundTripper , basepath string ) Transport {
22
24
if rt == nil {
23
25
rt = http .DefaultTransport
@@ -56,6 +58,8 @@ func Record(rt http.RoundTripper, basepath string) Transport {
56
58
// Replay returns an http.RoundTripper that reads its
57
59
// responses from text files in basepath.
58
60
// Responses are looked up according to a hash of the request.
61
+ //
62
+ // Deprecated: Use reqtest.Replay.
59
63
func Replay (basepath string ) Transport {
60
64
return ReplayFS (os .DirFS (basepath ))
61
65
}
@@ -66,6 +70,8 @@ var errNotFound = errors.New("response not found")
66
70
// responses from text files in the fs.FS.
67
71
// Responses are looked up according to a hash of the request.
68
72
// Response file names may optionally be prefixed with comments for better human organization.
73
+ //
74
+ // Deprecated: Use reqtest.ReplayFS.
69
75
func ReplayFS (fsys fs.FS ) Transport {
70
76
return RoundTripFunc (func (req * http.Request ) (res * http.Response , err error ) {
71
77
defer func () {
@@ -110,6 +116,8 @@ func buildName(b []byte) (reqname, resname string) {
110
116
// it caches the result of issuing the request with rt in basepath.
111
117
// Requests are named according to a hash of their contents.
112
118
// Responses are named according to the request that made them.
119
+ //
120
+ // Deprecated: Use reqtest.Caching.
113
121
func Caching (rt http.RoundTripper , basepath string ) Transport {
114
122
replay := Replay (basepath ).RoundTrip
115
123
record := Record (rt , basepath ).RoundTrip
0 commit comments