MCPcopy Create free account
hub / github.com/docker/cli / Erase

Method Erase

cli/config/credentials/file_store.go:33–40  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
33func (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.
43func (c *fileStore) Get(serverAddress string) (types.AuthConfig, error) {

Callers

nothing calls this directly

Calls 2

GetAuthConfigsMethod · 0.65
SaveMethod · 0.65

Tested by

no test coverage detected