MCPcopy
hub / github.com/charmbracelet/soft-serve / FromContext

Function FromContext

pkg/backend/context.go:9–15  ·  view source on GitHub ↗

FromContext returns the backend from a context.

(ctx context.Context)

Source from the content-addressed store, hash-verified

7
8// FromContext returns the backend from a context.
9func FromContext(ctx context.Context) *Backend {
10 if b, ok := ctx.Value(ContextKey).(*Backend); ok {
11 return b
12 }
13
14 return nil
15}
16
17// WithContext returns a new context with the backend attached.
18func WithContext(ctx context.Context, b *Backend) context.Context {

Callers 15

FuncMethod · 0.92
AuthenticationMiddlewareFunction · 0.92
NewSSHServerFunction · 0.92
SessionHandlerFunction · 0.92
PubkeyCommandFunction · 0.92
renameCommandFunction · 0.92
hiddenCommandFunction · 0.92
treeCommandFunction · 0.92
branchListCommandFunction · 0.92
branchDefaultCommandFunction · 0.92
branchDeleteCommandFunction · 0.92
gitRunEFunction · 0.92

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected