(key *ai_key.Key)
| 39 | } |
| 40 | |
| 41 | func newKey(key *ai_key.Key) *gateway.DynamicRelease { |
| 42 | |
| 43 | return &gateway.DynamicRelease{ |
| 44 | BasicItem: &gateway.BasicItem{ |
| 45 | ID: fmt.Sprintf("%s-%s", key.Provider, key.ID), |
| 46 | Description: key.Name, |
| 47 | Resource: "ai-key", |
| 48 | Version: time.Now().Format("20060102150405"), |
| 49 | MatchLabels: map[string]string{ |
| 50 | "module": "ai-key", |
| 51 | }, |
| 52 | }, |
| 53 | Attr: map[string]interface{}{ |
| 54 | "expired": key.ExpireTime, |
| 55 | "config": key.Config, |
| 56 | "provider": key.Provider, |
| 57 | "priority": key.Priority, |
| 58 | "disabled": key.Status == 0, |
| 59 | }, |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | func (i *imlKeyModule) Create(ctx context.Context, providerId string, input *ai_key_dto.Create) error { |
| 64 | _, err := i.providerService.Get(ctx, providerId) |
no outgoing calls
no test coverage detected