cache

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRemoteCache added in v0.3.5

func AddRemoteCache(cacheInfo CacheProvider) error

func RemoveRemoteCache added in v0.3.5

func RemoveRemoteCache() error

Types

type AzureCache added in v0.3.19

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

Generate ICache implementation

func (*AzureCache) Configure added in v0.3.22

func (s *AzureCache) Configure(cacheInfo CacheProvider) error

func (*AzureCache) DisableCache added in v0.3.22

func (s *AzureCache) DisableCache()

func (*AzureCache) Exists added in v0.3.19

func (s *AzureCache) Exists(key string) bool

func (*AzureCache) GetName added in v0.3.22

func (s *AzureCache) GetName() string

func (*AzureCache) IsCacheDisabled added in v0.3.19

func (s *AzureCache) IsCacheDisabled() bool

func (*AzureCache) List added in v0.3.19

func (s *AzureCache) List() ([]CacheObjectDetails, error)

func (*AzureCache) Load added in v0.3.19

func (s *AzureCache) Load(key string) (string, error)

func (*AzureCache) Remove added in v0.3.22

func (s *AzureCache) Remove(key string) error

func (*AzureCache) Store added in v0.3.19

func (s *AzureCache) Store(key string, data string) error

type AzureCacheConfiguration added in v0.3.22

type AzureCacheConfiguration struct {
	StorageAccount string `mapstructure:"storageaccount" yaml:"storageaccount,omitempty"`
	ContainerName  string `mapstructure:"container" yaml:"container,omitempty"`
}

type CacheObjectDetails added in v0.3.22

type CacheObjectDetails struct {
	Name      string
	UpdatedAt time.Time
}

type CacheProvider added in v0.3.3

type CacheProvider struct {
	GCS   GCSCacheConfiguration   `mapstructucre:"gcs" yaml:"gcs,omitempty"`
	Azure AzureCacheConfiguration `mapstructucre:"azure" yaml:"azure,omitempty"`
	S3    S3CacheConfiguration    `mapstructucre:"s3" yaml:"s3,omitempty"`
}

func NewCacheProvider added in v0.3.19

func NewCacheProvider(cacheType, bucketname, region, storageAccount, containerName, projectId string) (CacheProvider, error)

func ParseCacheConfiguration added in v0.3.22

func ParseCacheConfiguration() (CacheProvider, error)

type FileBasedCache

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

func (*FileBasedCache) Configure added in v0.3.22

func (f *FileBasedCache) Configure(cacheInfo CacheProvider) error

func (*FileBasedCache) DisableCache added in v0.3.22

func (s *FileBasedCache) DisableCache()

func (*FileBasedCache) Exists

func (*FileBasedCache) Exists(key string) bool

func (*FileBasedCache) GetName added in v0.3.22

func (s *FileBasedCache) GetName() string

func (*FileBasedCache) IsCacheDisabled added in v0.2.8

func (f *FileBasedCache) IsCacheDisabled() bool

func (*FileBasedCache) List added in v0.3.3

func (*FileBasedCache) Load

func (*FileBasedCache) Load(key string) (string, error)

func (*FileBasedCache) Remove added in v0.3.22

func (*FileBasedCache) Remove(key string) error

func (*FileBasedCache) Store

func (*FileBasedCache) Store(key string, data string) error

type GCSCache added in v0.3.22

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

func (*GCSCache) Configure added in v0.3.22

func (s *GCSCache) Configure(cacheInfo CacheProvider) error

func (*GCSCache) DisableCache added in v0.3.22

func (s *GCSCache) DisableCache()

func (*GCSCache) Exists added in v0.3.22

func (s *GCSCache) Exists(key string) bool

func (*GCSCache) GetName added in v0.3.22

func (s *GCSCache) GetName() string

func (*GCSCache) IsCacheDisabled added in v0.3.22

func (s *GCSCache) IsCacheDisabled() bool

func (*GCSCache) List added in v0.3.22

func (s *GCSCache) List() ([]CacheObjectDetails, error)

func (*GCSCache) Load added in v0.3.22

func (s *GCSCache) Load(key string) (string, error)

func (*GCSCache) Remove added in v0.3.22

func (s *GCSCache) Remove(key string) error

func (*GCSCache) Store added in v0.3.22

func (s *GCSCache) Store(key string, data string) error

type GCSCacheConfiguration added in v0.3.22

type GCSCacheConfiguration struct {
	ProjectId  string `mapstructure:"projectid" yaml:"projectid,omitempty"`
	Region     string `mapstructure:"region" yaml:"region,omitempty"`
	BucketName string `mapstructure:"bucketname" yaml:"bucketname,omitempty"`
}

type ICache

type ICache interface {
	Configure(cacheInfo CacheProvider) error
	Store(key string, data string) error
	Load(key string) (string, error)
	List() ([]CacheObjectDetails, error)
	Remove(key string) error
	Exists(key string) bool
	IsCacheDisabled() bool
	GetName() string
	DisableCache()
}

func GetCacheConfiguration added in v0.3.22

func GetCacheConfiguration() (ICache, error)

If we have set a remote cache, return the remote cache configuration

func New

func New(cacheType string) ICache

type S3Cache added in v0.3.3

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

Generate ICache implementation

func (*S3Cache) Configure added in v0.3.22

func (s *S3Cache) Configure(cacheInfo CacheProvider) error

func (*S3Cache) DisableCache added in v0.3.22

func (s *S3Cache) DisableCache()

func (*S3Cache) Exists added in v0.3.3

func (s *S3Cache) Exists(key string) bool

func (*S3Cache) GetName added in v0.3.22

func (s *S3Cache) GetName() string

func (*S3Cache) IsCacheDisabled added in v0.3.3

func (s *S3Cache) IsCacheDisabled() bool

func (*S3Cache) List added in v0.3.3

func (s *S3Cache) List() ([]CacheObjectDetails, error)

func (*S3Cache) Load added in v0.3.3

func (s *S3Cache) Load(key string) (string, error)

func (*S3Cache) Remove added in v0.3.22

func (s *S3Cache) Remove(key string) error

func (*S3Cache) Store added in v0.3.3

func (s *S3Cache) Store(key string, data string) error

type S3CacheConfiguration added in v0.3.22

type S3CacheConfiguration struct {
	Region     string `mapstructure:"region" yaml:"region,omitempty"`
	BucketName string `mapstructure:"bucketname" yaml:"bucketname,omitempty"`
}

Jump to

Keyboard shortcuts

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