MCPcopy
hub / github.com/cli/cli / NewTemplateManager

Function NewTemplateManager

pkg/cmd/pr/shared/templates.go:144–155  ·  view source on GitHub ↗
(httpClient *http.Client, repo ghrepo.Interface, p iprompter, dir string, allowFS bool, isPR bool)

Source from the content-addressed store, hash-verified

142}
143
144func NewTemplateManager(httpClient *http.Client, repo ghrepo.Interface, p iprompter, dir string, allowFS bool, isPR bool) *templateManager {
145 cachedClient := api.NewCachedHTTPClient(httpClient, time.Hour*24)
146 return &templateManager{
147 repo: repo,
148 rootDir: dir,
149 allowFS: allowFS,
150 isPR: isPR,
151 httpClient: httpClient,
152 prompter: p,
153 detector: fd.NewDetector(cachedClient, repo.RepoHost()),
154 }
155}
156
157func (m *templateManager) hasAPI() (bool, error) {
158 if !m.isPR {

Callers 1

createRunFunction · 0.92

Calls 2

NewCachedHTTPClientFunction · 0.92
RepoHostMethod · 0.65

Tested by

no test coverage detected