示例#1
0
func main() {
	flag.Parse()

	if *database != "" {
		if err := UserIndex.fileLoad(*database); err != nil {
			log.Println(err.Error())
		}

		go func() {
			for {
				dur, _ := time.ParseDuration("5m")
				time.Sleep(dur)

				if err := UserIndex.fileSave(*database); err != nil {
					log.Println(err.Error())
				}
			}
		}()
	}

	if *startRepl {
		go alexa.Run(Applications, *port)
		repl()
	} else {
		alexa.Run(Applications, *port)
	}
}
示例#2
0
func main() {
	rand.Seed(time.Now().UTC().UnixNano())
	alexa.Run(Applications, "3000")
}
示例#3
0
func main() {
	alexa.Run(Applications, "3000")
}