Exemple #1
0
func main() {
	flag.PrintDefaults()
	flag.Parse()

	logger, err := dlog.NewLogger(".")
	if err != nil {
		log.Fatal(err)
	}
	s := dlog.NewServer(logger, port)
	s.Start()
}
Exemple #2
0
func createAndStartServer() *serverTest {
	var err error
	var logger *dlog.Logger

	if logger, err = dlog.NewLogger(""); err != nil {
		log.Fatal(err)
	}
	server := dlog.NewServer(logger, 0)

	s := &serverTest{
		server: server,
		logger: logger,
	}
	go s.server.Start()
	return s
}