MCPcopy Create free account
hub / github.com/cloudfoundry/credhub-cli / WriteConfig

Function WriteConfig

config/config.go:89–104  ·  view source on GitHub ↗
(c Config)

Source from the content-addressed store, hash-verified

87}
88
89func WriteConfig(c Config) error {
90 err := makeDirectory()
91 if err != nil {
92 return err
93 }
94
95 configWithoutSecrets := ConvertConfigToConfigWithoutSecrets(c)
96
97 data, err := json.Marshal(configWithoutSecrets)
98 if err != nil {
99 return err
100 }
101
102 configPath := ConfigPath()
103 return os.WriteFile(configPath, data, 0600)
104}
105
106func RemoveConfig() error {
107 return os.Remove(ConfigPath())

Callers 15

token_test.goFile · 0.92
ExecuteMethod · 0.92
login_test.goFile · 0.92
setConfigAuthUrlFunction · 0.92
version_test.goFile · 0.92
export_test.goFile · 0.92
ExecuteMethod · 0.92
delete_test.goFile · 0.92
api_test.goFile · 0.92
setCachedServerVersionFunction · 0.92

Calls 3

ConfigPathFunction · 0.85
makeDirectoryFunction · 0.70

Tested by 4

setConfigAuthUrlFunction · 0.74
setCachedServerVersionFunction · 0.74
setupUAAConfigFunction · 0.74
ItRequiresAnAPIToBeSetFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…