MCPcopy
hub / github.com/moul/sshportal / String

Method String

pkg/dbmodels/dbmodels.go:194–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192 return fmt.Sprintf("%s:%d", host.Hostname(), host.Port())
193}
194func (host *Host) String() string {
195 if host.URL != "" {
196 return host.URL
197 } else if host.Addr != "" { // to be removed in a future version in favor of URL
198 if host.Password != "" {
199 return fmt.Sprintf("ssh://%s:%s@%s", host.User, strings.Repeat("*", 4), host.Addr)
200 }
201 return fmt.Sprintf("ssh://%s@%s", host.User, host.Addr)
202 }
203 return ""
204}
205func (host *Host) Scheme() BastionScheme {
206 if host.URL != "" {
207 u, err := url.Parse(host.URL)

Callers 7

shellFunction · 0.95
parseServerConfigFunction · 0.45
healthcheckOnceFunction · 0.45
mainFunction · 0.45
NewSSHKeyFunction · 0.45
ImportSSHKeyFunction · 0.45
ChannelHandlerFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected