database

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DbConn *sql.DB
)

DbConn stores the connexion to the database

View Source
var EsConn *elastic.Client

EsConn stores ES client

Functions

func ConnectES

func ConnectES(ctx context.Context, foreverLoopDelay time.Duration) error

ConnectES creates a new ES client and stores it

func ConnectSQL

func ConnectSQL() error

ConnectSQL connection to database

func GetEsConn

func GetEsConn(ctx context.Context, foreverLoopDelay time.Duration) (*elastic.Client, error)

GetEsConn returns the es client connexion.

Types

type Config

type Config struct {
	DbHost     string `env:"DB_HOST"`
	DbName     string `env:"MYSQL_DATABASE"`
	DbUser     string `env:"MYSQL_USER"`
	DbPassword string `env:"MYSQL_PASSWORD"`
	DbConn     *sql.DB
}

Config for DB connection

type ConfigEs

type ConfigEs struct {
	URL string `env:"ES_URL"`
}

ConfigEs to configure ES client

Jump to

Keyboard shortcuts

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