Give resty client along with some basic settings like cookie etc
(setCookie bool)
| 50 | |
| 51 | //Give resty client along with some basic settings like cookie etc |
| 52 | func getRestyClient(setCookie bool) *resty.Client { |
| 53 | baseServerUrl, _, _ := getBaseServerDetails() |
| 54 | client := resty.New() |
| 55 | client.SetBaseURL(baseServerUrl) |
| 56 | if(setCookie) { |
| 57 | client.SetCookie(&http.Cookie{Name:"argocd.token", |
| 58 | Value: getAuthToken(), |
| 59 | Path: "/", |
| 60 | Domain: baseServerUrl}) |
| 61 | } |
| 62 | return client |
| 63 | } |
| 64 | |
| 65 | //this function will read testEnvironmentConfig.json file and get baseServerUrl, username and pwd depending on environment |
| 66 | func getBaseServerDetails() (string, string, string) { |
no test coverage detected
searching dependent graphs…