From bd518c086bcb81c06cb4eccf41eb37fa956e53cb Mon Sep 17 00:00:00 2001 From: Youwen Zhu Date: Thu, 29 Feb 2024 02:32:39 -0800 Subject: [PATCH] Retry buildable --- client.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/client.go b/client.go index 9e84ff8..a1f3595 100644 --- a/client.go +++ b/client.go @@ -133,6 +133,15 @@ func NewMock(primary string, active []string) Client { return &fileClient{primary: primary, active: active, keyObject: Key{VersionList: KeyVersionList(kvl)}} } + +// HTTPClient is a client that uses HTTP to talk to Knox. +type HTTPClient struct { + // KeyFolder is the location of cached keys on the file system. If empty, does not check for cached keys. + KeyFolder string + // Client is the http client for making network calls + UncachedClient UncachedHTTPClient +} + // Register registers the given keyName with knox. If the operation fails, it returns an error. func Register(keyID string) ([]byte, error) { var stdout, stderr bytes.Buffer @@ -193,14 +202,6 @@ type HTTP interface { Do(req *http.Request) (*http.Response, error) } -// HTTPClient is a client that uses HTTP to talk to Knox. -type HTTPClient struct { - // KeyFolder is the location of cached keys on the file system. If empty, does not check for cached keys. - KeyFolder string - // Client is the http client for making network calls - UncachedClient UncachedHTTPClient -} - // NewClient creates a new client to connect to talk to Knox. func NewClient(host string, client HTTP, authHandler func() string, keyFolder, version string) APIClient { return &HTTPClient{