clickhouse

package
v0.0.0-...-80164ef Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClickHouseConfigIsRequired = errors.NewError("SYS", "ClickHouse config is required")
	ErrLoggerIsRequired           = errors.NewError("SYS", "Logger is required")
)

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (b *Builder) Build() (*ClickHouse, error)

func (*Builder) Config

func (b *Builder) Config(config *Config) *Builder

func (*Builder) Logger

func (b *Builder) Logger(logger Logger) *Builder

type ClickHouse

type ClickHouse struct {
	// contains filtered or unexported fields
}

func (*ClickHouse) Select

func (ch *ClickHouse) Select(ctx context.Context, result any, query string, queryArgs map[string]any) error

func (*ClickHouse) Start

func (ch *ClickHouse) Start(ctx context.Context) error

func (*ClickHouse) Stop

func (ch *ClickHouse) Stop(ctx context.Context) error

type Config

type Config struct {
	URL          string
	Database     string
	Username     string
	Password     string
	MaxOpenConns int
	MaxIdleConns int
}

type Logger

type Logger interface {
	LogError(ctx context.Context, errs ...error)
	LogInfo(ctx context.Context, messages ...string)
}

type Repository

type Repository interface {
	Select(ctx context.Context, result any, query string, queryArgs map[string]any) error
}

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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