mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 08:50:46 +00:00
Code cleanup; Implement persistant storage; Use maps for storage
This commit is contained in:
@@ -14,12 +14,13 @@ var Config = ServerConfig{}
|
||||
func ParseFlags() {
|
||||
host := flag.String("Host", "localhost", "Hostname")
|
||||
port := flag.Int("Port", 8081, "Listen port")
|
||||
explorerPath := flag.String("ExplorerDir", "/home/pk/pro/cosmos-explorer/dist", "Path to cosmos-explorer files")
|
||||
tlsCertificatePath := flag.String("Cert", "../example.crt", "Hostname")
|
||||
tlsCertificateKey := flag.String("CertKey", "../example.key", "Hostname")
|
||||
explorerPath := flag.String("ExplorerDir", "", "Path to cosmos-explorer files")
|
||||
tlsCertificatePath := flag.String("Cert", "", "Hostname")
|
||||
tlsCertificateKey := flag.String("CertKey", "", "Hostname")
|
||||
initialDataPath := flag.String("InitialData", "", "Path to JSON containing initial state")
|
||||
accountKey := flag.String("AccountKey", DefaultAccountKey, "Account key for authentication")
|
||||
disableAuthentication := flag.Bool("DisableAuth", false, "Disable authentication")
|
||||
persistDataPath := flag.String("Persist", "", "Saves data to given path on application exit")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -28,7 +29,8 @@ func ParseFlags() {
|
||||
Config.ExplorerPath = *explorerPath
|
||||
Config.TLS_CertificatePath = *tlsCertificatePath
|
||||
Config.TLS_CertificateKey = *tlsCertificateKey
|
||||
Config.DataFilePath = *initialDataPath
|
||||
Config.InitialDataFilePath = *initialDataPath
|
||||
Config.PersistDataFilePath = *persistDataPath
|
||||
Config.DisableAuth = *disableAuthentication
|
||||
|
||||
Config.DatabaseAccount = Config.Host
|
||||
|
||||
@@ -11,6 +11,7 @@ type ServerConfig struct {
|
||||
Host string
|
||||
TLS_CertificatePath string
|
||||
TLS_CertificateKey string
|
||||
DataFilePath string
|
||||
InitialDataFilePath string
|
||||
PersistDataFilePath string
|
||||
DisableAuth bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user