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

Method Get

module/strategy/iml.go:213–229  ·  view source on GitHub ↗
(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

211}
212
213func (i *imlStrategyModule) Get(ctx context.Context, id string) (*strategy_dto.Strategy, error) {
214 info, err := i.strategyService.Get(ctx, id)
215 if err != nil {
216 return nil, err
217 }
218 s := strategy_dto.ToStrategy(info)
219 for _, f := range s.Filters {
220 ff, has := strategy_filter.FilterGet(f.Name)
221 if !has {
222 return nil, fmt.Errorf("filter not found: %s", f.Name)
223 }
224 f.Title = ff.Title()
225 f.Type = ff.Type()
226 f.Label = strings.Join(ff.Labels(f.Values...), ",")
227 }
228 return s, nil
229}
230
231func (i *imlStrategyModule) Create(ctx context.Context, input *strategy_dto.Create) error {
232 if input.Name == "" {

Callers

nothing calls this directly

Calls 4

GetMethod · 0.65
TitleMethod · 0.65
TypeMethod · 0.65
LabelsMethod · 0.65

Tested by

no test coverage detected