helper

package
v0.0.0-...-e9c9027 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Not Found Error
	ErrNotFound = errors.New("not found")
	// User Not Provided Error
	ErrNoUserProvided = errors.New("user not provided")
	// Database Connection Error
	ErrDBConnection = errors.New("database connection error")
	// Password Not Equal Error
	ErrPasswordsNotEqual = errors.New("password not equal to confirmed password")
	// User Already Exists Error
	ErrUserAlreadyExists = errors.New("user already exists")
	// No User Name Provided Error
	ErrNoUsernameProvided = errors.New("no user name provided")
	// No Password Provided Error
	ErrNoPasswordProvided = errors.New("no password provided")
	// Invalid Username Provided Error
	ErrInvalidUsernameProvided = errors.New("invalid username provided")
	// Invalid Password Provided Error
	ErrInvalidPasswordProvided = errors.New("invalid password provided")
	// Invalid Arguments Provided Error
	ErrInvalidArgumentProvided = errors.New("invalid argument/s provided")
	// Inconsistent IDs Error
	ErrInconsistentIDs = errors.New("inconsistent IDs")
	// Already Exists Error
	ErrAlreadyExists = errors.New("already exists")
	// Inconsistent Mapping Between Route and Handler Error
	ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)")
)

Functions

func WelcomeMessage

func WelcomeMessage(firstname, lastname string) string

Types

type ErrorHandlerFunc

type ErrorHandlerFunc func(ctx context.Context, err error)

The ErrorHandlerFunc type is an adapter to allow the use of ordinary function as ErrorHandler. If f is a function with the appropriate signature, ErrorHandlerFunc(f) is a ErrorHandler that calls f.

func (ErrorHandlerFunc) Handle

func (f ErrorHandlerFunc) Handle(ctx context.Context, err error)

Handle calls f(ctx, err).

type Handler

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

func NewTransportHandler

func NewTransportHandler(logger *zap.Logger) Handler

NewTransportHandler defines a new transport handler

func (Handler) Handle

func (handler Handler) Handle(ctx context.Context, err error)

Handle Logs errors if present

Jump to

Keyboard shortcuts

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