MCPcopy Create free account
hub / github.com/Mister-leo/fssh / getConfigField

Function getConfigField

internal/sshconfig/global.go:203–230  ·  view source on GitHub ↗

getConfigField retrieves a config field value by name

(cfg *HostConfig, key string)

Source from the content-addressed store, hash-verified

201
202// getConfigField retrieves a config field value by name
203func getConfigField(cfg *HostConfig, key string) string {
204 switch key {
205 case "ServerAliveInterval":
206 return cfg.ServerAliveInterval
207 case "ServerAliveCountMax":
208 return cfg.ServerAliveCountMax
209 case "ForwardAgent":
210 return cfg.ForwardAgent
211 case "IdentityAgent":
212 return cfg.IdentityAgent
213 case "AddKeysToAgent":
214 return cfg.AddKeysToAgent
215 case "UseKeychain":
216 return cfg.UseKeychain
217 case "PubkeyAcceptedAlgorithms":
218 return cfg.PubkeyAcceptedAlgorithms
219 case "StrictHostKeyChecking":
220 return cfg.StrictHostKeyChecking
221 case "UserKnownHostsFile":
222 return cfg.UserKnownHostsFile
223 case "Compression":
224 return cfg.Compression
225 case "TCPKeepAlive":
226 return cfg.TCPKeepAlive
227 default:
228 return ""
229 }
230}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected