pkg

package
v0.0.0-...-04d14b8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadInput      = errors.New("provided input is invalid")
	ErrNotFound      = errors.New("resource not found")
	ErrDuplicate     = errors.New("resource is not unique")
	ErrDatabaseError = errors.New("database error")
)
View Source
var Version string

Version can now be provided on build using -ldflags "-X github.com/dmitry-kostin/go-rest/src/pkg.Version=1.0.0"

Functions

func AnnotateError

func AnnotateError(original, markAs error, wrapWith string) error

func AnnotateErrorWithDetail

func AnnotateErrorWithDetail(original, markAs error, wrapWith, humanMessage string) error

Types

type Config

type Config struct {
	AppHostName      string   `env:"APP_HOST_NAME" envDefault:"127.0.0.1"`
	AppEnv           string   `env:"APP_ENV" envDefault:"LOCAL"`
	AppPort          string   `env:"APP_PORT" envDefault:"3001"`
	DatabaseName     string   `env:"DB_APP_NAME"`
	DatabaseUser     string   `env:"DB_APP_USER"`
	DatabasePassword string   `env:"DB_APP_PASSWORD"`
	DatabaseHostname string   `env:"DB_APP_HOSTNAME" envDefault:"127.0.0.1"`
	AppAPIKeys       []string `env:"APP_API_KEYS" envDefault:""`
	Version          string   `envDefault:"-"`
}

func NewConfig

func NewConfig() *Config

type Logger

type Logger struct {
	zerolog.Logger
}

func NewEmptyLogger

func NewEmptyLogger() *Logger

func NewLogger

func NewLogger() *Logger

func NewPrettyLogger

func NewPrettyLogger() *Logger

Jump to

Keyboard shortcuts

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