MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / tutorialsClient

Method tutorialsClient

internal/server/tutorials.go:94–99  ·  view source on GitHub ↗

tutorialsClient is the outbound client, replaceable in tests. A dedicated client with its own timeout; a nil Transport is http.DefaultTransport.

()

Source from the content-addressed store, hash-verified

92// tutorialsClient is the outbound client, replaceable in tests. A dedicated
93// client with its own timeout; a nil Transport is http.DefaultTransport.
94func (s *Server) tutorialsClient() *http.Client {
95 if s.tutorialsHTTP != nil {
96 return s.tutorialsHTTP
97 }
98 return &http.Client{Timeout: tutorialsFetchTimeout}
99}
100
101func (s *Server) fetchTutorialBytes(ctx context.Context, url string, limit int64) ([]byte, string, error) {
102 ctx, cancel := context.WithTimeout(ctx, tutorialsFetchTimeout)

Callers 1

fetchTutorialBytesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected