• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Permify / permify / 7320640164

25 Dec 2023 09:07AM UTC coverage: 73.016% (-4.2%) from 77.26%
7320640164

push

github

web-flow
Merge pull request #937 from neo773/data-bundles

feat: Implement Data Bundles for Memory DB

34 of 74 new or added lines in 9 files covered. (45.95%)

2 existing lines in 1 file now uncovered.

6708 of 9187 relevant lines covered (73.02%)

50.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/internal/storage/memory/bundleReader.go
1
package memory
2

3
import (
4
        "context"
5
        "errors"
6

7
        "github.com/Permify/permify/internal/storage"
8
        "github.com/Permify/permify/internal/storage/memory/constants"
9

10
        db "github.com/Permify/permify/pkg/database/memory"
11
        base "github.com/Permify/permify/pkg/pb/base/v1"
12
)
13

14
// BundleReader -
15
type BundleReader struct {
16
        database *db.Memory
17
}
18

19
func NewBundleReader(database *db.Memory) *BundleReader {
4✔
20
        return &BundleReader{
4✔
21
                database: database,
4✔
22
        }
4✔
23
}
4✔
24

25
func (b *BundleReader) Read(ctx context.Context, tenantID, name string) (bundle *base.DataBundle, err error) {
7✔
26
        txn := b.database.DB.Txn(false)
7✔
27
        defer txn.Abort()
7✔
28
        var raw interface{}
7✔
29
        raw, err = txn.First(constants.BundlesTable, "id", tenantID, name)
7✔
30
        if err != nil {
7✔
NEW
31
                return bundle, errors.New(base.ErrorCode_ERROR_CODE_EXECUTION.String())
×
NEW
32
        }
×
33

34
        bun, ok := raw.(storage.Bundle)
7✔
35
        if ok {
12✔
36
                return bun.DataBundle, err
5✔
37
        }
5✔
38

39
        return nil, errors.New(base.ErrorCode_ERROR_CODE_BUNDLE_NOT_FOUND.String())
2✔
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc