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

Function newKey

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

Source from the content-addressed store, hash-verified

41)
42
43func newKey(key *ai_key.Key) *gateway.DynamicRelease {
44
45 return &gateway.DynamicRelease{
46 BasicItem: &gateway.BasicItem{
47 ID: fmt.Sprintf("%s-%s", key.Provider, key.ID),
48 Description: key.Name,
49 Resource: "ai-key",
50 Version: time.Now().Format("20060102150405"),
51 MatchLabels: map[string]string{
52 "module": "ai-key",
53 },
54 },
55 Attr: map[string]interface{}{
56 "expired": key.ExpireTime,
57 "config": key.Config,
58 "provider": key.Provider,
59 "priority": key.Priority,
60 "disabled": key.Status == 0,
61 },
62 }
63}
64
65var _ IProviderModule = (*imlProviderModule)(nil)
66

Callers 2

DeleteMethod · 0.70
UpdateProviderConfigMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected