clickhouse

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PipelinesTable          string = "pipelines"
	JobsTable               string = "jobs"
	SectionsTable           string = "sections"
	BridgesTable            string = "bridges"
	TestReportsTable        string = "testreports"
	TestSuitesTable         string = "testsuites"
	TestCasesTable          string = "testcases"
	LogEmbeddedMetricsTable string = "metrics"
	TraceSpansTable         string = "traces"
)

Variables

This section is empty.

Functions

func DeduplicateTable

func DeduplicateTable(ctx context.Context, opt DeduplicateTableOptions, ch *Client) error

func InsertBridges

func InsertBridges(c *Client, ctx context.Context, bridges []*typespb.Bridge) (int, error)

func InsertJobs

func InsertJobs(c *Client, ctx context.Context, jobs []*typespb.Job) (int, error)

func InsertMetrics

func InsertMetrics(c *Client, ctx context.Context, metrics []*typespb.Metric) (int, error)

func InsertPipelines

func InsertPipelines(c *Client, ctx context.Context, pipelines []*typespb.Pipeline) (int, error)

func InsertSections

func InsertSections(c *Client, ctx context.Context, sections []*typespb.Section) (int, error)

func InsertTestCases

func InsertTestCases(c *Client, ctx context.Context, cases []*typespb.TestCase) (int, error)

func InsertTestReports

func InsertTestReports(c *Client, ctx context.Context, reports []*typespb.TestReport) (int, error)

func InsertTestSuites

func InsertTestSuites(c *Client, ctx context.Context, suites []*typespb.TestSuite) (int, error)

func InsertTraces

func InsertTraces(c *Client, ctx context.Context, traces []*typespb.Trace) (int, error)

func PrepareDeduplicateQuery

func PrepareDeduplicateQuery(opt DeduplicateTableOptions) (string, map[string]string)

func SelectPipelineMaxUpdatedAt

func SelectPipelineMaxUpdatedAt(c *Client, ctx context.Context) (map[int64]float64, error)

func SelectTableIDs

func SelectTableIDs[T int64 | string](c *Client, ctx context.Context, table string, column string) (map[T]struct{}, error)

func SelectTraceSpanIDs

func SelectTraceSpanIDs(c *Client, ctx context.Context) (map[string]struct{}, error)

func WithParameters

func WithParameters(ctx context.Context, params map[string]string) context.Context

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCache

func NewCache() *Cache

func (*Cache) UpdateBridges

func (c *Cache) UpdateBridges(data []int64, updated []bool)

func (*Cache) UpdateJobs

func (c *Cache) UpdateJobs(data []int64, updated []bool)

func (*Cache) UpdateLogEmbeddedMetrics

func (c *Cache) UpdateLogEmbeddedMetrics(data []int64, updated []bool)

func (*Cache) UpdatePipelines

func (c *Cache) UpdatePipelines(data map[int64]float64, updated map[int64]bool)

func (*Cache) UpdateSections

func (c *Cache) UpdateSections(data []int64, updated []bool)

func (*Cache) UpdateTestCases

func (c *Cache) UpdateTestCases(data []string, updated []bool)

func (*Cache) UpdateTestReports

func (c *Cache) UpdateTestReports(data []string, updated []bool)

func (*Cache) UpdateTestSuites

func (c *Cache) UpdateTestSuites(data []string, updated []bool)

func (*Cache) UpdateTraceSpans

func (c *Cache) UpdateTraceSpans(data []string, updated []bool)

type Client

type Client struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg ClientConfig) (*Client, error)

func (*Client) Configure

func (c *Client) Configure(cfg ClientConfig) error

func (*Client) CreateTables

func (c *Client) CreateTables(ctx context.Context) error

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, query string, args ...any) error

func (*Client) InitCache

func (c *Client) InitCache(ctx context.Context) error

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) PrepareBatch

func (c *Client) PrepareBatch(ctx context.Context, query string) (driver.Batch, error)

func (*Client) Select

func (c *Client) Select(ctx context.Context, dest any, query string, args ...any) error

type ClientConfig

type ClientConfig struct {
	Host     string
	Port     string
	Database string
	User     string
	Password string
}

type DeduplicateTableOptions

type DeduplicateTableOptions struct {
	Database    string
	Table       string
	Final       *bool
	By          []string
	Except      []string
	ThrowIfNoop *bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL