cache

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 12 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(bucketName string, region string) error

func RemoteCacheEnabled added in v0.3.3

func RemoteCacheEnabled() (bool, error)

func RemoveRemoteCache added in v0.3.5

func RemoveRemoteCache(bucketName string) error

Types

type CacheProvider added in v0.3.3

type CacheProvider struct {
	BucketName string `mapstructure:"bucketname"`
	Region     string `mapstructure:"region"`
}

CacheProvider is the configuration for the cache provider when using a remote cache

type FileBasedCache

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

func (*FileBasedCache) Exists

func (*FileBasedCache) Exists(key string) bool

func (*FileBasedCache) IsCacheDisabled added in v0.2.8

func (f *FileBasedCache) IsCacheDisabled() bool

func (*FileBasedCache) List added in v0.3.3

func (*FileBasedCache) List() ([]string, error)

func (*FileBasedCache) Load

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

func (*FileBasedCache) Store

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

type ICache

type ICache interface {
	Store(key string, data string) error
	Load(key string) (string, error)
	List() ([]string, error)
	Exists(key string) bool
	IsCacheDisabled() bool
}

func New

func New(noCache bool, remoteCache bool) ICache

func NewS3Cache added in v0.3.3

func NewS3Cache(nocache bool) ICache

type S3Cache added in v0.3.3

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

Generate ICache implementation

func (*S3Cache) Exists added in v0.3.3

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

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() ([]string, error)

func (*S3Cache) Load added in v0.3.3

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

func (*S3Cache) Store added in v0.3.3

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

Jump to

Keyboard shortcuts

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