apiKeyToMap converts an APIKey model to a map for HSET.
(key *models.APIKey)
| 630 | |
| 631 | // apiKeyToMap converts an APIKey model to a map for HSET. |
| 632 | func (p *KeyProvider) apiKeyToMap(key *models.APIKey) map[string]any { |
| 633 | return map[string]any{ |
| 634 | "id": fmt.Sprint(key.ID), |
| 635 | "key_string": key.KeyValue, |
| 636 | "status": key.Status, |
| 637 | "failure_count": key.FailureCount, |
| 638 | "group_id": key.GroupID, |
| 639 | "created_at": key.CreatedAt.Unix(), |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | // pluckIDs extracts IDs from a slice of APIKey. |
| 644 | func pluckIDs(keys []models.APIKey) []uint { |
no outgoing calls
no test coverage detected