cache

package
v1.1.0-rc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCacheMiss = errors.New("cache: key is missing")

Functions

func AddCacheFlagsToCmd added in v0.12.0

func AddCacheFlagsToCmd(cmd *cobra.Command) func() (*Cache, error)

AddCacheFlagsToCmd adds flags which control caching to the specified command

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache provides strongly types methods to store and retrieve values from shared cache

func NewCache added in v0.12.0

func NewCache(cacheClient CacheClient) *Cache

NewCache creates new instance of Cache

func (*Cache) GetAppDetails added in v0.12.0

func (c *Cache) GetAppDetails(commitSHA, path string, valueFiles []string, res interface{}) error

func (*Cache) GetAppManagedResources added in v0.12.0

func (c *Cache) GetAppManagedResources(appName string) ([]*appv1.ResourceDiff, error)

func (*Cache) GetAppResourcesTree added in v0.12.0

func (c *Cache) GetAppResourcesTree(appName string) (*appv1.ApplicationTree, error)

func (*Cache) GetClusterConnectionState added in v0.12.0

func (c *Cache) GetClusterConnectionState(server string) (appv1.ConnectionState, error)

func (*Cache) GetGitFile added in v0.12.0

func (c *Cache) GetGitFile(commitSha string, path string) ([]byte, error)

func (*Cache) GetGitListDir added in v0.12.0

func (c *Cache) GetGitListDir(commitSha string, path string) ([]string, error)

func (*Cache) GetManifests added in v0.12.0

func (c *Cache) GetManifests(commitSHA string, appSrc *appv1.ApplicationSource, namespace string, appLabelKey string, appLabelValue string, res interface{}) error

func (*Cache) GetOIDCState added in v0.12.0

func (c *Cache) GetOIDCState(key string) (*OIDCState, error)

func (*Cache) GetRepoConnectionState added in v0.12.0

func (c *Cache) GetRepoConnectionState(repo string) (appv1.ConnectionState, error)

func (*Cache) SetAppDetails added in v0.12.0

func (c *Cache) SetAppDetails(commitSHA, path string, valueFiles []string, res interface{}) error

func (*Cache) SetAppManagedResources added in v0.12.0

func (c *Cache) SetAppManagedResources(appName string, managedResources []*appv1.ResourceDiff) error

func (*Cache) SetAppResourcesTree added in v0.12.0

func (c *Cache) SetAppResourcesTree(appName string, resourcesTree *appv1.ApplicationTree) error

func (*Cache) SetClusterConnectionState added in v0.12.0

func (c *Cache) SetClusterConnectionState(server string, state *appv1.ConnectionState) error

func (*Cache) SetGitFile added in v0.12.0

func (c *Cache) SetGitFile(commitSha string, path string, data []byte) error

func (*Cache) SetListDir added in v0.12.0

func (c *Cache) SetListDir(commitSha string, path string, files []string) error

func (*Cache) SetManifests added in v0.12.0

func (c *Cache) SetManifests(commitSHA string, appSrc *appv1.ApplicationSource, namespace string, appLabelKey string, appLabelValue string, res interface{}) error

func (*Cache) SetOIDCState added in v0.12.0

func (c *Cache) SetOIDCState(key string, state *OIDCState) error

func (*Cache) SetRepoConnectionState added in v0.12.0

func (c *Cache) SetRepoConnectionState(repo string, state *appv1.ConnectionState) error

type CacheClient added in v0.12.0

type CacheClient interface {
	Set(item *Item) error
	Get(key string, obj interface{}) error
	Delete(key string) error
}

func NewRedisCache

func NewRedisCache(client *redis.Client, expiration time.Duration) CacheClient

type InMemoryCache added in v0.9.0

type InMemoryCache struct {
	// contains filtered or unexported fields
}

func NewInMemoryCache

func NewInMemoryCache(expiration time.Duration) *InMemoryCache

func (*InMemoryCache) Delete added in v0.11.0

func (i *InMemoryCache) Delete(key string) error

func (*InMemoryCache) Flush added in v0.9.0

func (i *InMemoryCache) Flush()

func (*InMemoryCache) Get added in v0.9.0

func (i *InMemoryCache) Get(key string, obj interface{}) error

func (*InMemoryCache) Set added in v0.9.0

func (i *InMemoryCache) Set(item *Item) error

type Item

type Item struct {
	Key    string
	Object interface{}
	// Expiration is the cache expiration time.
	Expiration time.Duration
}

type OIDCState added in v0.12.0

type OIDCState struct {
	// ReturnURL is the URL in which to redirect a user back to after completing an OAuth2 login
	ReturnURL string `json:"returnURL"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL