mirror of
https://github.com/rancher/norman.git
synced 2025-09-12 21:33:21 +00:00
Add interface for APIBaseClient
Problem: There are three clients based off the APIBaseClient so three code paths are needed to make the same type of call in each client Solution: Add an interface so any client that satisfies it can be used to make these calls
This commit is contained in:
committed by
Darren Shepherd
parent
93bfc4ea3a
commit
9846d7349c
@@ -12,6 +12,12 @@ import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
type APIOperations struct {
|
||||
Opts *ClientOpts
|
||||
Types map[string]types.Schema
|
||||
Client *http.Client
|
||||
}
|
||||
|
||||
func (a *APIOperations) setupRequest(req *http.Request) {
|
||||
req.Header.Add("Authorization", a.Opts.getAuthHeader())
|
||||
}
|
||||
|
Reference in New Issue
Block a user