core

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config *configuration

Config singletone

Functions

func Check

func Check(e error, isFatal bool)

Check checks multiple err != nil mantras & logs if something went wrong

func GetCached

func GetCached(key string, frequency time.Duration, method Method) (interface{}, error)

GetCached returns cached result of a func

func GetEnv added in v0.0.9

func GetEnv(key string, fallback interface{}) interface{}

GetEnv returns ENV variable value or fallback if not set

func InitConfiguration added in v0.0.9

func InitConfiguration(overrides map[string]interface{})

InitConfiguration sets Config singletone by ENV variables overriden by map

func InitLogger added in v0.0.10

func InitLogger()

InitLogger sets debug level and logger preferences

Types

type Method

type Method func() (interface{}, error)

type QueryLogger

type QueryLogger struct{}

QueryLogger logs formatted queries

func (QueryLogger) AfterQuery

func (ql QueryLogger) AfterQuery(c context.Context, q *pg.QueryEvent) error

AfterQuery logs formatted query after it finishes

func (QueryLogger) BeforeQuery

func (ql QueryLogger) BeforeQuery(c context.Context, q *pg.QueryEvent) (context.Context, error)

BeforeQuery dummy

Jump to

Keyboard shortcuts

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