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

Method Offline

gateway/apinto/hash.go:36–55  ·  view source on GitHub ↗
(ctx context.Context, resources ...*gateway.HashRelease)

Source from the content-addressed store, hash-verified

34}
35
36func (s *HashClient) Offline(ctx context.Context, resources ...*gateway.HashRelease) error {
37 s.client.Begin(ctx)
38 for _, r := range resources {
39 if len(r.HashMap) == 0 {
40 err := s.client.HDelAll(ctx, r.HashKey)
41 if err != nil {
42 s.client.Rollback(ctx)
43 return err
44 }
45 }
46 for key, _ := range r.HashMap {
47 err := s.client.HDel(ctx, r.HashKey, key)
48 if err != nil {
49 s.client.Rollback(ctx)
50 return err
51 }
52 }
53 }
54 return s.client.Commit(ctx)
55}
56
57func NewHashClient(client admin_client.Client) *HashClient {
58 return &HashClient{client: client}

Callers

nothing calls this directly

Calls 3

BeginMethod · 0.65
RollbackMethod · 0.65
CommitMethod · 0.65

Tested by

no test coverage detected