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

Method Online

gateway/apinto/subscribe.go:20–31  ·  view source on GitHub ↗
(ctx context.Context, resources ...*gateway.SubscribeRelease)

Source from the content-addressed store, hash-verified

18const KeySubscribeService = "subscription_service"
19
20func (s *SubscribeClient) Online(ctx context.Context, resources ...*gateway.SubscribeRelease) error {
21 s.client.Begin(ctx)
22 var err error
23 for _, r := range resources {
24 err = s.client.HSet(ctx, fmt.Sprintf("%s:%s", KeySubscribeService, r.Application), r.Service, r.Expired)
25 if err != nil {
26 s.client.Rollback(ctx)
27 return err
28 }
29 }
30 return s.client.Commit(ctx)
31}
32
33func (s *SubscribeClient) Offline(ctx context.Context, resources ...*gateway.SubscribeRelease) error {
34 s.client.Begin(ctx)

Callers

nothing calls this directly

Calls 3

BeginMethod · 0.65
RollbackMethod · 0.65
CommitMethod · 0.65

Tested by

no test coverage detected