Skip to content

Commit 47e8f87

Browse files
firewalldb: export FirewallDBs interface
1 parent 0b24e2a commit 47e8f87

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

firewalldb/db.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,21 @@ var (
1414
ErrNoSuchKeyFound = fmt.Errorf("no such key found")
1515
)
1616

17-
// firewallDBs is an interface that groups the RulesDB and PrivacyMapper
18-
// interfaces.
19-
type firewallDBs interface {
20-
RulesDB
21-
PrivacyMapper
22-
ActionDB
23-
}
24-
2517
// DB manages the firewall rules database.
2618
type DB struct {
2719
started sync.Once
2820
stopped sync.Once
2921

30-
firewallDBs
22+
FirewallDBs
3123

3224
cancel fn.Option[context.CancelFunc]
3325
}
3426

3527
// NewDB creates a new firewall database. For now, it only contains the
3628
// underlying rules' and privacy mapper databases.
37-
func NewDB(dbs firewallDBs) *DB {
29+
func NewDB(dbs FirewallDBs) *DB {
3830
return &DB{
39-
firewallDBs: dbs,
31+
FirewallDBs: dbs,
4032
}
4133
}
4234

firewalldb/interface.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,11 @@ type ActionDB interface {
134134
// and feature name.
135135
GetActionsReadDB(groupID session.ID, featureName string) ActionsReadDB
136136
}
137+
138+
// FirewallDBs is an interface that groups the RulesDB, PrivacyMapper and
139+
// ActionDB interfaces.
140+
type FirewallDBs interface {
141+
RulesDB
142+
PrivacyMapper
143+
ActionDB
144+
}

0 commit comments

Comments
 (0)