Documentation ¶
Index ¶
- type Cache
- type Data
- type ProfileCache
- func (c *ProfileCache) Delete(ctx context.Context, helmRepoNamespace, helmRepoName string) error
- func (c *ProfileCache) GetProfileValues(ctx context.Context, ...) ([]byte, error)
- func (c *ProfileCache) ListAvailableVersionsForProfile(ctx context.Context, helmRepoNamespace, helmRepoName, profileName string) ([]string, error)
- func (c *ProfileCache) ListProfiles(ctx context.Context, helmRepoNamespace, helmRepoName string) ([]*pb.Profile, error)
- func (c *ProfileCache) Put(ctx context.Context, helmRepoNamespace, helmRepoName string, value Data) error
- type ValueMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Put(ctx context.Context, helmRepoNamespace, helmRepoName string, value Data) error Delete(ctx context.Context, helmRepoNamespace, helmRepoName string) error // ListProfiles specifically retrieve profiles data only to avoid traversing the values structure for no reason. ListProfiles(ctx context.Context, helmRepoNamespace, helmRepoName string) ([]*pb.Profile, error) // GetProfileValues will try and find a specific values file for the given profileName and profileVersion. Returns an // error if said version is not found. GetProfileValues(ctx context.Context, helmRepoNamespace, helmRepoName, profileName, profileVersion string) ([]byte, error) // ListAvailableVersionsForProfile returns all stored available versions for a profile. ListAvailableVersionsForProfile(ctx context.Context, helmRepoNamespace, helmRepoName, profileName string) ([]string, error) }
Cache defines an interface to work with the profile data cacher.
type Data ¶
Data is explicit data for a specific profile including values. Saved as `profiles.yaml` and `profileName/version/values.yaml`.
type ProfileCache ¶
type ProfileCache struct {
// contains filtered or unexported fields
}
ProfileCache is used to cache profiles data from scanner helm repositories.
func NewCache ¶
func NewCache(cacheLocation string) (*ProfileCache, error)
NewCache initialises the cache and returns it.
func (*ProfileCache) Delete ¶
func (c *ProfileCache) Delete(ctx context.Context, helmRepoNamespace, helmRepoName string) error
Delete clears the cache folder for a specific HelmRepository. It will only clear the innermost folder so others in the same namespace may retain their values.
func (*ProfileCache) GetProfileValues ¶
func (c *ProfileCache) GetProfileValues(ctx context.Context, helmRepoNamespace, helmRepoName, profileName, profileVersion string) ([]byte, error)
GetProfileValues returns the content of the cached values file if it exists. Errors otherwise.
func (*ProfileCache) ListAvailableVersionsForProfile ¶ added in v0.7.0
func (c *ProfileCache) ListAvailableVersionsForProfile(ctx context.Context, helmRepoNamespace, helmRepoName, profileName string) ([]string, error)
ListAvailableVersionsForProfile returns all stored available versions for a profile.
func (*ProfileCache) ListProfiles ¶
func (c *ProfileCache) ListProfiles(ctx context.Context, helmRepoNamespace, helmRepoName string) ([]*pb.Profile, error)
ListProfiles gathers all profiles for a helmRepo if found. Returns an error otherwise.