// TODO: check that database exists and create it if not func NewServer(config *configuration.Configuration, coord api.Coordinator, clusterConfig *cluster.ClusterConfiguration) *Server { self := &Server{} self.listenAddress = config.GraphiteBindString() self.database = config.GraphiteDatabase self.coordinator = coord self.writeSeries = make(chan Record, max_queue) self.allCommitted = make(chan bool, 1) self.connClosed = make(chan bool, 1) self.clusterConfig = clusterConfig self.udpEnabled = config.GraphiteUdpEnabled return self }