MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Prefix

Method Prefix

module/ai-api/iml.go:359–371  ·  view source on GitHub ↗
(ctx context.Context, serviceId string)

Source from the content-addressed store, hash-verified

357}
358
359func (i *imlAPIModule) Prefix(ctx context.Context, serviceId string) (string, error) {
360 pInfo, err := i.serviceService.Check(ctx, serviceId, map[string]bool{"as_server": true})
361 if err != nil {
362 return "", err
363 }
364
365 if pInfo.Prefix != "" {
366 if pInfo.Prefix[0] != '/' {
367 pInfo.Prefix = fmt.Sprintf("/%s", strings.TrimSuffix(pInfo.Prefix, "/"))
368 }
369 }
370 return strings.TrimSuffix(pInfo.Prefix, "/"), nil
371}
372
373func (i *imlAPIModule) OnInit() {
374 ctx := context.Background()

Callers

nothing calls this directly

Calls 1

CheckMethod · 0.65

Tested by

no test coverage detected