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.Job) (int, error)
- func InsertCoverageClasses(c *Client, ctx context.Context, clss []*typespb.CoverageClass) (int, error)
- func InsertCoverageMethods(c *Client, ctx context.Context, mtds []*typespb.CoverageMethod) (int, error)
- func InsertCoveragePackages(c *Client, ctx context.Context, pkgs []*typespb.CoveragePackage) (int, error)
- func InsertCoverageReports(c *Client, ctx context.Context, reports []*typespb.CoverageReport) (int, error)
- func InsertDeployments(c *Client, ctx context.Context, deployments []*typespb.Deployment) (int, error)
- func InsertIssues(c *Client, ctx context.Context, issues []*typespb.Issue) (int, error)
- func InsertJobs(c *Client, ctx context.Context, jobs []*typespb.Job) (int, error)
- func InsertMergeRequestNoteEvents(c *Client, ctx context.Context, mres []*typespb.MergeRequestNoteEvent) (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 InsertRunners(c *Client, ctx context.Context, runners []*typespb.Runner, ...) (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 MigrateDown(opts MigrationOptions) 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 Client
- func (c *Client) Exec(ctx context.Context, query string, args ...any) error
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) PrepareBatch(ctx context.Context, query string) (driver.Batch, error)
- func (c *Client) Select(ctx context.Context, dest any, query string, args ...any) error
- func (c *Client) SetMaxConcurrentQueries(n int64)
- type ClientConfig
- type CoverageClass
- type CoverageMethod
- type CoveragePackage
- type CoverageReport
- type DeduplicateTableOptions
- type Deployment
- type Issue
- type Job
- type MergeRequest
- type MergeRequestNoteEvent
- type Metric
- type MigrationOptions
- type Pipeline
- type Project
- type Runner
- type Section
- type TestCase
- type TestReport
- type TestSuite
Constants ¶
View Source
const ( BridgesTable string = "bridges" CoverageReportsTable string = "coverage_reports" CoveragePackagesTable string = "coverage_packages" CoverageClassesTable string = "coverage_classes" CoverageMethodsTable string = "coverage_methods" DeploymentsTable string = "deployments" IssuesTable string = "issues" JobsTable string = "jobs" MergeRequestNoteEventsTable string = "mergerequest_noteevents" MergeRequestsTable string = "mergerequests" MetricsTable string = "metrics" PipelinesTable string = "pipelines" ProjectsTable string = "projects" RunnersTable string = "runners" SectionsTable string = "sections" TestCasesTable string = "testcases" TestReportsTable string = "testreports" TestSuitesTable string = "testsuites" TraceSpansTable string = "traces" )
Variables ¶
View Source
var ( ErrMigrateNoChange = migrate.ErrNoChange ErrMigrateNilVersion = migrate.ErrNilVersion )
Functions ¶
func ClientOptions ¶
func ClientOptions(cfg ClientConfig) clickhouse.Options
func DeduplicateTable ¶
func DeduplicateTable(ctx context.Context, opt DeduplicateTableOptions, ch *Client) error
func InsertBridges ¶
func InsertCoverageClasses ¶
func InsertCoverageMethods ¶
func InsertCoveragePackages ¶
func InsertCoverageReports ¶
func InsertDeployments ¶
func InsertIssues ¶ added in v0.14.0
func InsertMergeRequests ¶
func InsertMetrics ¶
func InsertPipelines ¶
func InsertProjects ¶
func InsertRunners ¶ added in v0.16.0
func InsertSections ¶
func InsertTestCases ¶
func InsertTestReports ¶
func InsertTestSuites ¶
func InsertTraces ¶
func MigrateDown ¶
func MigrateDown(opts MigrationOptions) error
func MigrateUp ¶
func MigrateUp(opts MigrationOptions) error
func NewMigration ¶
func NewMigration(opts MigrationOptions) (*migrate.Migrate, error)
func PrepareDeduplicateQuery ¶
func PrepareDeduplicateQuery(opt DeduplicateTableOptions) (string, map[string]string)
func SelectTableIDs ¶
func SelectTraceSpanIDs ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) PrepareBatch ¶
func (*Client) SetMaxConcurrentQueries ¶
type ClientConfig ¶
type CoverageClass ¶
type CoverageClass struct {
Id string `ch:"id"`
PackageId string `ch:"package_id"`
ReportId string `ch:"report_id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
PackageName string `ch:"package_name"`
Name string `ch:"name"`
Filename string `ch:"filename"`
LineRate float32 `ch:"line_rate"`
BranchRate float32 `ch:"branch_rate"`
Complexity float32 `ch:"complexity"`
}
type CoverageMethod ¶
type CoverageMethod struct {
Id string `ch:"id"`
ClassId string `ch:"class_id"`
PackageId string `ch:"package_id"`
ReportId string `ch:"report_id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
PackageName string `ch:"package_name"`
ClassName string `ch:"class_name"`
Name string `ch:"name"`
Signature string `ch:"signature"`
LineRate float32 `ch:"line_rate"`
BranchRate float32 `ch:"branch_rate"`
Complexity float32 `ch:"complexity"`
}
type CoveragePackage ¶
type CoveragePackage struct {
Id string `ch:"id"`
ReportId string `ch:"report_id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
Name string `ch:"name"`
LineRate float32 `ch:"line_rate"`
BranchRate float32 `ch:"branch_rate"`
Complexity float32 `ch:"complexity"`
}
type CoverageReport ¶
type CoverageReport struct {
Id string `ch:"id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
LineRate float32 `ch:"line_rate"`
LinesCovered int32 `ch:"lines_covered"`
LinesValid int32 `ch:"lines_valid"`
BranchRate float32 `ch:"branch_rate"`
BranchesCovered int32 `ch:"branches_covered"`
BranchesValid int32 `ch:"branches_valid"`
Complexity float32 `ch:"complexity"`
Version string `ch:"version"`
Timestamp int64 `ch:"timestamp"`
SourcePaths []string `ch:"source_paths"`
}
type DeduplicateTableOptions ¶
type Deployment ¶
type Deployment struct {
Id int64 `ch:"id"`
Iid int64 `ch:"iid"`
EnvironmentId int64 `ch:"environment_id"`
EnvironmentName string `ch:"environment_name"`
EnvironmentTier string `ch:"environment_tier"`
ProjectId int64 `ch:"project_id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
TriggererId int64 `ch:"triggerer_id"`
TriggererUsername string `ch:"triggerer_username"`
TriggererName string `ch:"triggerer_name"`
CreatedAt float64 `ch:"created_at"`
FinishedAt float64 `ch:"finished_at"`
UpdatedAt float64 `ch:"updated_at"`
Status string `ch:"status"`
Ref string `ch:"ref"`
Sha string `ch:"sha"`
}
type Issue ¶ added in v0.14.0
type Issue struct {
Id int64 `ch:"id"`
Iid int64 `ch:"iid"`
ProjectId int64 `ch:"project_id"`
CreatedAt float64 `ch:"created_at"`
UpdatedAt float64 `ch:"updated_at"`
ClosedAt float64 `ch:"closed_at"`
Title string `ch:"title"`
Labels []string `ch:"labels"`
Type string `ch:"type"`
Severity string `ch:"severity"`
State string `ch:"state"`
}
type Job ¶
type Job struct {
Id int64 `ch:"id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
Name string `ch:"name"`
Ref string `ch:"ref"`
RefPath string `ch:"ref_path"`
Status string `ch:"status"`
FailureReason string `ch:"failure_reason"`
ExitCode int64 `ch:"exit_code"`
CreatedAt float64 `ch:"created_at"`
QueuedAt float64 `ch:"queued_at"`
StartedAt float64 `ch:"started_at"`
FinishedAt float64 `ch:"finished_at"`
ErasedAt float64 `ch:"erased_at"`
QueuedDuration float64 `ch:"queued_duration"`
Duration float64 `ch:"duration"`
Coverage float64 `ch:"coverage"`
Stage string `ch:"stage"`
TagList []string `ch:"tag_list"`
Properties [][]string `ch:"properties"`
AllowFailure bool `ch:"allow_failure"`
Manual bool `ch:"manual"`
Retried bool `ch:"retried"`
Retryable bool `ch:"retryable"`
Kind string `ch:"kind"`
DownstreamPipelineId int64 `ch:"downstream_pipeline_id"`
DownstreamPipelineIid int64 `ch:"downstream_pipeline_iid"`
DownstreamPipelineProjectId int64 `ch:"downstream_pipeline_project_id"`
RunnerId string `ch:"runner_id"`
// deprecated
Pipeline []any `ch:"pipeline"` // Tuple(id Int64, project_id Int64, ref String, sha String, status String)
}
type MergeRequest ¶
type MergeRequest struct {
Id int64 `ch:"id"`
Iid int64 `ch:"iid"`
ProjectId int64 `ch:"project_id"`
CreatedAt float64 `ch:"created_at"`
UpdatedAt float64 `ch:"updated_at"`
MergedAt float64 `ch:"merged_at"`
ClosedAt float64 `ch:"closed_at"`
Name string `ch:"name"`
Title string `ch:"title"`
Labels []string `ch:"labels"`
State string `ch:"state"`
MergeStatus string `ch:"merge_status"`
MergeError string `ch:"merge_error"`
SourceProjectId int64 `ch:"source_project_id"`
SourceBranch string `ch:"source_branch"`
TargetProjectId int64 `ch:"target_project_id"`
TargetBranch string `ch:"target_branch"`
Additions int64 `ch:"additions"`
Changes int64 `ch:"changes"`
Deletions int64 `ch:"deletions"`
FileCount int64 `ch:"file_count"`
CommitCount int64 `ch:"commit_count"`
BaseSha string `ch:"base_sha"`
HeadSha string `ch:"head_sha"`
StartSha string `ch:"start_sha"`
MergeCommitSha string `ch:"merge_commit_sha"`
RebaseCommitSha string `ch:"rebase_commit_sha"`
AuthorId int64 `ch:"author_id"`
AuthorUsername string `ch:"author_username"`
AuthorName string `ch:"author_name"`
AssigneesId []int64 `ch:"assignees_id"`
AssigneesUsername []string `ch:"assignees_username"`
AssigneesName []string `ch:"assignees_name"`
ReviewersId []int64 `ch:"reviewers_id"`
ReviewersUsername []string `ch:"reviewers_username"`
ReviewersName []string `ch:"reviewers_name"`
ApproversId []int64 `ch:"approvers_id"`
ApproversUsername []string `ch:"approvers_username"`
ApproversName []string `ch:"approvers_name"`
MergeUserId int64 `ch:"merge_user_id"`
MergeUserUsername string `ch:"merge_user_username"`
MergeUserName string `ch:"merge_user_name"`
Approved bool `ch:"approved"`
Conflicts bool `ch:"conflicts"`
Draft bool `ch:"draft"`
Mergeable bool `ch:"mergeable"`
MilestoneId int64 `ch:"milestone_id"`
MilestoneIid int64 `ch:"milestone_iid"`
MilestoneProjectId int64 `ch:"milestone_project_id"`
}
type MergeRequestNoteEvent ¶
type MergeRequestNoteEvent struct {
Id int64 `ch:"id"`
MergeRequestId int64 `ch:"mergerequest_id"`
MergeRequestIid int64 `ch:"mergerequest_iid"`
MergeRequestProjectId int64 `ch:"mergerequest_project_id"`
CreatedAt float64 `ch:"created_at"`
UpdatedAt float64 `ch:"updated_at"`
ResolvedAt float64 `ch:"resolved_at"`
Type string `ch:"type"`
System bool `ch:"system"`
Internal bool `ch:"internal"`
AuthorId int64 `ch:"author_id"`
AuthorUsername string `ch:"author_username"`
AuthorName string `ch:"author_name"`
Resolvable bool `ch:"resolvable"`
Resolved bool `ch:"resolved"`
ResolverId int64 `ch:"resolver_id"`
ResolverUsername string `ch:"resolver_username"`
ResolverName string `ch:"resolver_name"`
}
type MigrationOptions ¶
type MigrationOptions struct {
ClientConfig
FileSystem fs.FS
Path string
}
type Pipeline ¶
type Pipeline struct {
Id int64 `ch:"id"`
Iid int64 `ch:"iid"`
ProjectId int64 `ch:"project_id"`
Name string `ch:"name"`
Ref string `ch:"ref"`
RefPath string `ch:"ref_path"`
Sha string `ch:"sha"`
Source string `ch:"source"`
Status string `ch:"status"`
FailureReason string `ch:"failure_reason"`
CommittedAt float64 `ch:"committed_at"`
CreatedAt float64 `ch:"created_at"`
UpdatedAt float64 `ch:"updated_at"`
StartedAt float64 `ch:"started_at"`
FinishedAt float64 `ch:"finished_at"`
QueuedDuration float64 `ch:"queued_duration"`
Duration float64 `ch:"duration"`
Coverage float64 `ch:"coverage"`
Warnings bool `ch:"warnings"`
YamlErrors bool `ch:"yaml_errors"`
Child bool `ch:"child"`
UpstreamPipelineId int64 `ch:"upstream_pipeline_id"`
UpstreamPipelineIid int64 `ch:"upstream_pipeline_iid"`
UpstreamPipelineProjectId int64 `ch:"upstream_pipeline_project_id"`
DownstreamPipelines []pipelineReference `ch:"downstream_pipelines"`
MergeRequestId int64 `ch:"merge_request_id"`
MergeRequestIid int64 `ch:"merge_request_iid"`
MergeRequestProjectId int64 `ch:"merge_request_project_id"`
UserId int64 `ch:"user_id"`
}
type Project ¶
type Project struct {
Id int64 `ch:"id"`
NamespaceId int64 `ch:"namespace_id"`
Name string `ch:"name"`
FullName string `ch:"full_name"`
Path string `ch:"path"`
FullPath string `ch:"full_path"`
Description string `ch:"description"`
Topics []string `ch:"topics"`
CreatedAt float64 `ch:"created_at"`
UpdatedAt float64 `ch:"updated_at"`
LastActivityAt float64 `ch:"last_activity_at"`
JobArtifactsSize int64 `ch:"job_artifacts_size"`
ContainerRegistrySize int64 `ch:"container_registry_size"`
LfsObjectsSize int64 `ch:"lfs_objects_size"`
PackagesSize int64 `ch:"packages_size"`
PipelineArtifactsSize int64 `ch:"pipeline_artifacts_size"`
RepositorySize int64 `ch:"repository_size"`
SnippetsSize int64 `ch:"snippets_size"`
StorageSize int64 `ch:"storage_size"`
UploadsSize int64 `ch:"uploads_size"`
WikiSize int64 `ch:"wiki_size"`
ForksCount int64 `ch:"forks_count"`
StarsCount int64 `ch:"stars_count"`
CommitCount int64 `ch:"commit_count"`
OpenIssuesCount int64 `ch:"open_issues_count"`
Archived bool `ch:"archived"`
Visibility string `ch:"visibility"`
DefaultBranch string `ch:"default_branch"`
}
type Runner ¶ added in v0.16.0
type Runner struct {
Id int64 `ch:"id"`
ShortSha string `ch:"short_sha"`
Description string `ch:"description"`
RunnerType string `ch:"runner_type"`
TagList []string `ch:"tag_list"`
Status string `ch:"status"`
Locked bool `ch:"locked"`
Paused bool `ch:"paused"`
RunProtected bool `ch:"run_protected"`
RunUntagged bool `ch:"run_untagged"`
CreatedAt float64 `ch:"created_at"`
ContactedAt float64 `ch:"contacted_at"`
CreatedById int64 `ch:"created_by_id"`
CreatedByUsername string `ch:"created_by_username"`
CreatedByName string `ch:"created_by_name"`
}
type Section ¶
type Section struct {
Id int64 `ch:"id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
Name string `ch:"name"`
StartedAt float64 `ch:"started_at"`
FinishedAt float64 `ch:"finished_at"`
Duration float64 `ch:"duration"`
// deprecated
Job []any `ch:"job"` // Tuple(id Int64, name String, status String)
Pipeline []any `ch:"pipeline"` // Tuple(id Int64, project_id Int64, ref String, sha String, status String)
}
type TestCase ¶
type TestCase struct {
Id string `ch:"id"`
TestSuiteId string `ch:"testsuite_id"`
TestReportId string `ch:"testreport_id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
Status string `ch:"status"`
Name string `ch:"name"`
Classname string `ch:"classname"`
File string `ch:"file"`
ExecutionTime float64 `ch:"execution_time"`
SystemOutput string `ch:"system_output"`
AttachmentUrl string `ch:"attachment_url"`
Properties [][]string `ch:"properties"`
}
type TestReport ¶
type TestReport struct {
Id string `ch:"id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
TotalTime float64 `ch:"total_time"`
TotalCount int64 `ch:"total_count"`
ErrorCount int64 `ch:"error_count"`
FailedCount int64 `ch:"failed_count"`
SkippedCount int64 `ch:"skipped_count"`
SuccessCount int64 `ch:"success_count"`
}
type TestSuite ¶
type TestSuite struct {
Id string `ch:"id"`
TestReportId string `ch:"testreport_id"`
JobId int64 `ch:"job_id"`
PipelineId int64 `ch:"pipeline_id"`
ProjectId int64 `ch:"project_id"`
Name string `ch:"name"`
TotalTime float64 `ch:"total_time"`
TotalCount int64 `ch:"total_count"`
ErrorCount int64 `ch:"error_count"`
FailedCount int64 `ch:"failed_count"`
SkippedCount int64 `ch:"skipped_count"`
SuccessCount int64 `ch:"success_count"`
Properties [][]string `ch:"properties"`
}
Click to show internal directories.
Click to hide internal directories.