MCPcopy Create free account
hub / github.com/Driver-C/tryssh / UpdateConfigAtPath

Function UpdateConfigAtPath

pkg/config/loader.go:59–65  ·  view source on GitHub ↗

UpdateConfigAtPath writes the configuration to the specified config path.

(configPath string, conf *MainConfig)

Source from the content-addressed store, hash-verified

57
58// UpdateConfigAtPath writes the configuration to the specified config path.
59func UpdateConfigAtPath(configPath string, conf *MainConfig) error {
60 toSave, encErr := encryptConfigForSave(conf)
61 if encErr != nil {
62 return encErr
63 }
64 return utils.FileYamlMarshalAndWrite(configPath, toSave)
65}
66
67// decryptConfig decrypts all encrypted fields in the config using the master key.
68// Only prompts for the master password if encrypted content is detected.

Callers 3

TestUpdateConfigAtPathFunction · 0.85
UpdateConfigFunction · 0.85

Calls 2

FileYamlMarshalAndWriteFunction · 0.92
encryptConfigForSaveFunction · 0.85

Tested by 2

TestUpdateConfigAtPathFunction · 0.68