MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Get

Method Get

module/ai-key/iml.go:255–275  ·  view source on GitHub ↗
(ctx context.Context, providerId string, id string)

Source from the content-addressed store, hash-verified

253}
254
255func (i *imlKeyModule) Get(ctx context.Context, providerId string, id string) (*ai_key_dto.Key, error) {
256 p, has := model_runtime.GetProvider(providerId)
257 if !has {
258 return nil, fmt.Errorf("provider not found: %s", providerId)
259 }
260 _, err := i.providerService.Get(ctx, providerId)
261 if err != nil {
262 return nil, fmt.Errorf("provider not found: %w", err)
263 }
264 info, err := i.aiKeyService.Get(ctx, id)
265 if err != nil {
266 return nil, fmt.Errorf("key not found: %w", err)
267 }
268
269 return &ai_key_dto.Key{
270 Id: info.ID,
271 Name: info.Name,
272 Config: p.MaskConfig(info.Config),
273 ExpireTime: info.ExpireTime,
274 }, nil
275}
276
277func (i *imlKeyModule) List(ctx context.Context, providerId string, keyword string, page, pageSize int, statuses []string) ([]*ai_key_dto.Item, int64, error) {
278 _, err := i.aiKeyService.DefaultKey(ctx, providerId)

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
MaskConfigMethod · 0.65

Tested by

no test coverage detected