Home | History | Annotate | Download | only in controllers
      1 package controllers
      2 
      3 import (
      4 	ent "repodiff/entities"
      5 	"repodiff/repositories"
      6 )
      7 
      8 type Committer interface {
      9 	InsertCommitRows(commitRows []ent.AnalyzedCommitRow) error
     10 	GetFirstSeenTimestamp(commitHashes []string, nullTimestamp ent.RepoTimestamp) (map[string]ent.RepoTimestamp, error)
     11 	GetMostRecentCommits() ([]ent.AnalyzedCommitRow, error)
     12 }
     13 
     14 func MaybeNullObjectCommitRepository(target ent.MappedDiffTarget) Committer {
     15 	c, err := repositories.NewCommitRepository(target)
     16 	if err != nil {
     17 		return repositories.NewNullObject(err)
     18 	}
     19 	return c
     20 }
     21