Skip to content

Latest commit

 

History

History
28 lines (25 loc) · 799 Bytes

README.md

File metadata and controls

28 lines (25 loc) · 799 Bytes

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
}