database

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *sqlx.DB
View Source
var Session *mgo.Session

Functions

func DeleteItems

func DeleteItems(ds entity.DataSource, key string, value string) (err error)

func GetDataSourceCol

func GetDataSourceCol(host string, port string, username string, password string, authSource string, database string, col string) (*mgo.Session, *mgo.Collection, error)

func GetElasticSearchClient

func GetElasticSearchClient(ds entity.DataSource) (client *elastic.Client, err error)

func GetItem

func GetItem(ds entity.DataSource, key string, value string) (item entity.Item, err error)

func GetItemKeys

func GetItemKeys(item entity.Item) (res []string)

func GetItemSqlUpdateStr

func GetItemSqlUpdateStr(item entity.Item) string

func GetItemValues

func GetItemValues(item entity.Item) (res []string)

func GetItemValuesWithQuote

func GetItemValuesWithQuote(item entity.Item) (res []string)

func GetKafkaConnection

func GetKafkaConnection(ds entity.DataSource) (conn *kafka.Conn, err error)

func GetMongoCol

func GetMongoCol(ds entity.DataSource) (*mgo.Session, *mgo.Collection, error)

func GetSqlDatabase

func GetSqlDatabase(ds entity.DataSource) *sqlx.DB

func GetSqlDatabaseConnectionString

func GetSqlDatabaseConnectionString(dataSourceType string, host string, port string, username string, password string, database string) (connStr string, err error)

func IndexItem

func IndexItem(ds entity.DataSource, item entity.Item) (err error)

func InsertItem

func InsertItem(ds entity.DataSource, item entity.Item) (err error)

func SendKafkaMsg

func SendKafkaMsg(ds entity.DataSource, item entity.Item) (err error)

func UpdateItem

func UpdateItem(ds entity.DataSource, item entity.Item, dedupField string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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