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

Function ToStrategy

module/strategy/dto/output.go:58–72  ·  view source on GitHub ↗
(s *strategy.Strategy)

Source from the content-addressed store, hash-verified

56}
57
58func ToStrategy(s *strategy.Strategy) *Strategy {
59 filters := make([]*Filter, 0)
60 json.Unmarshal([]byte(s.Filters), &filters)
61 var cfg interface{}
62 json.Unmarshal([]byte(s.Config), &cfg)
63 return &Strategy{
64 Id: s.Id,
65 Name: s.Name,
66 Priority: s.Priority,
67 Desc: s.Desc,
68 Filters: filters,
69 Config: cfg,
70 IsDelete: s.IsDelete || s.IsStop,
71 }
72}
73
74type Strategy struct {
75 Id string `json:"id"`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected