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

Method KeysAfterPriority

service/ai-key/iml.go:71–81  ·  view source on GitHub ↗
(ctx context.Context, providerId string, priority int)

Source from the content-addressed store, hash-verified

69}
70
71func (i *imlAIKeyService) KeysAfterPriority(ctx context.Context, providerId string, priority int) ([]*Key, error) {
72 list, err := i.store.ListQuery(ctx, "sort > ? and provider = ?", []interface{}{priority, providerId}, "sort asc")
73 if err != nil {
74 return nil, err
75 }
76 var result []*Key
77 for _, item := range list {
78 result = append(result, FromEntity(item))
79 }
80 return result, nil
81}
82
83func (i *imlAIKeyService) MaxPriority(ctx context.Context, providerId string) (int, error) {
84 info, err := i.store.First(ctx, map[string]interface{}{"provider": providerId}, "sort desc")

Callers

nothing calls this directly

Calls 1

FromEntityFunction · 0.70

Tested by

no test coverage detected