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

Method CommitStrategy

service/strategy/iml.go:70–87  ·  view source on GitHub ↗
(ctx context.Context, scope string, target string, strategyId string, data *Strategy)

Source from the content-addressed store, hash-verified

68}
69
70func (i *imlStrategyService) CommitStrategy(ctx context.Context, scope string, target string, strategyId string, data *Strategy) error {
71 key := scope
72 if target != "" {
73 key = fmt.Sprintf("%s-%s", scope, target)
74 }
75
76 return i.commitService.Save(ctx, strategyId, key, &Commit{
77 Id: data.Id,
78 Name: data.Name,
79 Priority: data.Priority,
80 Filters: data.Filters,
81 Config: data.Config,
82 Driver: data.Driver,
83 IsDelete: data.IsDelete,
84 IsStop: data.IsStop,
85 Version: data.UpdateAt.Format("20060102150405"),
86 })
87}
88
89func (i *imlStrategyService) GetStrategyCommit(ctx context.Context, commitId string) (*commit.Commit[Commit], error) {
90 return i.commitService.Get(ctx, commitId)

Callers

nothing calls this directly

Calls 1

SaveMethod · 0.65

Tested by

no test coverage detected