core

package
v0.0.0-...-224a6a0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const POSTGRES_DSN = "postgresql://%s:%s@%s:%d/%s?sslmode=%s&x-multi-statement=true"

Variables

View Source
var (
	ZlevelToGlevel = map[zerolog.Level]gommon.Lvl{
		zerolog.DebugLevel: gommon.DEBUG,
		zerolog.InfoLevel:  gommon.INFO,
		zerolog.WarnLevel:  gommon.WARN,
		zerolog.ErrorLevel: gommon.ERROR,
		zerolog.Disabled:   gommon.OFF,
	}

	GlevelToZlevel = map[gommon.Lvl]zerolog.Level{
		gommon.DEBUG: zerolog.DebugLevel,
		gommon.INFO:  zerolog.InfoLevel,
		gommon.WARN:  zerolog.WarnLevel,
		gommon.ERROR: zerolog.ErrorLevel,
		gommon.OFF:   zerolog.Disabled,
	}

	ZlevelToPlevel = map[zerolog.Level]pgx.LogLevel{
		zerolog.TraceLevel: pgx.LogLevelTrace,
		zerolog.DebugLevel: pgx.LogLevelDebug,
		zerolog.InfoLevel:  pgx.LogLevelInfo,
		zerolog.WarnLevel:  pgx.LogLevelWarn,
		zerolog.ErrorLevel: pgx.LogLevelError,
		zerolog.Disabled:   pgx.LogLevelNone,
	}

	PlevelToZlevel = map[pgx.LogLevel]zerolog.Level{
		pgx.LogLevelTrace: zerolog.TraceLevel,
		pgx.LogLevelDebug: zerolog.DebugLevel,
		pgx.LogLevelInfo:  zerolog.InfoLevel,
		pgx.LogLevelWarn:  zerolog.WarnLevel,
		pgx.LogLevelError: zerolog.ErrorLevel,
		pgx.LogLevelNone:  zerolog.Disabled,
	}
)
View Source
var ErrBinderGeneric = internal.NewError("Binder failed")
View Source
var ErrErrorHandlerGeneric = internal.NewError("Error handler failed")
View Source
var ErrMigratorGeneric = internal.NewError("Migrator failed")
View Source
var ErrRendererGeneric = internal.NewError("Renderer failed")
View Source
var ErrSerializerGeneric = internal.NewError("Serializer failed")
View Source
var ErrValidatorGeneric = internal.NewError("Validator failed")
View Source
var TEMPLATE_EXTENSIONS = regexp.MustCompile(`^.*\.(html|txt|md)$`)

Functions

This section is empty.

Types

type Binder

type Binder struct {
	// contains filtered or unexported fields
}

func NewBinder

func NewBinder(configuration internal.Configuration, logger Logger) *Binder

func (*Binder) Bind

func (self *Binder) Bind(i interface{}, c echo.Context) error

type ErrorHandler

type ErrorHandler struct {
	// contains filtered or unexported fields
}

func NewErrorHandler

func NewErrorHandler(configuration internal.Configuration, logger Logger) *ErrorHandler

func (*ErrorHandler) Handle

func (self *ErrorHandler) Handle(err error, ctx echo.Context)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(configuration internal.Configuration) *Logger

func (Logger) Close

func (self Logger) Close(ctx context.Context) error

func (Logger) Debug

func (self Logger) Debug(i ...interface{})

func (Logger) Debugf

func (self Logger) Debugf(format string, i ...interface{})

func (Logger) Error

func (self Logger) Error(i ...interface{})

func (Logger) Errorf

func (self Logger) Errorf(format string, i ...interface{})

func (Logger) Fatal

func (self Logger) Fatal(i ...interface{})

func (Logger) Fatalf

func (self Logger) Fatalf(format string, i ...interface{})

func (Logger) Flush

func (self Logger) Flush()

func (Logger) GLevel

func (self Logger) GLevel() gommon.Lvl

func (*Logger) Header

func (self *Logger) Header() string

func (Logger) Info

func (self Logger) Info(i ...interface{})

func (Logger) Infof

func (self Logger) Infof(format string, i ...interface{})

func (Logger) Logger

func (self Logger) Logger() *zerolog.Logger

func (Logger) Output

func (self Logger) Output() io.Writer

func (Logger) PLevel

func (self Logger) PLevel() pgx.LogLevel

func (Logger) Panic

func (self Logger) Panic(i ...interface{})

func (Logger) Panicf

func (self Logger) Panicf(format string, i ...interface{})

func (Logger) Prefix

func (self Logger) Prefix() string

func (Logger) Print

func (self Logger) Print(i ...interface{})

func (Logger) Printf

func (self Logger) Printf(format string, i ...interface{})

func (*Logger) SetGLevel

func (self *Logger) SetGLevel(l gommon.Lvl)

func (*Logger) SetHeader

func (self *Logger) SetHeader(h string)

func (*Logger) SetLogger

func (self *Logger) SetLogger(l zerolog.Logger)

func (*Logger) SetOutput

func (self *Logger) SetOutput(w io.Writer)

func (*Logger) SetPLevel

func (self *Logger) SetPLevel(l pgx.LogLevel)

func (*Logger) SetPrefix

func (self *Logger) SetPrefix(p string)

func (Logger) SetVerbose

func (self Logger) SetVerbose(v bool)

func (*Logger) SetZLevel

func (self *Logger) SetZLevel(l zerolog.Level)

func (Logger) Verbose

func (self Logger) Verbose() bool

func (Logger) Warn

func (self Logger) Warn(i ...interface{})

func (Logger) Warnf

func (self Logger) Warnf(format string, i ...interface{})

func (Logger) ZLevel

func (self Logger) ZLevel() zerolog.Level

type MigrateLogger

type MigrateLogger struct {
	// contains filtered or unexported fields
}

func NewMigrateLogger

func NewMigrateLogger(logger Logger) *MigrateLogger

func (MigrateLogger) Printf

func (self MigrateLogger) Printf(format string, v ...interface{})

func (MigrateLogger) Verbose

func (self MigrateLogger) Verbose() bool

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(configuration internal.Configuration, logger Logger) (*Migrator, error)

func (*Migrator) Apply

func (self *Migrator) Apply(ctx context.Context) error

func (*Migrator) Close

func (self *Migrator) Close(ctx context.Context) error

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(configuration internal.Configuration, logger Logger) *Renderer

func (*Renderer) Render

func (self *Renderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error

func (*Renderer) RenderBytes

func (self *Renderer) RenderBytes(template string, data interface{}) ([]byte, error)

func (*Renderer) RenderStd

func (self *Renderer) RenderStd(w io.Writer, template string, data interface{}) error

func (*Renderer) RenderString

func (self *Renderer) RenderString(template string, data interface{}) (string, error)

type Serializer

type Serializer struct {
	// contains filtered or unexported fields
}

func NewSerializer

func NewSerializer(configuration internal.Configuration, logger Logger) *Serializer

func (*Serializer) Deserialize

func (self *Serializer) Deserialize(c echo.Context, i interface{}) error

func (*Serializer) Serialize

func (self *Serializer) Serialize(c echo.Context, i interface{}, indent string) error

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(configuration internal.Configuration, logger Logger) *Validator

func (*Validator) Validate

func (self *Validator) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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