service

package
v0.0.0-...-8c116a7 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DBAdapterPostgres ...
	DBAdapterPostgres = "postgres"
	// DBAdapterMySQL ...
	DBAdapterMySQL = "mysql"
)
View Source
const (
	// LoggerAdapterConsole ...
	LoggerAdapterConsole = "console"
)

Variables

View Source
var (
	// DBPool ...
	DBPool = &sql.DB{}
	// ErrDatabaseAdapterNotSupported ...
	ErrDatabaseAdapterNotSupported = errors.New("service: database adapter not supported")
)
View Source
var (
	// Logger is singleton instance of logger.
	Logger *logrus.Logger
	// ErrLoggerAdapterNotSupported ...
	ErrLoggerAdapterNotSupported = errors.New("service: logger adapter not supported")
)
View Source
var (
	// ErrPostgresConnectionFailed ...
	ErrPostgresConnectionFailed = errors.New("service: postgres connection failed")
)

Functions

func InitConfig

func InitConfig(environment string)

InitConfig ...

func InitDB

func InitDB(config DBConfig)

InitDB ...

func InitLogger

func InitLogger(config LoggerConfig)

InitLogger ...

func InitPostgres

func InitPostgres(config DBConfig)

InitPostgres ...

Types

type AppConfig

type AppConfig struct {
	Logger LoggerConfig `xml:"logger"`
	DB     DBConfig     `xml:"database"`
}

AppConfig ...

var Config AppConfig

Config ...

type DBConfig

type DBConfig struct {
	Adapter          string `xml:"adapter"`
	ConnectionString string `xml:"connection-string"`
}

DBConfig ...

type LoggerConfig

type LoggerConfig struct {
	Adapter string `xml:"adapter"`
	Level   uint8  `xml:"level"`
}

LoggerConfig ...

Jump to

Keyboard shortcuts

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