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

Function newKey

module/ai-key/iml.go:41–61  ·  view source on GitHub ↗
(key *ai_key.Key)

Source from the content-addressed store, hash-verified

39}
40
41func 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
63func (i *imlKeyModule) Create(ctx context.Context, providerId string, input *ai_key_dto.Create) error {
64 _, err := i.providerService.Get(ctx, providerId)

Callers 4

CreateMethod · 0.70
EditMethod · 0.70
UpdateKeyStatusMethod · 0.70
SortMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected