Documentation ¶
Index ¶
- type Datab
- type FlagValues
- type Postgres
- func (m *Postgres) GetEnvCharts(env string, testsInTop int) (map[string]interface{}, error)
- func (m *Postgres) GetEnvironmentTestsAndTestCases() (map[string]interface{}, error)
- func (m *Postgres) GetOverview(dateRange int) (map[string]interface{}, error)
- func (m *Postgres) GetTestCharts(env string, test string) (map[string]interface{}, error)
- func (m *Postgres) Initialize() error
- func (m *Postgres) Set(commitRow models.DBEnvironmentTest, dbRows []models.DBTestCase) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datab ¶ added in v0.20.0
type Datab interface { Set(models.DBEnvironmentTest, []models.DBTestCase) error Initialize() error GetEnvironmentTestsAndTestCases() (map[string]interface{}, error) GetEnvCharts(string, int) (map[string]interface{}, error) GetOverview(dataRange int) (map[string]interface{}, error) GetTestCharts(string, string) (map[string]interface{}, error) }
Datab is the database interface we support
func FromEnv ¶
func FromEnv(fv FlagValues) (c Datab, err error)
FromEnv configures and returns a database instance. backend and path parameters are default config, otherwise gets config from the environment variables DB_BACKEND and DB_PATH
func NewCloudSQL ¶
NewCloudSQL returns a new Google Cloud SQL database
type FlagValues ¶ added in v0.19.0
FlagValues are the config values from flags
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) GetEnvCharts ¶ added in v0.20.0
GetEnvCharts writes the overall environment charts to a map with the keys recentFlakePercentTable, flakeRateByWeek, flakeRateByDay, and countsAndDurations
func (*Postgres) GetEnvironmentTestsAndTestCases ¶ added in v0.20.0
GetEnvironmentTestsAndTestCases writes the database tables to a map with the keys environmentTests and testCases
func (*Postgres) GetOverview ¶ added in v0.20.0
GetOverview writes the overview charts to a map with the keys summaryAvgFail and summaryTable
func (*Postgres) GetTestCharts ¶ added in v0.20.0
GetTestCharts writes the individual test chart data to a map with the keys flakeByDay and flakeByWeek
func (*Postgres) Initialize ¶
Initialize creates the tables within the Postgres database
func (*Postgres) Set ¶
func (m *Postgres) Set(commitRow models.DBEnvironmentTest, dbRows []models.DBTestCase) error
Set adds/updates rows to the database