registry

package
v0.0.0-...-2572d14 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoRegistry -
	ErrNoRegistry = errors.New("no registry available")

	// ErrWriterClosed -
	ErrWriterClosed = errors.New("writer is closed")
)

Functions

This section is empty.

Types

type BatchCapacity

type BatchCapacity int

BatchCapacity max batch capacity before flush

type BatchFlushedCountReporter

type BatchFlushedCountReporter func(int)

BatchFlushedCountReporter reports count rows were flushed by batch

type BatchWriter

type BatchWriter interface {
	PutTrace(*model.TraceModel) error
	PutNftTable(*model.NftTableModel) error
	Flush() error
	Close() error
}

BatchWriter db batch writer abstract

type BatchWriterOpt

type BatchWriterOpt interface {
	// contains filtered or unexported methods
}

type ClickOptions

type ClickOptions clickhouse.Options

func BuildFromDSN

func BuildFromDSN(dsn string) (*ClickOptions, error)

BuildFromDSN - create build from the dsn link

func (*ClickOptions) New

func (bld *ClickOptions) New(ctx context.Context) (driver.Conn, error)

New -

func (*ClickOptions) WithBlockBufferSize

func (bld *ClickOptions) WithBlockBufferSize(size uint8) *ClickOptions

WithBlockBufferSize - maximum number of blocks to decode into the buffer at once. Larger values will increase parallelization at the expense of memory. Block sizes are query dependent so while you can set this on the connection, we recommend you override per query based on the data it returns. Defaults to 2.

func (*ClickOptions) WithClientInfo

func (bld *ClickOptions) WithClientInfo(name, version string) *ClickOptions

WithClientInfo - some client information

func (*ClickOptions) WithCompression

func (bld *ClickOptions) WithCompression() *ClickOptions

WithCompression - enable compression for blocks

func (*ClickOptions) WithConnMaxLifetime

func (bld *ClickOptions) WithConnMaxLifetime(d time.Duration) *ClickOptions

WithConnMaxLifetime - maximum lifetime to keep a connection available. Defaults to 1hr. Connections are destroyed after this time, with new connections added to the pool as required.

func (*ClickOptions) WithConnOpenStrategy

func (bld *ClickOptions) WithConnOpenStrategy(s clickhouse.ConnOpenStrategy) *ClickOptions

WithConnOpenStrategy - determines how the list of node addresses should be consumed and used to open connections

func (*ClickOptions) WithDebug

func (bld *ClickOptions) WithDebug(log logger.TypeOfLogger) *ClickOptions

WithDebug - enable debugging

func (*ClickOptions) WithDialTimeout

func (bld *ClickOptions) WithDialTimeout(d time.Duration) *ClickOptions

WithDialTimeout - the maximum time to establish a connection. Defaults to 1s

func (*ClickOptions) WithMaxCompressionBuffer

func (bld *ClickOptions) WithMaxCompressionBuffer(size int) *ClickOptions

func (*ClickOptions) WithMaxExecutionTime

func (bld *ClickOptions) WithMaxExecutionTime(t int) *ClickOptions

WithMaxExecutionTime - max time for one transaction

func (*ClickOptions) WithMaxIdleConns

func (bld *ClickOptions) WithMaxIdleConns(c int) *ClickOptions

WithMaxIdleConns - number of connections to maintain in the pool. Connections will be reused if possible. Defaults to 5

func (*ClickOptions) WithMaxOpenConns

func (bld *ClickOptions) WithMaxOpenConns(c int) *ClickOptions

WithMaxOpenConns - max connections for use at any time. More or fewer connections may be in the idle pool, but only this number can be used at any time. Defaults to MaxIdleConns+5

func (*ClickOptions) WithTLSConf

func (bld *ClickOptions) WithTLSConf(tls *tls.Config)

WithTLSConf - TLS options. A non-nil value enables TLS

type CountDBWriteEvent

type CountDBWriteEvent struct {
	Cnt int
	observer.EventType
}

type Reader

type Reader interface {
	FetchTraces(context.Context, *model.TraceScopeModel) ([]model.FetchTraceModel, error)
	FetchNftTable(context.Context, Scope) ([]model.FetchNftTableModel, error)
	Close() error
}

Reader db reader abstract

type Registry

type Registry interface {
	BatchWriter(ctx context.Context, table string, opts ...BatchWriterOpt) (BatchWriter, error)
	Reader(ctx context.Context) (Reader, error)
	Close() error
}

Registry abstract db registry

func NewRegistryFromClickHouse

func NewRegistryFromClickHouse(
	db string,
	rows int,
	conn driver.Conn,
	subj observer.Subject) Registry

NewRegistryFromClickHouse creates registry from ClickHouse

type Scope

type Scope = filter.Scope

Scope -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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