Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveStores ¶
type ActiveStores struct {
// The structure of the map is as follows:
// The first level maps from scope to stores
// The second level maps from store name to store
// Example:
// {
// "namespace1": {
// "store1": store1,
// "store2": store2
// }
// }
// Note: Scope is utilized for organizing and isolating stores. In a Kubernetes (K8s) environment, the scope can be either a namespace or an empty string ("") for cluster-wide stores.
ScopedStores sync.Map
}
ActiveStores implements the ReferrerStoreManager interface.
func (*ActiveStores) AddStore ¶
func (s *ActiveStores) AddStore(scope, storeName string, store referrerstore.ReferrerStore)
AddStore fulfills the ReferrerStoreManager interface. It adds the given store under the given scope.
func (*ActiveStores) DeleteStore ¶
func (s *ActiveStores) DeleteStore(scope, storeName string)
DeleteStore fulfills the ReferrerStoreManager interface. It deletes the store with the given name under the given scope.
func (*ActiveStores) GetStores ¶
func (s *ActiveStores) GetStores(scope string) []referrerstore.ReferrerStore
GetStores fulfills the ReferrerStoreManager interface. It returns all the stores in the ActiveStores for the given scope. If no stores are found for the given scope, it returns cluster-wide stores.
type ReferrerStoreManager ¶
type ReferrerStoreManager interface {
// Stores returns the list of referrer stores for the given scope.
GetStores(scope string) []referrerstore.ReferrerStore
// AddStore adds the given store under the given scope.
AddStore(scope, storeName string, store referrerstore.ReferrerStore)
// DeleteStore deletes the policy from the given scope.
DeleteStore(scope, storeName string)
}
ReferrerStoreManager is an interface that defines the methods for managing referrer stores across different scopes.
func NewActiveStores ¶
func NewActiveStores() ReferrerStoreManager
Click to show internal directories.
Click to hide internal directories.