Skip to content

Commit

Permalink
Retry buildable
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyouwen committed Feb 29, 2024
1 parent 97961d5 commit bd518c0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit bd518c0

Please sign in to comment.