corcache

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const RedisKubernetesChart = "groundhog2k/redis"
View Source
const RedisKubernetesDeploymentName = "corral-redis"

Variables

View Source
var RedisKubernetesChartRepo = repo.Entry{
	Name: "groundhog2k",
	URL:  "https://groundhog2k.github.io/helm-charts/",
}

TODO:

Functions

func CacheSmokeTest

func CacheSmokeTest(t *testing.T, c CacheSystem)

func IntOptional

func IntOptional(i int) *int

func RunTestCacheSystem

func RunTestCacheSystem(t *testing.T, c CacheSystem)

Types

type AWSEFSCache

type AWSEFSCache struct {
}

func (*AWSEFSCache) Clear

func (A *AWSEFSCache) Clear() error

func (*AWSEFSCache) Delete

func (A *AWSEFSCache) Delete(path string) error

func (*AWSEFSCache) Deploy

func (A *AWSEFSCache) Deploy() error

func (*AWSEFSCache) Flush

func (A *AWSEFSCache) Flush(fs corfs.FileSystem) error

func (*AWSEFSCache) FunctionInjector

func (A *AWSEFSCache) FunctionInjector() CacheConfigIncector

func (*AWSEFSCache) Init

func (A *AWSEFSCache) Init() error

func (*AWSEFSCache) Join

func (A *AWSEFSCache) Join(elem ...string) string

func (*AWSEFSCache) ListFiles

func (A *AWSEFSCache) ListFiles(path string) ([]corfs.FileInfo, error)

func (*AWSEFSCache) OpenReader

func (A *AWSEFSCache) OpenReader(path string, startAt int64) (io.ReadCloser, error)

func (*AWSEFSCache) OpenWriter

func (A *AWSEFSCache) OpenWriter(path string) (io.WriteCloser, error)

func (*AWSEFSCache) Split

func (A *AWSEFSCache) Split(path string) []string

func (*AWSEFSCache) Stat

func (A *AWSEFSCache) Stat(path string) (corfs.FileInfo, error)

func (*AWSEFSCache) Undeploy

func (A *AWSEFSCache) Undeploy() error

type AWSEFSCacheConfigInjector

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

func (*AWSEFSCacheConfigInjector) CacheSystem

func (a *AWSEFSCacheConfigInjector) CacheSystem() CacheSystem

func (*AWSEFSCacheConfigInjector) ConfigureLambda

func (a *AWSEFSCacheConfigInjector) ConfigureLambda(functionConfig *lambda.CreateFunctionInput) error

type CacheConfigIncector

type CacheConfigIncector interface {
	CacheSystem() CacheSystem
}

type CacheSystem

type CacheSystem interface {
	corfs.FileSystem

	Deploy() error
	Undeploy() error

	Flush(system corfs.FileSystem) error
	Clear() error

	//FunctionInjector can be used by function deployment code to modify function deploymentes to use the underling cache system, warning needs to be implmented for each platfrom induvidually
	FunctionInjector() CacheConfigIncector
}

CacheSystem represent a ephemeral file system used for intermidiate state between map/reduce phases

func NewCacheSystem

func NewCacheSystem(fsType CacheSystemType) (CacheSystem, error)

NewCacheSystem intializes a CacheSystem of the given type

type CacheSystemType

type CacheSystemType int

FileSystemType is an identifier for supported FileSystems

const (
	NoCache CacheSystemType = iota
	Local
	Redis
	Olric
	EFS
)

Identifiers for supported FileSystemTypes

func CacheSystemTypes

func CacheSystemTypes(fs CacheSystem) CacheSystemType

CacheSystemTypes retunrs a type for a given CacheSystem or the NoCache type.

type ClientConfig

type ClientConfig struct {
	Addrs []string
	DB    int
	User  string

	RouteByLatency bool
	RouteRandomly  bool
	// contains filtered or unexported fields
}

type DeploymentStrategy

type DeploymentStrategy interface {
	Deploy() (*ClientConfig, error)
	Undeploy() error
}

func NewDeploymentStrategy

func NewDeploymentStrategy(deploymentType DeploymentType) (DeploymentStrategy, error)

type DeploymentType

type DeploymentType int
const (
	LocalDeployment DeploymentType = iota
	KubernetesDeployment
	AWS
)

type KubernetesRedisDeploymentStrategy

type KubernetesRedisDeploymentStrategy struct {
	Namespace    string
	StorageClass string
	NodePort     *int
	// contains filtered or unexported fields
}

func (*KubernetesRedisDeploymentStrategy) Deploy

func (*KubernetesRedisDeploymentStrategy) Undeploy

type LocalCache

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

func NewLocalInMemoryProvider

func NewLocalInMemoryProvider(maxSize uint64) *LocalCache

func (*LocalCache) Clear

func (l *LocalCache) Clear() error

func (*LocalCache) Delete

func (l *LocalCache) Delete(path string) error

func (*LocalCache) Deploy

func (l *LocalCache) Deploy() error

func (*LocalCache) Flush

func (l *LocalCache) Flush(fs corfs.FileSystem) error

func (*LocalCache) FunctionInjector

func (l *LocalCache) FunctionInjector() CacheConfigIncector

func (*LocalCache) Init

func (l *LocalCache) Init() error

func (*LocalCache) Join

func (l *LocalCache) Join(elem ...string) string

func (*LocalCache) ListFiles

func (l *LocalCache) ListFiles(path string) ([]corfs.FileInfo, error)

func (*LocalCache) OpenReader

func (l *LocalCache) OpenReader(path string, startAt int64) (io.ReadCloser, error)

func (*LocalCache) OpenWriter

func (l *LocalCache) OpenWriter(path string) (io.WriteCloser, error)

func (*LocalCache) Split

func (l *LocalCache) Split(path string) []string

func (*LocalCache) Stat

func (l *LocalCache) Stat(path string) (corfs.FileInfo, error)

func (*LocalCache) Undeploy

func (l *LocalCache) Undeploy() error

type LocalRedisDeploymentStrategy

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

func (*LocalRedisDeploymentStrategy) Deploy

func (*LocalRedisDeploymentStrategy) Undeploy

func (l *LocalRedisDeploymentStrategy) Undeploy() error

type RedisBackedCache

type RedisBackedCache struct {
	DeploymentStragey DeploymentStrategy
	Client            redis.UniversalClient
	Config            *ClientConfig
}

func NewRedisBackedCache

func NewRedisBackedCache(deploymentType DeploymentType) (*RedisBackedCache, error)

func (*RedisBackedCache) Clear

func (r *RedisBackedCache) Clear() error

func (*RedisBackedCache) Delete

func (r *RedisBackedCache) Delete(filePath string) error

func (*RedisBackedCache) Deploy

func (r *RedisBackedCache) Deploy() error

func (*RedisBackedCache) Flush

func (r *RedisBackedCache) Flush(fs corfs.FileSystem) error

func (*RedisBackedCache) FunctionInjector

func (r *RedisBackedCache) FunctionInjector() CacheConfigIncector

func (*RedisBackedCache) Init

func (r *RedisBackedCache) Init() error

func (*RedisBackedCache) Join

func (r *RedisBackedCache) Join(elem ...string) string

func (*RedisBackedCache) ListFiles

func (r *RedisBackedCache) ListFiles(pathGlob string) ([]corfs.FileInfo, error)

func (*RedisBackedCache) OpenReader

func (r *RedisBackedCache) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)

func (*RedisBackedCache) OpenWriter

func (r *RedisBackedCache) OpenWriter(filePath string) (io.WriteCloser, error)

func (*RedisBackedCache) Split

func (r *RedisBackedCache) Split(path string) []string

func (*RedisBackedCache) Stat

func (r *RedisBackedCache) Stat(filePath string) (corfs.FileInfo, error)

func (*RedisBackedCache) Undeploy

func (r *RedisBackedCache) Undeploy() error

type RedisCacheConfigInjector

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

func (*RedisCacheConfigInjector) CacheSystem

func (r *RedisCacheConfigInjector) CacheSystem() CacheSystem

func (*RedisCacheConfigInjector) ConfigureLambda

func (r *RedisCacheConfigInjector) ConfigureLambda(function *lambda.CreateFunctionInput) error

func (*RedisCacheConfigInjector) ConfigureWhisk

func (r *RedisCacheConfigInjector) ConfigureWhisk(action *whisk.Action) error

WE strongly assume astion.Paramters are injected at runtime...

type WriteCloser

type WriteCloser struct {
	*bytes.Buffer
	// contains filtered or unexported fields
}

func (*WriteCloser) Close

func (w *WriteCloser) Close() error

func (*WriteCloser) Write

func (w *WriteCloser) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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