Erase removes the given credentials from the file store.This function is idempotent and does not update the file if credentials did not change.
(serverAddress string)
| 31 | // Erase removes the given credentials from the file store.This function is |
| 32 | // idempotent and does not update the file if credentials did not change. |
| 33 | func (c *fileStore) Erase(serverAddress string) error { |
| 34 | if _, exists := c.file.GetAuthConfigs()[serverAddress]; !exists { |
| 35 | // nothing to do; no credentials found for the given serverAddress |
| 36 | return nil |
| 37 | } |
| 38 | delete(c.file.GetAuthConfigs(), serverAddress) |
| 39 | return c.file.Save() |
| 40 | } |
| 41 | |
| 42 | // Get retrieves credentials for a specific server from the file store. |
| 43 | func (c *fileStore) Get(serverAddress string) (types.AuthConfig, error) { |
nothing calls this directly
no test coverage detected