[#13] chain: Introduce ChainID type

Signed-off-by: aarifullin <aarifullin@yadro.com>
This commit is contained in:
aarifullin 2023-10-31 01:52:04 +03:00
parent 31a308ea61
commit 35f24627f0
2 changed files with 11 additions and 3 deletions

View file

@ -13,7 +13,12 @@ type Engine interface {
IsAllowed(name Name, namespace string, r Request) (Status, bool)
}
// ChainID is the ID of rule chain.
type ChainID string
type Chain struct {
ID ChainID
Rules []Rule
}

View file

@ -1,9 +1,12 @@
package policyengine
import "sync/atomic"
type inmemory struct {
namespace map[Name][]chain
resource map[Name][]chain
local map[Name][]*Chain
chainCounter atomic.Uint32
namespace map[Name][]chain
resource map[Name][]chain
local map[Name][]*Chain
}
type chain struct {