MCPcopy
hub / github.com/gliderlabs/ssh / newContext

Function newContext

context.go:102–109  ·  view source on GitHub ↗
(srv *Server)

Source from the content-addressed store, hash-verified

100}
101
102func newContext(srv *Server) (*sshContext, context.CancelFunc) {
103 innerCtx, cancel := context.WithCancel(context.Background())
104 ctx := &sshContext{Context: innerCtx, Mutex: &sync.Mutex{}, values: make(map[interface{}]interface{})}
105 ctx.SetValue(ContextKeyServer, srv)
106 perms := &Permissions{&gossh.Permissions{}}
107 ctx.SetValue(ContextKeyPermissions, perms)
108 return ctx, cancel
109}
110
111// this is separate from newContext because we will get ConnMetadata
112// at different points so it needs to be applied separately

Callers 2

HandleConnMethod · 0.85
TestSetValueConcurrencyFunction · 0.85

Calls 1

SetValueMethod · 0.95

Tested by 1

TestSetValueConcurrencyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…