MCPcopy Create free account
hub / github.com/bytesizedhosting/bcd / main

Function main

main.go:208–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206}
207
208func main() {
209 log.Println("Starting the Bytesized Connect Daemon", core.VerString)
210
211 switch kingpin.MustParse(app.Parse(os.Args[1:])) {
212 case register.FullCommand():
213 log.Infoln("Initialization run, writing config file.")
214 c := core.MainConfig{ApiSecret: *apisecret, ApiKey: *apikey, Port: *port}
215 err := core.WriteConfig("config.json", &c)
216 if err != nil {
217 log.Panicf("Could not write config file: '%s'", err.Error())
218 }
219 log.Infoln("Initialization run completed, please start the daemon normally.")
220 case start.FullCommand():
221 c := core.MainConfig{}
222 c.Port = *port
223 err := core.LoadHomeConfig("config.json", &c)
224
225 if err != nil {
226 log.Info("Could not load config file. Please run with '-init APIKEY APISECRET' first.", err.Error())
227 os.Exit(1)
228 }
229
230 log.Debugf("Using docker socket '%s'", *endpoint)
231 startApp(&c)
232 }
233
234}

Callers

nothing calls this directly

Calls 1

startAppFunction · 0.85

Tested by

no test coverage detected