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

Method Offline

module/dynamic-module/iml.go:105–134  ·  view source on GitHub ↗
(ctx context.Context, module string, id string)

Source from the content-addressed store, hash-verified

103}
104
105func (i *imlDynamicModule) Offline(ctx context.Context, module string, id string) error {
106 _, has := driver.Get(module)
107 if !has {
108 return fmt.Errorf("模块【%s】不存在", module)
109 }
110 return i.transaction.Transaction(ctx, func(ctx context.Context) error {
111 id = strings.ToLower(fmt.Sprintf("%s_%s", id, module))
112 clusters, err := i.clusterService.List(ctx)
113 if err != nil {
114 return err
115 }
116 clusterIds := utils.SliceToSlice(clusters, func(s *cluster.Cluster) string {
117 return s.Uuid
118 })
119 for _, clusterId := range clusterIds {
120 err := i.dynamicClient(ctx, clusterId, module, func(dynamicClient gateway.IDynamicClient) error {
121 return dynamicClient.Offline(ctx, &gateway.DynamicRelease{
122 BasicItem: &gateway.BasicItem{
123 ID: id,
124 },
125 })
126 })
127 if err != nil {
128 return err
129 }
130
131 }
132 return nil
133 })
134}
135
136//
137//func (i *imlDynamicModule) PartitionStatuses(ctx context.Context, module string, keyword string, page int, pageSize int) (map[string]map[string]string, error) {

Callers

nothing calls this directly

Calls 4

dynamicClientMethod · 0.95
GetFunction · 0.92
ListMethod · 0.65
OfflineMethod · 0.65

Tested by

no test coverage detected