Documentation ¶
Index ¶
- type DBLayer
- func (dl *DBLayer) CreateBuild(req *lib.BuildRequest) (gocql.UUID, error)
- func (dl *DBLayer) DeleteBuild(id gocql.UUID) error
- func (dl *DBLayer) GetBuildByID(id gocql.UUID) (*lib.BuildStatusResponse, error)
- func (dl *DBLayer) GetBuildOutput(id gocql.UUID, column string) ([]lib.BuildEvent, error)
- func (dl *DBLayer) SaveBuildOutput(id gocql.UUID, output []lib.BuildEvent, column string) error
- func (dl *DBLayer) SetBuildCompletedTimestamp(id gocql.UUID) error
- func (dl *DBLayer) SetBuildFlags(id gocql.UUID, flags map[string]bool) error
- func (dl *DBLayer) SetBuildState(id gocql.UUID, state lib.BuildStatusResponse_BuildState) error
- func (dl *DBLayer) SetBuildTimeMetric(id gocql.UUID, metric string) error
- func (dl *DBLayer) SetDockerImageSizesMetric(id gocql.UUID, size int64, vsize int64) error
- type DataLayer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBLayer ¶
type DBLayer struct {
// contains filtered or unexported fields
}
DBLayer is an DataLayer instance that interacts with the Cassandra database
func (*DBLayer) CreateBuild ¶
CreateBuild inserts a new build into the DB returning the ID
func (*DBLayer) DeleteBuild ¶
DeleteBuild removes a build from the DB. Only used in case of queue full when we can't actually do a build
func (*DBLayer) GetBuildByID ¶
GetBuildByID fetches a build object from the DB
func (*DBLayer) GetBuildOutput ¶
GetBuildOutput returns an array of stream events from the database
func (*DBLayer) SaveBuildOutput ¶
SaveBuildOutput serializes an array of stream events to the database
func (*DBLayer) SetBuildCompletedTimestamp ¶
SetBuildCompletedTimestamp sets the completed timestamp on a build to time.Now()
func (*DBLayer) SetBuildFlags ¶
SetBuildFlags sets the boolean flags on the build object Caller must ensure that the flags passed in are valid
func (*DBLayer) SetBuildState ¶
SetBuildState sets the state of a build
func (*DBLayer) SetBuildTimeMetric ¶
SetBuildTimeMetric sets a build metric to time.Now() metric is the name of the column to update if metric is a *_completed column, it will also compute and persist the duration
type DataLayer ¶
type DataLayer interface { CreateBuild(*lib.BuildRequest) (gocql.UUID, error) GetBuildByID(gocql.UUID) (*lib.BuildStatusResponse, error) SetBuildFlags(gocql.UUID, map[string]bool) error SetBuildCompletedTimestamp(gocql.UUID) error SetBuildState(gocql.UUID, lib.BuildStatusResponse_BuildState) error DeleteBuild(gocql.UUID) error SetBuildTimeMetric(gocql.UUID, string) error SetDockerImageSizesMetric(gocql.UUID, int64, int64) error SaveBuildOutput(gocql.UUID, []lib.BuildEvent, string) error GetBuildOutput(gocql.UUID, string) ([]lib.BuildEvent, error) }
DataLayer describes an object that interacts with the persistant data store