1
0
mirror of https://github.com/mayflower/docker-ls.git synced 2025-11-28 00:01:09 +03:00

API level token caching, statistics.

This commit is contained in:
Christian Speckner
2016-02-17 14:39:35 +01:00
parent 0f202ef651
commit 07cf002b17
15 changed files with 284 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ type paginatedRequestResponse interface {
type paginatedRequestContext interface {
path() string
tokenCacheHint() string
validateApiResponse(response *http.Response, initialRequest bool) error
processPartialResponse(response paginatedRequestResponse, apiResponse interface{})
createResponse(api *registryApi) paginatedRequestResponse
@@ -24,7 +25,7 @@ type paginatedRequestContext interface {
}
func (r *registryApi) executePaginatedRequest(ctx paginatedRequestContext, url *url.URL, initialRequest bool) (response *http.Response, close bool, err error) {
response, err = r.connector.Get(url)
response, err = r.connector.Get(url, ctx.tokenCacheHint())
if err != nil {
return