package main

import (
	"log"
	"net"

	"github.com/paultag/go-dictd/database"
	"github.com/paultag/go-dictd/dictd"
)

func main() {
	server := dictd.NewServer("pault.ag")
	// levelDB, err := database.NewLevelDBDatabase("/home/tag/jargon.ldb", "jargon file")
	urbanDB := database.UrbanDictionaryDatabase{}

	server.RegisterDatabase(&urbanDB, "urban")

	link, err := net.Listen("tcp", ":2628")
	if err != nil {
		log.Fatal(err)
	}

	for {
		conn, err := link.Accept()
		if err != nil {
			log.Printf("Error: %s", err)
		}
		go dictd.Handle(&server, conn)
	}
}

package main

import (
	"log"
	"net"

	"github.com/paultag/go-dictd/database"
	"github.com/paultag/go-dictd/dictd"
)

func main() {
	server := dictd.NewServer("pault.ag")
	levelDB, err := database.NewLevelDBDatabase("/home/tag/jargon.ldb", "jargon file")

	if err != nil {
		log.Fatal(err)
	}

	server.RegisterDatabase(levelDB, "jargon")

	link, err := net.Listen("tcp", ":2628")
	if err != nil {
		log.Fatal(err)
	}

	for {
		conn, err := link.Accept()
		if err != nil {
			log.Printf("Error: %s", err)
		}
		go dictd.Handle(&server, conn)
	}
}

--- 
+++ 
@@ -10,13 +10,10 @@
 
 func main() {
 	server := dictd.NewServer("pault.ag")
-	levelDB, err := database.NewLevelDBDatabase("/home/tag/jargon.ldb", "jargon file")
+	// levelDB, err := database.NewLevelDBDatabase("/home/tag/jargon.ldb", "jargon file")
+	urbanDB := database.UrbanDictionaryDatabase{}
 
-	if err != nil {
-		log.Fatal(err)
-	}
-
-	server.RegisterDatabase(levelDB, "jargon")
+	server.RegisterDatabase(&urbanDB, "urban")
 
 	link, err := net.Listen("tcp", ":2628")
 	if err != nil {
Swap over to UD for now
