sql

package
v0.0.0-...-e6f4ba9 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnection

func NewConnection(config DBConfig) (*sql.DB, error)

NewConnection open new db connection

func NewSyncLogDBHook

func NewSyncLogDBHook(db *sql.DB, config DBConfig) (logrus.Hook, error)

NewSyncLogDBHook creates logrus.Hook instance with given sql.DB handler

func NewSyncLogPsqlHook

func NewSyncLogPsqlHook(config DBConfig) (logrus.Hook, error)

NewSyncLogPsqlHook wraps NewSyncLogDBHook, connects to postgresql

Types

type DBConfig

type DBConfig struct {
	User       string `yaml:"user"`
	Password   string `yaml:"password"`
	DBName     string `yaml:"dbname"`
	Host       string `yaml:"host"`
	InsertTmpl string `yaml:"inserttmpl"`
}

DBConfig holds configuration for database logging

Jump to

Keyboard shortcuts

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