| 1 | package lfshttpscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/ |
| 2 | |
| 3 | import ( |
| 4 | "bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/" |
| 5 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/" |
| 6 | "ioscip-go gomod github.com/golang/go/src go1.25.0 io/" |
| 7 | "net/httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/" |
| 8 | "net/http/httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/" |
| 9 | "stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/" |
| 10 | "sync/atomicscip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/" |
| 11 | "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/" |
| 12 | |
| 13 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 14 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 15 | ) |
| 16 | |
| 17 | func TestStatsWithKeyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/TestStatsWithKey().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 18 | var called uint32 |
| 19 | srv := httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/.NewServerscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/NewServer().(httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.HandlerFuncscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/HandlerFunc#(func(w httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#) { |
| 20 | atomicscip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/.AddUint32scip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/AddUint32().(&called, 1) |
| 21 | t.Logfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Logf().("srv req %s %s", r.Methodscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Method., r.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#URL..Pathscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/URL#Path.) |
| 22 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "POST", r.Methodscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Method.) |
| 23 | |
| 24 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "Basic ABC", r.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Getscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Get().("Authorization")) |
| 25 | body := &verboseTestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#{} |
| 26 | err := jsonscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/.NewDecoderscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/NewDecoder().(r.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Body.).Decodescip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/Decoder#Decode().(body) |
| 27 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err) |
| 28 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "Verbose", body.Testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#Test.) |
| 29 | w.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#Header().().Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Content-Type", "application/json") |
| 30 | w.Writescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#Write().([]byte(`{"Status":"Ok"}`)) |
| 31 | })) |
| 32 | defer srv.Closescip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#Close().() |
| 33 | |
| 34 | out := &bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#{} |
| 35 | c := NewClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/NewClient().(nil) |
| 36 | c.ConcurrentTransfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#ConcurrentTransfers. = 5 |
| 37 | c.LogHTTPStatsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#LogHTTPStats().(nopCloserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopCloser().(out)) |
| 38 | |
| 39 | req, err := httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.NewRequestscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/NewRequest().("POST", srv.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#URL., nil) |
| 40 | req = c.LogRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#LogRequest().(req, "stats-test") |
| 41 | req.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Authorization", "Basic ABC") |
| 42 | req.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Content-Type", "application/json") |
| 43 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, err) |
| 44 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, MarshalToRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/MarshalToRequest().(req, verboseTestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#{"Verbose"})) |
| 45 | |
| 46 | res, err := c.Doscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#Do().(req) |
| 47 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, err) |
| 48 | |
| 49 | ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Copyscip-go gomod github.com/golang/go/src go1.25.0 io/Copy().(ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Discardscip-go gomod github.com/golang/go/src go1.25.0 io/Discard., res.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#Body.) |
| 50 | res.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#Body..Closescip-go gomod github.com/golang/go/src go1.25.0 io/Closer#Close().() |
| 51 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, c.Closescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#Close().()) |
| 52 | |
| 53 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 200, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode.) |
| 54 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.EqualValuesscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/EqualValues().(t, 1, called) |
| 55 | |
| 56 | stats := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.TrimSpacescip-go gomod github.com/golang/go/src go1.25.0 strings/TrimSpace().(out.Stringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#String().()) |
| 57 | t.Logscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Log().(stats) |
| 58 | lines := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Splitscip-go gomod github.com/golang/go/src go1.25.0 strings/Split().(stats, "\n") |
| 59 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Equal().(t, 3, len(lines)) |
| 60 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Containsscip-go gomod github.com/golang/go/src go1.25.0 strings/Contains().(lines[0], "concurrent=5")) |
| 61 | expected := []string{ |
| 62 | "key=stats-test", |
| 63 | "event=request", |
| 64 | "body=18", |
| 65 | "url=" + srv.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#URL., |
| 66 | } |
| 67 | |
| 68 | for _, substr := range expected { |
| 69 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Containsscip-go gomod github.com/golang/go/src go1.25.0 strings/Contains().(lines[1], substr), "missing: "+substr) |
| 70 | } |
| 71 | |
| 72 | expected = []string{ |
| 73 | "key=stats-test", |
| 74 | "event=response", |
| 75 | "url=" + srv.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#URL., |
| 76 | } |
| 77 | |
| 78 | for _, substr := range expected { |
| 79 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Containsscip-go gomod github.com/golang/go/src go1.25.0 strings/Contains().(lines[2], substr), "missing: "+substr) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func TestStatsWithoutKeyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/TestStatsWithoutKey().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 84 | var called uint32 |
| 85 | srv := httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/.NewServerscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/NewServer().(httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.HandlerFuncscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/HandlerFunc#(func(w httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#) { |
| 86 | atomicscip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/.AddUint32scip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/AddUint32().(&called, 1) |
| 87 | t.Logfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Logf().("srv req %s %s", r.Methodscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Method., r.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#URL..Pathscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/URL#Path.) |
| 88 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "POST", r.Methodscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Method.) |
| 89 | |
| 90 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "Basic ABC", r.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Getscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Get().("Authorization")) |
| 91 | body := &verboseTestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#{} |
| 92 | err := jsonscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/.NewDecoderscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/NewDecoder().(r.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Body.).Decodescip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/Decoder#Decode().(body) |
| 93 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err) |
| 94 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "Verbose", body.Testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#Test.) |
| 95 | w.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#Header().().Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Content-Type", "application/json") |
| 96 | w.Writescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#Write().([]byte(`{"Status":"Ok"}`)) |
| 97 | })) |
| 98 | defer srv.Closescip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#Close().() |
| 99 | |
| 100 | out := &bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#{} |
| 101 | c := NewClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/NewClient().(nil) |
| 102 | c.ConcurrentTransfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#ConcurrentTransfers. = 5 |
| 103 | c.LogHTTPStatsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#LogHTTPStats().(nopCloserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopCloser().(out)) |
| 104 | |
| 105 | req, err := httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.NewRequestscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/NewRequest().("POST", srv.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#URL., nil) |
| 106 | req.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Authorization", "Basic ABC") |
| 107 | req.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Content-Type", "application/json") |
| 108 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, err) |
| 109 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, MarshalToRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/MarshalToRequest().(req, verboseTestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#{"Verbose"})) |
| 110 | |
| 111 | res, err := c.Doscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#Do().(req) |
| 112 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, err) |
| 113 | ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Copyscip-go gomod github.com/golang/go/src go1.25.0 io/Copy().(ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Discardscip-go gomod github.com/golang/go/src go1.25.0 io/Discard., res.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#Body.) |
| 114 | res.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#Body..Closescip-go gomod github.com/golang/go/src go1.25.0 io/Closer#Close().() |
| 115 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, c.Closescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#Close().()) |
| 116 | |
| 117 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 200, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode.) |
| 118 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.EqualValuesscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/EqualValues().(t, 1, called) |
| 119 | |
| 120 | stats := stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.TrimSpacescip-go gomod github.com/golang/go/src go1.25.0 strings/TrimSpace().(out.Stringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#String().()) |
| 121 | t.Logscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Log().(stats) |
| 122 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Containsscip-go gomod github.com/golang/go/src go1.25.0 strings/Contains().(stats, "concurrent=5")) |
| 123 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 1, len(stringsscip-go gomod github.com/golang/go/src go1.25.0 strings/.Splitscip-go gomod github.com/golang/go/src go1.25.0 strings/Split().(stats, "\n"))) |
| 124 | } |
| 125 | |
| 126 | func TestStatsDisabledscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/TestStatsDisabled().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 127 | var called uint32 |
| 128 | srv := httptestscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/.NewServerscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/NewServer().(httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.HandlerFuncscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/HandlerFunc#(func(w httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#) { |
| 129 | atomicscip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/.AddUint32scip-go gomod github.com/golang/go/src go1.25.0 `sync/atomic`/AddUint32().(&called, 1) |
| 130 | t.Logfscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Logf().("srv req %s %s", r.Methodscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Method., r.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#URL..Pathscip-go gomod github.com/golang/go/src go1.25.0 `net/url`/URL#Path.) |
| 131 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "POST", r.Methodscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Method.) |
| 132 | |
| 133 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "Basic ABC", r.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Getscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Get().("Authorization")) |
| 134 | body := &verboseTestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#{} |
| 135 | err := jsonscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/.NewDecoderscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/NewDecoder().(r.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Body.).Decodescip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/Decoder#Decode().(body) |
| 136 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, err) |
| 137 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "Verbose", body.Testscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#Test.) |
| 138 | w.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#Header().().Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Content-Type", "application/json") |
| 139 | w.Writescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/ResponseWriter#Write().([]byte(`{"Status":"Ok"}`)) |
| 140 | })) |
| 141 | defer srv.Closescip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#Close().() |
| 142 | |
| 143 | c := NewClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/NewClient().(nil) |
| 144 | c.ConcurrentTransfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#ConcurrentTransfers. = 5 |
| 145 | |
| 146 | req, err := httpscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/.NewRequestscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/NewRequest().("POST", srv.URLscip-go gomod github.com/golang/go/src go1.25.0 `net/http/httptest`/Server#URL., nil) |
| 147 | req = c.LogRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#LogRequest().(req, "stats-test") |
| 148 | |
| 149 | req.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Authorization", "Basic ABC") |
| 150 | req.Headerscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Request#Header..Setscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Header#Set().("Content-Type", "application/json") |
| 151 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, err) |
| 152 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, MarshalToRequestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/MarshalToRequest().(req, verboseTestscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/verboseTest#{"Verbose"})) |
| 153 | |
| 154 | res, err := c.Doscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#Do().(req) |
| 155 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/Nil().(t, err) |
| 156 | |
| 157 | ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Copyscip-go gomod github.com/golang/go/src go1.25.0 io/Copy().(ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Discardscip-go gomod github.com/golang/go/src go1.25.0 io/Discard., res.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#Body.) |
| 158 | res.Bodyscip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#Body..Closescip-go gomod github.com/golang/go/src go1.25.0 io/Closer#Close().() |
| 159 | |
| 160 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 200, res.StatusCodescip-go gomod github.com/golang/go/src go1.25.0 `net/http`/Response#StatusCode.) |
| 161 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.EqualValuesscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/EqualValues().(t, 1, called) |
| 162 | |
| 163 | out := &bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#{} |
| 164 | c.LogStatsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Client#LogStats().(out) |
| 165 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, 0, out.Lenscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#Len().()) |
| 166 | } |
| 167 | |
| 168 | func nopCloserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopCloser().(w ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Writerscip-go gomod github.com/golang/go/src go1.25.0 io/Writer#) ioscip-go gomod github.com/golang/go/src go1.25.0 io/.WriteCloserscip-go gomod github.com/golang/go/src go1.25.0 io/WriteCloser# { |
| 169 | return nopWCloserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopWCloser#{w} |
| 170 | } |
| 171 | |
| 172 | type nopWCloserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopWCloser# struct { |
| 173 | ioscip-go gomod github.com/golang/go/src go1.25.0 io/.Writerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopWCloser#Writer. |
| 174 | } |
| 175 | |
| 176 | func (w nopWCloserscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopWCloser#) Closescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/nopWCloser#Close().() error { |
| 177 | return nil |
| 178 | } |