Skip to content

Commit

Permalink
enhance: credentials: return set with ReadCredentialsFromFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Sep 10, 2021
1 parent ae56fa9 commit eafb608
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions credentials/credentials_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ func (set *CredentialsSet) NewSimpleClient(key string) (*httpsimple.SimpleClient
return creds.NewSimpleClient()
}

func ReadCredentialsFromFile(filename, key string, inflateEndpoints bool) (Credentials, error) {
func ReadCredentialsFromFile(filename, key string, inflateEndpoints bool) (CredentialsSet, Credentials, error) {
set, err := ReadFileCredentialsSet(filename, inflateEndpoints)
if err != nil {
return Credentials{}, err
return set, Credentials{}, err
}
return set.Get(key)
creds, err := set.Get(key)
return set, creds, err
}

func (set *CredentialsSet) GetClient(key string) (*http.Client, error) {
Expand Down

0 comments on commit eafb608

Please sign in to comment.