config

package
v0.0.0-...-a60e448 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(cfg *Config)

func NewDriver

func NewDriver(cfg *Config) (*neo4j.DriverWithContext, error)

func NewPostgresClient

func NewPostgresClient(cfg *Config) (*sql.DB, *gorm.DB, error)

func NewPostgresTrackingClient

func NewPostgresTrackingClient(cfg *Config) (*sql.DB, *gorm.DB, error)

Types

type Config

type Config struct {
	Neo4jDb struct {
		Target                string `env:"NEO4J_TARGET,required"`
		User                  string `env:"NEO4J_AUTH_USER,required,unset"`
		Pwd                   string `env:"NEO4J_AUTH_PWD,required,unset"`
		Realm                 string `env:"NEO4J_AUTH_REALM"`
		MaxConnectionPoolSize int    `env:"NEO4J_MAX_CONN_POOL_SIZE" envDefault:"100"`
		LogLevel              string `env:"NEO4J_LOG_LEVEL" envDefault:"WARNING"`
	}
	PostgresDb struct {
		Host            string `env:"DB_HOST,required"`
		Port            int    `env:"DB_PORT,required"`
		Pwd             string `env:"DB_PWD,required,unset"`
		Name            string `env:"DB_NAME,required"`
		User            string `env:"DB_USER,required"`
		MaxConn         int    `env:"DB_MAX_CONN"`
		MaxIdleConn     int    `env:"DB_MAX_IDLE_CONN"`
		ConnMaxLifetime int    `env:"DB_CONN_MAX_LIFETIME"`
	}
	TrackingPostgresDb struct {
		Host            string `env:"DB_TRACKING_HOST,required"`
		Port            int    `env:"DB_TRACKING_PORT,required"`
		Pwd             string `env:"DB_TRACKING_PWD,required,unset"`
		Name            string `env:"DB_TRACKING_NAME,required"`
		User            string `env:"DB_TRACKING_USER,required"`
		MaxConn         int    `env:"DB_TRACKING_MAX_CONN"`
		MaxIdleConn     int    `env:"DB_TRACKING_MAX_IDLE_CONN"`
		ConnMaxLifetime int    `env:"DB_TRACKING_CONN_MAX_LIFETIME"`
	}
	TimeoutAfterTaskRun int    `env:"TIMEOUT_AFTER_TASK_RUN_SEC" envDefault:"60"`
	PageViewsBucketSize int    `env:"PAGE_VIEWS_BUCKET_SIZE" envDefault:"100"`
	LogLevel            string `env:"LOG_LEVEL" envDefault:"INFO"`
	PostgresLogLevel    string `env:"POSTGRES_LOG_LEVEL" envDefault:"WARN"`
}

Jump to

Keyboard shortcuts

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