policy-engine/interface.go
aarifullin 76372aac04 [#13] interface: Add methods to CachedChainStorage interface
* Introduce GetOverride, RemoveOverride, ListOverrides
* Implement them in inmemory struct

Signed-off-by: aarifullin <aarifullin@yadro.com>
2023-10-31 17:21:34 +03:00

18 lines
772 B
Go

package policyengine
// CachedChainStorage ...
type CachedChainStorage interface {
Engine
// Adds a policy chain used for all operations with a specific resource.
AddResourceChain(name Name, resource string, c *Chain)
// Adds a policy chain used for all operations in the namespace.
AddNameSpaceChain(name Name, namespace string, c *Chain)
// Adds a local policy chain used for all operations with this service.
AddOverride(name Name, c *Chain)
// Gets the local override with given chain id.
GetOverride(name Name, chainID ChainID) (chain *Chain, found bool)
// Remove the local override with given chain id.
RemoveOverride(name Name, chainID ChainID) (removed bool)
// ListOverrides returns the list of local overrides.
ListOverrides(name Name) []*Chain
}