Documentation
¶
Index ¶
- Constants
- func ClearBindingPolicyCache() error
- func DeleteAllBindingPolicies() error
- func DeleteBindingPolicy(name string) error
- func DeleteBpcmd(name string) error
- func GetAllJSONHash(hashKey string) (map[string]json.RawMessage, error)
- func GetBranch() (string, error)
- func GetFilePath() (string, error)
- func GetGitToken() (string, error)
- func GetJSONHash(hashKey string, field string, dest interface{}) (bool, error)
- func GetJSONValue(key string, dest interface{}) (bool, error)
- func GetNamespaceCache(key string) (string, error)
- func GetRepoURL() (string, error)
- func GetWorkloadLabel() (string, error)
- func GetallBpCmd() ([]string, error)
- func SetBpCmd(name string, bpJson string) error
- func SetBranch(branch string) error
- func SetFilePath(filepath string) error
- func SetGitToken(token string) error
- func SetJSONHash(hashKey string, field string, value interface{}) error
- func SetJSONValue(key string, value interface{}, expiration time.Duration) error
- func SetNamespaceCache(key string, value string, expiration time.Duration) error
- func SetRepoURL(repoURL string) error
- func SetWorkloadLabel(label string) error
- func StoreBindingPolicy(policy *BindingPolicyCache) error
- type BindingPolicyCache
- type WorkloadInfo
Constants ¶
const ( BindingPolicyHashKey = "binding_policies" DefaultExpiration = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func ClearBindingPolicyCache ¶
func ClearBindingPolicyCache() error
ClearBindingPolicyCache clears the entire binding policy cache
func DeleteAllBindingPolicies ¶
func DeleteAllBindingPolicies() error
DeleteAllBindingPolicies removes all binding policies from Redis
func DeleteBindingPolicy ¶
DeleteBindingPolicy removes a binding policy from Redis
func GetAllJSONHash ¶
func GetAllJSONHash(hashKey string) (map[string]json.RawMessage, error)
GetAllJSONHash retrieves all JSON values from a Redis hash hashKey: The Redis hash key Returns a map of field names to unmarshaled JSON values
func GetFilePath ¶
GetFilePath retrieves the file path from Redis
func GetGitToken ¶
func GetJSONHash ¶
GetJSONHash retrieves a JSON value from a Redis hash and unmarshals it hashKey: The Redis hash key field: The field within the hash dest: Pointer to a struct or map where the unmarshaled JSON will be stored Returns true if the field was found, false if it was not found
func GetJSONValue ¶
GetJSONValue retrieves a JSON value from Redis and unmarshals it into the provided destination key: Redis key to retrieve dest: Pointer to a struct or map where the unmarshaled JSON will be stored Returns true if the key was found, false if it was a cache miss
func GetNamespaceCache ¶
GetNamespaceCache retrieves cached namespace data from Redis
func GetRepoURL ¶
func GetWorkloadLabel ¶
GetWorkloadLabel gets the workload label from Redis
func SetGitToken ¶
func SetJSONHash ¶
SetJSONHash stores a JSON value in a Redis hash hashKey: The Redis hash key field: The field within the hash value: Any Go struct or map that can be marshalled to JSON
func SetJSONValue ¶
SetJSONValue sets a JSON value in Redis with an optional expiration key: Redis key to store the JSON under value: Any Go struct or map that can be marshalled to JSON expiration: Time until the key expires (0 for no expiration)
func SetNamespaceCache ¶
SetNamespaceCache sets a namespace data cache in Redis
func SetRepoURL ¶
func SetWorkloadLabel ¶
SetWorkloadLabel stores the workload label in Redis
func StoreBindingPolicy ¶
func StoreBindingPolicy(policy *BindingPolicyCache) error
StoreBindingPolicy stores a binding policy in Redis with proper type handling
Types ¶
type BindingPolicyCache ¶
type BindingPolicyCache struct { Name string `json:"name"` Namespace string `json:"namespace"` ClusterSelectors []map[string]string `json:"clusterSelectors"` APIGroups []string `json:"apiGroups"` Resources []string `json:"resources"` Namespaces []string `json:"namespaces"` SpecificWorkloads []WorkloadInfo `json:"specificWorkloads"` RawYAML string `json:"rawYAML"` Status string `json:"status"` BindingMode string `json:"bindingMode"` Clusters []string `json:"clusters"` Workloads []string `json:"workloads"` CreationTimestamp string `json:"creationTimestamp"` }
BindingPolicyCache represents a binding policy in the cache
func GetAllBindingPolicies ¶
func GetAllBindingPolicies() ([]*BindingPolicyCache, error)
GetAllBindingPolicies retrieves all binding policies from Redis
func GetBindingPolicy ¶
func GetBindingPolicy(name string) (*BindingPolicyCache, error)
GetBindingPolicy retrieves a binding policy from Redis by name