1
0
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:
Dan Ramich
2018-04-10 13:29:10 -07:00
committed by Darren Shepherd
parent 93bfc4ea3a
commit 9846d7349c
3 changed files with 25 additions and 19 deletions

View File

@@ -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())
}