|
|
@ -61,11 +61,12 @@ func (s *serverConfigV19) GetVersion() string { |
|
|
|
return s.Version |
|
|
|
return s.Version |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// SetRegion set new region.
|
|
|
|
// SetRegion set a new region.
|
|
|
|
func (s *serverConfigV19) SetRegion(region string) { |
|
|
|
func (s *serverConfigV19) SetRegion(region string) { |
|
|
|
s.Lock() |
|
|
|
s.Lock() |
|
|
|
defer s.Unlock() |
|
|
|
defer s.Unlock() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Save new region.
|
|
|
|
s.Region = region |
|
|
|
s.Region = region |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -77,13 +78,19 @@ func (s *serverConfigV19) GetRegion() string { |
|
|
|
return s.Region |
|
|
|
return s.Region |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// SetCredentials set new credentials.
|
|
|
|
// SetCredentials set new credentials. SetCredential returns the previous credential.
|
|
|
|
func (s *serverConfigV19) SetCredential(creds credential) { |
|
|
|
func (s *serverConfigV19) SetCredential(creds credential) (prevCred credential) { |
|
|
|
s.Lock() |
|
|
|
s.Lock() |
|
|
|
defer s.Unlock() |
|
|
|
defer s.Unlock() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Save previous credential.
|
|
|
|
|
|
|
|
prevCred = s.Credential |
|
|
|
|
|
|
|
|
|
|
|
// Set updated credential.
|
|
|
|
// Set updated credential.
|
|
|
|
s.Credential = creds |
|
|
|
s.Credential = creds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return previous credential.
|
|
|
|
|
|
|
|
return prevCred |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetCredentials get current credentials.
|
|
|
|
// GetCredentials get current credentials.
|
|
|
|