A faas-flow statestore implementation that uses redis to store state
TODO:
kubectl apply -f resource/redis-k8s-standalone.yml
or you can install redis service by your self
- Set the
stack.yml
with the necessary environments
redis_url: "redis.default.svc.cluster.local:6379"
- Use the
RedisStateStore
as a DataStore onhandler.go
redisStateStore "github.com/chennqqi/faas-flow-redis-statestore"
func DefineStateStore() (faasflow.StateStore, error) {
ss, err := redisStateStore.GetConsulStateStore(os.Getenv("redis_url"), os.Getenv("redis_master"))
if err != nil {
return nil, err
}
return ss, nil
}