MCPcopy Create free account
hub / github.com/devspace-sh/devspace / NewSession

Function NewSession

helper/tunnel/session.go:47–62  ·  view source on GitHub ↗
(conn net.Conn)

Source from the content-addressed store, hash-verified

45}
46
47func NewSession(conn net.Conn) (*Session, error) {
48 ctx, cancel := context.WithCancel(context.Background())
49 r := &Session{
50 ID: uuid.New(),
51 Conn: conn,
52 Context: ctx,
53 cancelFunc: cancel,
54 Buf: bytes.Buffer{},
55 Open: true,
56 }
57 err := addSession(r)
58 if err != nil {
59 return nil, err
60 }
61 return r, nil
62}
63
64func NewSessionFromStream(id uuid.UUID, conn net.Conn) (*Session, error) {
65 ctx, cancel := context.WithCancel(context.Background())

Callers 1

InitTunnelMethod · 0.85

Calls 1

addSessionFunction · 0.85

Tested by

no test coverage detected