MCPcopy Index your code
hub / github.com/devspace-sh/devspace / NewSessionFromStream

Function NewSessionFromStream

helper/tunnel/session.go:64–79  ·  view source on GitHub ↗
(id uuid.UUID, conn net.Conn)

Source from the content-addressed store, hash-verified

62}
63
64func NewSessionFromStream(id uuid.UUID, conn net.Conn) (*Session, error) {
65 ctx, cancel := context.WithCancel(context.Background())
66 r := &Session{
67 ID: id,
68 Conn: conn,
69 Context: ctx,
70 cancelFunc: cancel,
71 Buf: bytes.Buffer{},
72 Open: true,
73 }
74 err := addSession(r)
75 if err != nil {
76 return nil, err
77 }
78 return r, nil
79}
80
81func addSession(r *Session) error {
82 if _, ok := GetSession(r.ID); ok {

Callers 1

ReceiveDataFunction · 0.92

Calls 1

addSessionFunction · 0.85

Tested by

no test coverage detected