Skip to content

faasflow/faas-flow-consul-statestore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

faasflow-consul-statestore

A faas-flow statestore implementation that uses Consul to store state

Consul State-Store configuration

Below are the configuration

consul_url
consul_dc

Use Consul StateStore in faasflow

  • Set the stack.yml with the necessary environments
    consul_url: "consul.faasflow:8500"
    consul_dc: "dc1"
  • Use the ConsulStateStore as a DataStore on handler.go
consulStateStore "github.com/s8sg/faas-flow-consul-statestore"

func DefineStateStore() (faasflow.StateStore, error) {
        consulss, err := consulStateStore.GetConsulStateStore(os.Getenv("consul_url"), os.Getenv("consul_dc"))
        if err != nil {
                return nil, err
        }
        return consulss, nil
}