RunInMemory starts the server based on the given args, while also using RAM as the backing store. The returned WaitGroup may be used to wait for the server to close.
(cfg *servercfg.DoltgresConfig, protocolListenerFactory server.ProtocolListenerFunc)
| 71 | // RunInMemory starts the server based on the given args, while also using RAM as the backing store. |
| 72 | // The returned WaitGroup may be used to wait for the server to close. |
| 73 | func RunInMemory(cfg *servercfg.DoltgresConfig, protocolListenerFactory server.ProtocolListenerFunc) (*svcs.Controller, error) { |
| 74 | ctx := context.Background() |
| 75 | fs := filesys.EmptyInMemFS("") |
| 76 | dEnv := env.Load(ctx, env.GetCurrentUserHomeDir, fs, doltdb.InMemDoltDB, Version) |
| 77 | globalConfig, _ := dEnv.Config.GetConfig(env.GlobalConfig) |
| 78 | if globalConfig.GetStringOrDefault(config.UserNameKey, "") == "" { |
| 79 | globalConfig.SetStrings(map[string]string{ |
| 80 | config.UserNameKey: DefUserName, |
| 81 | config.UserEmailKey: DefUserEmail, |
| 82 | }) |
| 83 | } |
| 84 | |
| 85 | return runServer(ctx, cfg, dEnv, protocolListenerFactory) |
| 86 | } |
| 87 | |
| 88 | // runServer starts the server based on the given args, using the provided file system as the backing store. |
| 89 | // The returned WaitGroup may be used to wait for the server to close. |