utils

package
v0.0.0-...-3cf2f40 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

--- Global utility functions ---------------------------------------------------------------------------------------------------------------------

Index

Constants

This section is empty.

Variables

--- Exposure of variables to rest of application ------------------------------------------------------------------------

Functions

func CmdInitialize

func CmdInitialize(di di.Container)

--- Initialization of dependency injection containers from Verifier -----------------------------------------------------

func ConvertTime

func ConvertTime(date string) time.Time

--- Conversion of time field to database usable format ------------------------------------------------------------------

func DataAccessContainer

func DataAccessContainer(di di.Container) *appconfig.MainSettings

--- Provides global access to configuration data via dependency injection container -------------------------------------

func DatabaseAccessContainer

func DatabaseAccessContainer(di di.Container) *xorm.Engine

--- Provides global database access via dependency injection container --------------------------------------------------

func DatabaseContainer

func DatabaseContainer(di di.Container) *appconfig.DbSettings

--- Provides global access to configuration data via dependency injection container -------------------------------------

func InputWarn

func InputWarn(msg string, err error) bool

--- Error handling helper functions -------------------------------------------------------------------------------------

func LogAccessContainer

func LogAccessContainer(di di.Container) *zap.SugaredLogger

--- Provides global access to logger via dependency injection container -------------------------------------------------

func LogErrorRet

func LogErrorRet(msg string, err error) bool

func LogErrorf

func LogErrorf(msg string, err error)

func LogFatalf

func LogFatalf(msg string, err error)

func LogInfof

func LogInfof(msg string, data interface{})

func LogWarnf

func LogWarnf(msg string, err error)

func MaskLeft

func MaskLeft(s string) string

--- Masking of sensitive data when displayed ---------------------------------------------------------------------------

func ServicesError

func ServicesError(msg string, err interface{}, logger *zap.SugaredLogger)

func TrimInvoice

func TrimInvoice(invoice string) string

--- Removal of excess characters from ----------------------------------------------------------------------------------

Types

type ErrParam

type ErrParam struct {
	Msg          string
	Err          error
	ShouldReturn bool
}

func LogErrorRetf

func LogErrorRetf(err *ErrParam) *ErrParam

type GetData

type GetData interface {
	LogAccessContainer(di di.Container) *zap.SugaredLogger
	DataAccessContainer(di di.Container) *appconfig.MainSettings
	DatabaseAccessContainer(di di.Container) *xorm.Engine
	ErrCheckf(msg string, err error)
	Warnf(msg string, err error)
}

--- Interfaces for container types -------------------------------------------------------------------------------------- TODO Probably remove if not used

Jump to

Keyboard shortcuts

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