Documentation
¶
Index ¶
- Constants
- Variables
- func ClientOptions(cfg ClientConfig) clickhouse.Options
- func Connect(options *clickhouse.Options) (driver.Conn, error)
- func DeduplicateTable(ctx context.Context, opt DeduplicateTableOptions, ch *Client) error
- func GetLatestMigrationVersion(fsys fs.FS, path string) (uint, error)
- func GetSchemaVersion(c *Client, ctx context.Context) (uint, bool, error)
- func InsertBridges(c *Client, ctx context.Context, bridges []*typespb.Bridge) (int, error)
- func InsertJobs(c *Client, ctx context.Context, jobs []*typespb.Job) (int, error)
- func InsertMergeRequests(c *Client, ctx context.Context, mrs []*typespb.MergeRequest) (int, error)
- func InsertMetrics(c *Client, ctx context.Context, metrics []*typespb.Metric) (int, error)
- func InsertPipelines(c *Client, ctx context.Context, pipelines []*typespb.Pipeline) (int, error)
- func InsertProjects(c *Client, ctx context.Context, projects []*typespb.Project) (int, error)
- func InsertSections(c *Client, ctx context.Context, sections []*typespb.Section) (int, error)
- func InsertTestCases(c *Client, ctx context.Context, cases []*typespb.TestCase) (int, error)
- func InsertTestReports(c *Client, ctx context.Context, reports []*typespb.TestReport) (int, error)
- func InsertTestSuites(c *Client, ctx context.Context, suites []*typespb.TestSuite) (int, error)
- func InsertTraces(c *Client, ctx context.Context, traces []*typespb.Trace) (int, error)
- func MigrateUp(opts MigrationOptions) error
- func NewMigration(opts MigrationOptions) (*migrate.Migrate, error)
- func PrepareDeduplicateQuery(opt DeduplicateTableOptions) (string, map[string]string)
- func SelectPipelineMaxUpdatedAt(c *Client, ctx context.Context) (map[int64]float64, error)
- func SelectTableIDLastestUpdates(c *Client, ctx context.Context, table string, idColumn string, ...) (map[int64]float64, error)
- func SelectTableIDs[T int64 | string](c *Client, ctx context.Context, table string, column string) (map[T]struct{}, error)
- func SelectTraceSpanIDs(c *Client, ctx context.Context) (map[string]struct{}, error)
- func WithParameters(ctx context.Context, params map[string]string) context.Context
- type Cache
- func (c *Cache) UpdateBridges(data []int64, updated []bool)
- func (c *Cache) UpdateJobs(data []int64, updated []bool)
- func (c *Cache) UpdateMergeRequests(data map[int64]float64, updated map[int64]bool)
- func (c *Cache) UpdateMetrics(keys map[int64]bool)
- func (c *Cache) UpdatePipelines(data map[int64]float64, updated map[int64]bool)
- func (c *Cache) UpdateProjects(data map[int64]float64, updated map[int64]bool)
- func (c *Cache) UpdateSections(keys map[int64]bool)
- func (c *Cache) UpdateTestCases(keys map[string]bool)
- func (c *Cache) UpdateTestReports(data []string, updated []bool)
- func (c *Cache) UpdateTestSuites(data []string, updated []bool)
- func (c *Cache) UpdateTraceSpans(data []string, updated []bool)
- type Client
- type ClientConfig
- type DeduplicateTableOptions
- type MigrationOptions
Constants ¶
const ( PipelinesTable string = "pipelines" JobsTable string = "jobs" SectionsTable string = "sections" BridgesTable string = "bridges" TestReportsTable string = "testreports" TestSuitesTable string = "testsuites" TestCasesTable string = "testcases" MergeRequestsTable string = "mergerequests" MetricsTable string = "metrics" ProjectsTable string = "projects" TraceSpansTable string = "traces" )
Variables ¶
var ( ErrMigrateNoChange = migrate.ErrNoChange ErrMigrateNilVersion = migrate.ErrNilVersion )
Functions ¶
func ClientOptions ¶ added in v0.6.1
func ClientOptions(cfg ClientConfig) clickhouse.Options
func DeduplicateTable ¶
func DeduplicateTable(ctx context.Context, opt DeduplicateTableOptions, ch *Client) error
func GetLatestMigrationVersion ¶ added in v0.7.0
func GetSchemaVersion ¶ added in v0.7.0
func InsertBridges ¶
func InsertMergeRequests ¶ added in v0.7.0
func InsertMetrics ¶
func InsertPipelines ¶
func InsertProjects ¶ added in v0.7.0
func InsertSections ¶
func InsertTestCases ¶
func InsertTestReports ¶
func InsertTestSuites ¶
func InsertTraces ¶
func MigrateUp ¶ added in v0.7.0
func MigrateUp(opts MigrationOptions) error
func NewMigration ¶ added in v0.7.0
func NewMigration(opts MigrationOptions) (*migrate.Migrate, error)
func PrepareDeduplicateQuery ¶
func PrepareDeduplicateQuery(opt DeduplicateTableOptions) (string, map[string]string)
func SelectTableIDLastestUpdates ¶ added in v0.7.0
func SelectTableIDs ¶
func SelectTraceSpanIDs ¶
Types ¶
type Cache ¶
func (*Cache) UpdateBridges ¶
func (*Cache) UpdateJobs ¶
func (*Cache) UpdateMergeRequests ¶ added in v0.7.0
func (*Cache) UpdateMetrics ¶ added in v0.7.0
UpdateMetrics updates the cache used to prevent inserting duplicate metrics. For each key in the given map we check whether it is already cached. If it is, the correspopnding map value is set to `false`, else it will be added to the cache and the correponding map value is set to `true`. In order to not require holding each individual metric ID in memory, we use the metric's job ID as a cache key.
func (*Cache) UpdatePipelines ¶
func (*Cache) UpdateProjects ¶ added in v0.7.0
func (*Cache) UpdateSections ¶
UpdateSections updates the cache used to prevent inserting duplicate sections. For each key in the given map we check whether it is already cached. If it is, the correspopnding map value is set to `false`, else it will be added to the cache and the correponding map value is set to `true`. In order to not require holding each individual section ID in memory, we use the section's job ID as a cache key.
func (*Cache) UpdateTestCases ¶
UpdateTestCases updates the cache used to prevent inserting duplicate test cases. For each key in the given map we check whether it is already cached. If it is, the correspopnding map value is set to `false`, else it will be added to the cache and the correponding map value is set to `true`. In order to not require holding each individual test case ID in memory, we use the test case's test suite ID as a cache key.
func (*Cache) UpdateTestReports ¶
func (*Cache) UpdateTestSuites ¶
func (*Cache) UpdateTraceSpans ¶
type Client ¶
func (*Client) PrepareBatch ¶
type ClientConfig ¶
type DeduplicateTableOptions ¶
type MigrationOptions ¶ added in v0.7.0
type MigrationOptions struct { ClientConfig FileSystem fs.FS Path string }