Documentation ¶
Index ¶
- Constants
- Variables
- func CreateSpannerDB(ctx context.Context, uri ParsedURI) error
- func CreateSpannerInstance(ctx context.Context, uri ParsedURI) error
- func NewTransientDB(t *testing.T) (*spanner.Client, context.Context)
- func RunMigrations(ctx context.Context, uri string) error
- type Build
- type BuildRepository
- func (g BuildRepository) GetByID(ctx context.Context, key KeyType) (*EntityType, error)
- func (repo *BuildRepository) Insert(ctx context.Context, build *Build) error
- func (repo *BuildRepository) LastBuiltTree(ctx context.Context, arch, tree, config string) (*Build, error)
- func (g BuildRepository) Update(ctx context.Context, key KeyType, cb func(*EntityType) error) error
- type Finding
- type FindingRepository
- type FullSessionTest
- type ParsedURI
- type Patch
- type Series
- type SeriesRepository
- func (repo *SeriesRepository) Count(ctx context.Context) (int, error)
- func (g SeriesRepository) GetByID(ctx context.Context, key KeyType) (*EntityType, error)
- func (repo *SeriesRepository) Insert(ctx context.Context, series *Series, queryPatches func() ([]*Patch, error)) error
- func (repo *SeriesRepository) ListLatest(ctx context.Context, maxPublishedAt time.Time, limit int) ([]*SeriesWithSession, error)
- func (repo *SeriesRepository) ListPatches(ctx context.Context, series *Series) ([]*Patch, error)
- func (repo *SeriesRepository) ListWithoutSession(ctx context.Context, limit int) ([]*Series, error)
- func (repo *SeriesRepository) PatchByID(ctx context.Context, id string) (*Patch, error)
- func (g SeriesRepository) Update(ctx context.Context, key KeyType, cb func(*EntityType) error) error
- type SeriesWithSession
- type Session
- type SessionRepository
- func (g SessionRepository) GetByID(ctx context.Context, key KeyType) (*EntityType, error)
- func (repo *SessionRepository) Insert(ctx context.Context, series *Series, session *Session) error
- func (repo *SessionRepository) ListForSeries(ctx context.Context, series *Series) ([]*Session, error)
- func (repo *SessionRepository) ListRunning(ctx context.Context) ([]*Session, error)
- func (g SessionRepository) Update(ctx context.Context, key KeyType, cb func(*EntityType) error) error
- type SessionTest
- type SessionTestRepository
Constants ¶
View Source
const ( BuildFailed string = "build_failed" // BuiltNotTested string = "built" // BuildTestFailed string = "tests_failed" BuildSuccess string = "success" )
Variables ¶
View Source
var ErrFindingExists = errors.New("the finding already exists")
View Source
var ErrSeriesExists = errors.New("the series already exists")
Functions ¶
Types ¶
type Build ¶
type Build struct { ID string `spanner:"ID"` TreeName string `spanner:"TreeName"` CommitHash string `spanner:"CommitHash"` CommitDate time.Time `spanner:"CommitDate"` SeriesID spanner.NullString `spanner:"SeriesID"` Arch string `spanner:"Arch"` ConfigName string `spanner:"ConfigName"` ConfigURI string `spanner:"ConfigURI"` Status string `spanner:"Status"` }
func (*Build) SetSeriesID ¶
type BuildRepository ¶
type BuildRepository struct {
// contains filtered or unexported fields
}
func NewBuildRepository ¶
func NewBuildRepository(client *spanner.Client) *BuildRepository
func (*BuildRepository) Insert ¶
func (repo *BuildRepository) Insert(ctx context.Context, build *Build) error
func (*BuildRepository) LastBuiltTree ¶
type FindingRepository ¶
type FindingRepository struct {
// contains filtered or unexported fields
}
func NewFindingRepository ¶
func NewFindingRepository(client *spanner.Client) *FindingRepository
func (*FindingRepository) ListForSession ¶
func (repo *FindingRepository) ListForSession(ctx context.Context, session *Session) ([]*Finding, error)
nolint: dupl
type FullSessionTest ¶
type FullSessionTest struct { *SessionTest BaseBuild *Build PatchedBuild *Build }
type ParsedURI ¶
type Series ¶
type Series struct { ID string `spanner:"ID"` ExtID string `spanner:"ExtID"` AuthorName string `spanner:"AuthorName"` AuthorEmail string `spanner:"AuthorEmail"` Title string `spanner:"Title"` Link string `spanner:"Link"` Version int64 `spanner:"Version"` PublishedAt time.Time `spanner:"PublishedAt"` LatestSessionID spanner.NullString `spanner:"LatestSessionID"` Cc []string `spanner:"Cc"` }
func (*Series) SetLatestSession ¶
type SeriesRepository ¶
type SeriesRepository struct {
// contains filtered or unexported fields
}
func NewSeriesRepository ¶
func NewSeriesRepository(client *spanner.Client) *SeriesRepository
func (*SeriesRepository) Count ¶
func (repo *SeriesRepository) Count(ctx context.Context) (int, error)
func (*SeriesRepository) Insert ¶
func (repo *SeriesRepository) Insert(ctx context.Context, series *Series, queryPatches func() ([]*Patch, error)) error
Insert() checks whether there already exists a series with the same ExtID. Since Patch content is stored elsewhere, we do not demand it be filled out before calling Insert(). Instead, Insert() obtains this data via a callback.
func (*SeriesRepository) ListLatest ¶
func (repo *SeriesRepository) ListLatest(ctx context.Context, maxPublishedAt time.Time, limit int) ([]*SeriesWithSession, error)
ListLatest() returns the list of series ordered by the decreasing PublishedAt value.
func (*SeriesRepository) ListPatches ¶
golint sees too much similarity with SessionRepository's ListForSeries, but in reality there's not. nolint:dupl
func (*SeriesRepository) ListWithoutSession ¶
type SeriesWithSession ¶
type Session ¶
type Session struct { ID string `spanner:"ID"` SeriesID string `spanner:"SeriesID"` CreatedAt time.Time `spanner:"CreatedAt"` FinishedAt spanner.NullTime `spanner:"FinishedAt"` LogURI string `spanner:"LogURI"` }
func (*Session) SetFinishedAt ¶
type SessionRepository ¶
type SessionRepository struct {
// contains filtered or unexported fields
}
func NewSessionRepository ¶
func NewSessionRepository(client *spanner.Client) *SessionRepository
func (*SessionRepository) ListForSeries ¶
func (repo *SessionRepository) ListForSeries(ctx context.Context, series *Series) ([]*Session, error)
golint sees too much similarity with SeriesRepository's ListPatches, but in reality there's not. nolint:dupl
func (*SessionRepository) ListRunning ¶
func (repo *SessionRepository) ListRunning(ctx context.Context) ([]*Session, error)
type SessionTest ¶
type SessionTest struct { SessionID string `spanner:"SessionID"` BaseBuildID spanner.NullString `spanner:"BaseBuildID"` PatchedBuildID spanner.NullString `spanner:"PatchedBuildID"` TestName string `spanner:"TestName"` Result string `spanner:"Result"` }
type SessionTestRepository ¶
type SessionTestRepository struct {
// contains filtered or unexported fields
}
func NewSessionTestRepository ¶
func NewSessionTestRepository(client *spanner.Client) *SessionTestRepository
func (*SessionTestRepository) BySession ¶
func (repo *SessionTestRepository) BySession(ctx context.Context, sessionID string) ([]*FullSessionTest, error)
func (*SessionTestRepository) InsertOrUpdate ¶
func (repo *SessionTestRepository) InsertOrUpdate(ctx context.Context, test *SessionTest) error
Click to show internal directories.
Click to hide internal directories.