MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / Run

Method Run

internal/doctor/checks.go:124–148  ·  view source on GitHub ↗
(_ context.Context, r Reporter)

Source from the content-addressed store, hash-verified

122
123func (c EndpointFormatCheck) Name() string { return "Endpoint Format Check" }
124func (c EndpointFormatCheck) Run(_ context.Context, r Reporter) Result {
125 res := Result{}
126 if len(c.File.Endpoints) == 0 {
127 r.Info("No endpoints to check")
128 return res
129 }
130 for _, name := range c.File.SortedNames() {
131 ep := c.File.Endpoints[name]
132 if ep.Endpoint == "" {
133 res.Issues++
134 r.Warn(fmt.Sprintf("%s has no endpoint URL", name),
135 "Add a provider endpoint with 'cam provider add NAME --endpoint URL'")
136 continue
137 }
138 parsed, err := url.Parse(ep.Endpoint)
139 if err != nil || (parsed.Scheme != "http" && parsed.Scheme != "https") {
140 res.Issues++
141 r.Fail(fmt.Sprintf("%s endpoint URL invalid: %s", name, ep.Endpoint),
142 "Use http:// or https://")
143 continue
144 }
145 r.Pass(fmt.Sprintf("%s endpoint URL format is valid", name))
146 }
147 return res
148}
149
150// CacheCheck reports the size of the CAM cache directory.
151type CacheCheck struct {

Callers

nothing calls this directly

Calls 5

SortedNamesMethod · 0.80
InfoMethod · 0.65
WarnMethod · 0.65
FailMethod · 0.65
PassMethod · 0.65

Tested by

no test coverage detected