writers

package
v0.0.0-...-48e7155 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetWriterConstructor

func SetWriterConstructor(name string, fn WriterConstructor)

Types

type ElasticSearchWriter

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

func (*ElasticSearchWriter) Delete

func (e *ElasticSearchWriter) Delete(params *types.SyncParams) error

func (ElasticSearchWriter) GetDataSource

func (w ElasticSearchWriter) GetDataSource() datasources.DataSource

GetDataSource 获取当前写入器数据源

func (*ElasticSearchWriter) Insert

func (e *ElasticSearchWriter) Insert(params *types.SyncParams, values interface{}) error

func (*ElasticSearchWriter) Update

func (e *ElasticSearchWriter) Update(params *types.SyncParams, values interface{}) error

type MysqlWriter

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

func (*MysqlWriter) Delete

func (w *MysqlWriter) Delete(params *types.SyncParams) error

func (MysqlWriter) GetDataSource

func (w MysqlWriter) GetDataSource() datasources.DataSource

GetDataSource 获取当前写入器数据源

func (*MysqlWriter) Insert

func (w *MysqlWriter) Insert(params *types.SyncParams, values interface{}) error

func (*MysqlWriter) Update

func (w *MysqlWriter) Update(params *types.SyncParams, values interface{}) error

type Writer

type Writer interface {
	Insert(params *types.SyncParams, values interface{}) error
	Update(params *types.SyncParams, values interface{}) error
	Delete(params *types.SyncParams) error
	GetDataSource() datasources.DataSource
}

func NewElasticSearchWriter

func NewElasticSearchWriter(source datasources.DataSource) Writer

func NewMysqlWriter

func NewMysqlWriter(source datasources.DataSource) Writer

type WriterConstructor

type WriterConstructor func(datasources.DataSource) Writer

func GetWriterConstructor

func GetWriterConstructor(name string) WriterConstructor

GetWriterConstructor 获取写入构造函数

type WriterPool

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

WriterPool 写入器池

func NewWriterPool

func NewWriterPool() *WriterPool

func (*WriterPool) GetWriter

func (wp *WriterPool) GetWriter(wType string) (Writer, error)

GetWriter 获取写入器

func (*WriterPool) GetWriters

func (wp *WriterPool) GetWriters() map[string]Writer

GetWriters 获取所有写入器

func (*WriterPool) SetConfigs

func (wp *WriterPool) SetConfigs(configs map[string]map[string]datasources.DataSourceConfig) error

SetConfigs 给所有写入器更新配置,添加新增写入器,删除移除写入器

Jump to

Keyboard shortcuts

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