github.com/RobustRoundRobin/quorum@v20.10.0+incompatible/private/engine/config.go (about)

     1  package engine
     2  
     3  import (
     4  	"github.com/BurntSushi/toml"
     5  )
     6  
     7  type Config struct {
     8  	Socket  string `toml:"socket"`
     9  	WorkDir string `toml:"workdir"`
    10  
    11  	// Deprecated
    12  	SocketPath string `toml:"socketPath"`
    13  }
    14  
    15  func LoadConfig(configPath string) (*Config, error) {
    16  	cfg := new(Config)
    17  	if _, err := toml.DecodeFile(configPath, cfg); err != nil {
    18  		return nil, err
    19  	}
    20  	// Fall back to Constellation 0.0.1 config format if necessary
    21  	if cfg.Socket == "" {
    22  		cfg.Socket = cfg.SocketPath
    23  	}
    24  	return cfg, nil
    25  }