MCPcopy Index your code
hub / github.com/HoneyLLM/cli2ssh / NewSession

Function NewSession

internal/args/args.go:23–39  ·  view source on GitHub ↗
(s ssh.Session)

Source from the content-addressed store, hash-verified

21}
22
23func NewSession(s ssh.Session) *Session {
24 user := s.User()
25 host, port, _ := net.SplitHostPort(s.RemoteAddr().String())
26 var publicKey string
27 if pk := s.PublicKey(); pk != nil {
28 publicKey = utils.StringifyPublicKey(pk)
29 }
30 return &Session{
31 User: user,
32 Host: host,
33 Port: port,
34 Command: s.RawCommand(),
35 Subsystem: s.Subsystem(),
36 PublicKey: publicKey,
37 RemoteAddr: s.RemoteAddr().String(),
38 }
39}
40
41func (s *Session) FormatArg(arg string) string {
42 return formatTemplate(arg, s)

Callers 1

mainFunction · 0.92

Calls 2

StringifyPublicKeyFunction · 0.92
StringMethod · 0.80

Tested by

no test coverage detected