// NewServer builds a new server handle request to a backend.
NewServer builds a new server handle request to a backend.
// NewServer builds a new server handle request to a backend .
func NewServer(backend Backend,idGenerator IdGenerator) *Server {
	rv := Server{
		Handlers:    make(map[string]Handler),
		Backend:     backend,
		IdGenerator: idGenerator,
	}
	rv.Handlers[""] = handleDefault
	rv.Handlers["quit"] = handleQuit
	rv.Handlers["group"] = handleGroup
	rv.Handlers["list"] = handleList
	rv.Handlers["head"] = handleHead
	rv.Handlers["body"] = handleBody
	rv.Handlers["article"] = handleArticle
	rv.Handlers["post"] = handlePost
	rv.Handlers["ihave"] = handleIHave
	rv.Handlers["check"] = handleCheck
	rv.Handlers["takethis"] = handleTakethis
	rv.Handlers["capabilities"] = handleCap
	rv.Handlers["mode"] = handleMode
	rv.Handlers["authinfo"] = handleAuthInfo
	rv.Handlers["newgroups"] = handleNewGroups
	rv.Handlers["over"] = handleOver
	rv.Handlers["xover"] = handleOver
	rv.Handlers["hdr"] = handleHdr
	rv.Handlers["xhdr"] = handleHdr
	rv.Handlers["listgroup"] = handleListgroup
	rv.Handlers["last"] = handleLast
	rv.Handlers["next"] = handleNext
	rv.Handlers["stat"] = handleStat
	rv.Handlers["help"] = handleHelp
	rv.Handlers["date"] = handleDate
	return &rv
}
func NewServer ( backend Backend , idGenerator IdGenerator ) * Server { rv := Server { Handlers : make ( map [ string ] Handler ) , Backend : backend , IdGenerator : idGenerator , } rv . Handlers [ " " ] = handleDefault rv . Handlers [ " " ] = handleQuit rv . Handlers [ " " ] = handleGroup rv . Handlers [ " " ] = handleList rv . Handlers [ " " ] = handleHead rv . Handlers [ " " ] = handleBody rv . Handlers [ " " ] = handleArticle rv . Handlers [ " " ] = handlePost rv . Handlers [ " " ] = handleIHave rv . Handlers [ " " ] = handleCheck rv . Handlers [ " " ] = handleTakethis rv . Handlers [ " " ] = handleCap rv . Handlers [ " " ] = handleMode rv . Handlers [ " " ] = handleAuthInfo rv . Handlers [ " " ] = handleNewGroups rv . Handlers [ " " ] = handleOver rv . Handlers [ " " ] = handleOver rv . Handlers [ " " ] = handleHdr rv . Handlers [ " " ] = handleHdr rv . Handlers [ " " ] = handleListgroup rv . Handlers [ " " ] = handleLast rv . Handlers [ " " ] = handleNext rv . Handlers [ " " ] = handleStat rv . Handlers [ " " ] = handleHelp rv . Handlers [ " " ] = handleDate return & rv }
NewServer builds a new server handle request to a backend.
NewServer builds a new server handle request to a backend .