Documentation ¶
Index ¶
Constants ¶
View Source
const (
CfgFileName = "lsobus.json"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func TestDataDir ¶
func TestDataDir() string
Types ¶
type CfgManager ¶
type CfgManager struct { ConfigFile string // contains filtered or unexported fields }
func NewCfgManager ¶
func NewCfgManager(path string) *CfgManager
func NewCfgManagerWithFile ¶
func NewCfgManagerWithFile(cfgFile string) *CfgManager
func NewCfgManagerWithName ¶
func NewCfgManagerWithName(path string, name string) *CfgManager
func (*CfgManager) Config ¶
func (cm *CfgManager) Config() (*Config, error)
Config get current used config
func (*CfgManager) Load ¶
func (cm *CfgManager) Load(migrations ...CfgMigrate) (*Config, error)
Load the config file and will create default if config file no exist Load the config file and will create default if config file no exist
func (*CfgManager) ParseDataDir ¶
func (cm *CfgManager) ParseDataDir() (string, error)
ParseDataDir parse dataDir from config file
func (*CfgManager) Save ¶
func (cm *CfgManager) Save(data ...interface{}) error
Save write config to file
type CfgMigrate ¶
type Config ¶
type Config struct { Version int `json:"version"` DataDir string `json:"dataDir"` LogLevel string `json:"logLevel"` //info,warn,debug. ChainUrl string `json:"chainUrl"` //chain url. FakeMode bool `json:"fakeMode"` //fake mode for sonata RPC RPCConfig `json:"rpc"` Partners []*PartnerCfg `json:"partners"` Privacy PrivacyCfg `json:"privacy"` }
func DefaultConfig ¶
type PartnerCfg ¶
type PrivacyCfg ¶
type RPCConfig ¶
type RPCConfig struct { Enable bool `json:"enabled"` // TCP or UNIX socket address for the RPC server to listen on ListenAddress string `json:"listenAddress"` // TCP or UNIX socket address for the gRPC server to listen on GRPCListenAddress string `json:"gRPCListenAddress"` CORSAllowedOrigins []string `json:"httpCors"` }
Click to show internal directories.
Click to hide internal directories.