handlers

package
v0.0.0-...-278a536 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserCollection = "users"
)

Variables

View Source
var (
	MsgRouterNotFound = &pbs.Error{
		Code:        http.StatusNotFound,
		Description: "router not found.",
	}

	MsgUserAlreadyExisted = &pbs.Error{
		Code:        http.StatusConflict,
		Description: "username already exists.",
	}
	MsgLoginFailed = &pbs.Error{
		Code:        http.StatusUnauthorized,
		Description: "username or password is mismatch.",
	}
	MsgInternalServerError = &pbs.Error{
		Code:        http.StatusInternalServerError,
		Description: "oops...something went wrong.",
	}
	MsgBadUserRequest = &pbs.Error{
		Code:        http.StatusBadRequest,
		Description: "invalid user input.",
	}

	ErrUserNameAlreadyExisted = errors.New("username already existed.")
)

Functions

func InitHandlers

func InitHandlers(router *gotham.Router, db *mongo.Database, log *zap.Logger)

func Recovery

func Recovery(logger *zap.Logger) gotham.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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