MCPcopy
hub / github.com/github/github-mcp-server / stubDeps

Struct stubDeps

pkg/github/server_test.go:28–38  ·  view source on GitHub ↗

stubDeps is a test helper that implements ToolDependencies with configurable behavior. Use this when you need to test error paths or when you need closure-based client creation.

Source from the content-addressed store, hash-verified

26// stubDeps is a test helper that implements ToolDependencies with configurable behavior.
27// Use this when you need to test error paths or when you need closure-based client creation.
28type stubDeps struct {
29 clientFn func(context.Context) (*gogithub.Client, error)
30 gqlClientFn func(context.Context) (*githubv4.Client, error)
31 rawClientFn func(context.Context) (*raw.Client, error)
32
33 repoAccessCache *lockdown.RepoAccessCache
34 t translations.TranslationHelperFunc
35 flags FeatureFlags
36 contentWindowSize int
37 obsv observability.Exporters
38}
39
40func (s stubDeps) GetClient(ctx context.Context) (*gogithub.Client, error) {
41 if s.clientFn != nil {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected