prow/tide/tide.go
func NewController(ghcSync, ghcStatus *github.Client, prowJobClient prowv1.ProwJobInterface, cfg config.Getter, gc *git.Client, maxRecordsPerPool int, opener io.Opener, historyURI, statusURI string, logger *logrus.Entry) (*Controller, error) {
	if logger == nil {
		logger = logrus.NewEntry(logrus.StandardLogger())
	}
	hist, err := history.New(maxRecordsPerPool, opener, historyURI)
	if err != nil {
		return nil, fmt.Errorf("error initializing history client from %q: %v", historyURI, err)
	}
	sc := &statusController{
		logger:         logger.WithField("controller", "status-update"),
		ghc:            ghcStatus,
		config:         cfg,
		newPoolPending: make(chan bool, 1),
		shutDown:       make(chan bool),
		opener:         opener,
		path:           statusURI,
	}
	go sc.run()
	return &Controller{
		logger:        logger.WithField("controller", "sync"),
		ghc:           ghcSync,
		prowJobClient: prowJobClient,
		config:        cfg,
		gc:            gc,
		sc:            sc,
		changedFiles: &changedFilesAgent{
			ghc:             ghcSync,
			nextChangeCache: make(map[changeCacheKey][]string),
		},
		History: hist,
	}, nil
}
func NewController(ghcSync, ghcStatus *github.Client, prowJobClient prowv1.ProwJobInterface, cfg config.Getter, gc *git.Client, maxRecordsPerPool int, opener io.Opener, historyURI, statusURI string, logger *logrus.Entry) (*Controller, error) {
	if logger == nil {
		logger = logrus.NewEntry(logrus.StandardLogger())
	}
	hist, err := history.New(maxRecordsPerPool, opener, historyURI)
	if err != nil {
		return nil, fmt.Errorf("error initializing history client from %q: %v", historyURI, err)
	}
	sc := &statusController{
		logger:         logger.WithField("controller", "status-update"),
		ghc:            ghcStatus,
		config:         cfg,
		newPoolPending: make(chan bool, 1),
		shutDown:       make(chan bool),
		opener:         opener,
		path:           statusURI,
	}
	go sc.run()
	return &Controller{
		logger:        logger.WithField("controller", "sync"),
		ghc:           ghcSync,
		prowJobClient: prowJobClient,
		config:        cfg,
		gc:            gc,
		sc:            sc,
		changedFiles: &changedFilesAgent{
			ghc:             ghcSync,
			nextChangeCache: make(map[changeCacheKey][]string),
		},
		History: hist,
	}, nil
}
func NewController ( ghcSync , ghcStatus * github . Client , prowJobClient prowv1 . ProwJobInterface , cfg config . Getter , gc * git . Client , maxRecordsPerPool int , opener io . Opener , historyURI , statusURI string , logger * logrus . Entry ) ( * Controller , error ) { if logger == nil { logger = logrus . NewEntry ( logrus . StandardLogger ( ) ) } hist , err := history . New ( maxRecordsPerPool , opener , historyURI ) if err != nil { return nil , fmt . Errorf ( " " , historyURI , err ) } sc := & statusController { logger : logger . WithField ( " " , " " ) , ghc : ghcStatus , config : cfg , newPoolPending : make ( chan bool , 1 ) , shutDown : make ( chan bool ) , opener : opener , path : statusURI , } go sc . run ( ) return & Controller { logger : logger . WithField ( " " , " " ) , ghc : ghcSync , prowJobClient : prowJobClient , config : cfg , gc : gc , sc : sc , changedFiles : & changedFilesAgent { ghc : ghcSync , nextChangeCache : make ( map [ changeCacheKey ] [ ] string ) , } , History : hist , } , nil }
// NewController makes a Controller out of the given clients.
NewController makes a Controller out of the given clients .