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

Method Defines

service/plugin-cluster/iml.go:124–141  ·  view source on GitHub ↗
(ctx context.Context, kind ...plugin_model.Kind)

Source from the content-addressed store, hash-verified

122}
123
124func (i *imlPluginService) Defines(ctx context.Context, kind ...plugin_model.Kind) ([]*PluginDefine, error) {
125 if len(kind) == 0 {
126 list, err := i.defineStore.List(ctx, map[string]interface{}{}, "sort asc")
127 if err != nil {
128 return nil, err
129 }
130 return utils.SliceToSlice(list, FromEntity), nil
131
132 } else {
133 list, err := i.defineStore.List(ctx, map[string]interface{}{
134 "kind": kind[0],
135 }, "sort asc")
136 if err != nil {
137 return nil, err
138 }
139 return utils.SliceToSlice(list, FromEntity), nil
140 }
141}
142
143func (i *imlPluginService) Options(ctx context.Context) []*PluginOption {
144 list, err := i.defineStore.List(ctx, map[string]interface{}{

Callers 1

ListClusterMethod · 0.95

Calls 1

ListMethod · 0.65

Tested by

no test coverage detected