app

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValidation = &ValidationError{ActualError: errors.New("VALIDATION_ERROR")}
	ErrFatal      = errors.New("FATAL_ERROR")
)

Functions

func GetAppDataDir

func GetAppDataDir(pwd string, isDebugBuild bool) (string, error)

func InitLogFile

func InitLogFile(appDataDir, logFileName string) (*os.File, error)

InitLogFile creates (or appends) a log file in the app data directory

func InitLogger

func InitLogger(logFile io.Writer, appVersion, commitSha string) zerolog.Logger

func InitializeAppDataDir

func InitializeAppDataDir(appDataDir string)

InitializeAppDataDir creates the app data directory if it does not exist and exits the program if it cannot be created

func IsWailsRunningAppToGenerateBindings

func IsWailsRunningAppToGenerateBindings(osArgs []string) bool

func NewValidationError

func NewValidationError(msg string) error

func NewWailsLoggerAdapter

func NewWailsLoggerAdapter(logger *zerolog.Logger) logger.Logger

Types

type Context

type Context interface {
	context.Context

	Logger() *zerolog.Logger

	UserId() string
	RequestId() string
	CausationId() string
	CorrelationId() string
}

func NewContext

func NewContext(ctx context.Context, userId string, requestId string, causationId string, correlationId string, logger *zerolog.Logger) Context

type ErrorHandler

type ErrorHandler interface {
	Catch(ctx Context, logger zerolog.Logger, err error)
	CatchWithMsg(ctx Context, logger zerolog.Logger, err error, msg string)
}

func NewErrorHandler

func NewErrorHandler() ErrorHandler

type ValidationError

type ValidationError struct {
	ActualError error
}

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) Is

func (e *ValidationError) Is(target error) bool

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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