func NewServer(cfg *config.Config, scfg ServerConfig) (_ *Server, err error) {
	defer derrors.Wrap(&err, "NewServer(db, %+v)", scfg)

	indexTemplate, err := parseTemplate(scfg.StaticPath, "index.tmpl")
	if err != nil {
		return nil, err
	}

	return &Server{
		cfg:                  cfg,
		db:                   scfg.DB,
		indexClient:          scfg.IndexClient,
		proxyClient:          scfg.ProxyClient,
		sourceClient:         scfg.SourceClient,
		redisHAClient:        scfg.RedisHAClient,
		redisCacheClient:     scfg.RedisCacheClient,
		queue:                scfg.Queue,
		reportingClient:      scfg.ReportingClient,
		taskIDChangeInterval: scfg.TaskIDChangeInterval,
		indexTemplate:        indexTemplate,
	}, nil
}
// NewServer creates a new Server with the given dependencies.
NewServer creates a new Server with the given dependencies.
// NewServer creates a new Server with the given dependencies .
func NewServer(cfg *config.Config, scfg ServerConfig) (_ *Server, err error) {
	defer derrors.Wrap(&err, "NewServer(db, %+v)", scfg)
	indexTemplate, err := parseTemplate(scfg.StaticPath, "index.tmpl")
	if err != nil {
		return nil, err
	}
	return &Server{
		cfg:                  cfg,
		db:                   scfg.DB,
		indexClient:          scfg.IndexClient,
		proxyClient:          scfg.ProxyClient,
		sourceClient:         scfg.SourceClient,
		redisHAClient:        scfg.RedisHAClient,
		redisCacheClient:     scfg.RedisCacheClient,
		queue:                scfg.Queue,
		reportingClient:      scfg.ReportingClient,
		taskIDChangeInterval: scfg.TaskIDChangeInterval,
		indexTemplate:        indexTemplate,
	}, nil
}
func NewServer ( cfg * config . Config , scfg ServerConfig ) ( _ * Server , err error ) { defer derrors . Wrap ( & err , " " , scfg ) indexTemplate , err := parseTemplate ( scfg . StaticPath , " " ) if err != nil { return nil , err } return & Server { cfg : cfg , db : scfg . DB , indexClient : scfg . IndexClient , proxyClient : scfg . ProxyClient , sourceClient : scfg . SourceClient , redisHAClient : scfg . RedisHAClient , redisCacheClient : scfg . RedisCacheClient , queue : scfg . Queue , reportingClient : scfg . ReportingClient , taskIDChangeInterval : scfg . TaskIDChangeInterval , indexTemplate : indexTemplate , } , nil }
NewServer creates a new Server with the given dependencies.
NewServer creates a new Server with the given dependencies .