toasts

package
v0.0.0-...-ee677a6 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthEmailRequired                    = fmt.Errorf("email is required")
	ErrAuthPasswordRequired                 = fmt.Errorf("password is required")
	ErrAuthAddressRequired                  = fmt.Errorf("address is required")
	ErrAuthVerificationCodeNotCorrectFormat = fmt.Errorf("verification code is not in correct format")
	ErrCookieValueTooLong                   = fmt.Errorf("cookie value too long")
	ErrCookieInvalidValue                   = fmt.Errorf("invalid cookie value")
)
View Source
var (
	ErrCartItemCreation = fmt.Errorf("internal server error, failed to create a cart item")
	ErrCartDoesNotExist = fmt.Errorf("internal server error, cart does not exist")
)
View Source
var (
	ErrNameIsRequired              = fmt.Errorf("name is required")
	ErrImageIsRequired             = fmt.Errorf("image url is required")
	ErrPriceShouldBePositiveNumber = fmt.Errorf("price should be positive number")
	ErrNotValidUUID                = fmt.Errorf("not valid uuid")
	ErrImageNotFound               = fmt.Errorf("image not found")
	ErrDatabaseTransactionFailed   = fmt.Errorf("database transaction failed")
	ErrNotOwnAccount               = fmt.Errorf("not own account")
	ErrNotValidCookie              = fmt.Errorf("not valid cookie")
)
View Source
var (
	ErrOrderCreation = fmt.Errorf("internal server error, failed to create a order")
	ErrOrderNotFound = fmt.Errorf("order not found")
)
View Source
var (
	ErrPizzasAlreadyExists = fmt.Errorf("pizza with this name already exists")
	ErrPizzaCreation       = fmt.Errorf("internal server error, failed to create a pizza")
	ErrPizzaNotFound       = fmt.Errorf("pizza not found")
	ErrPizzaFailedToLoad   = fmt.Errorf("pizza failed to load")
	ErrPizzaUpdating       = fmt.Errorf("internal server error, failed to update a pizza")
	ErrPizzaDeletion       = fmt.Errorf("internal server error, failed to delete a pizza")
)
View Source
var (
	ErrSaladsAlreadyExists = fmt.Errorf("salad with this name already exists")
	ErrSaladCreation       = fmt.Errorf("internal server error, failed to create a salad")
	ErrSaladNotFound       = fmt.Errorf("salad not found")
	ErrSaladFailedToLoad   = fmt.Errorf("salad failed to load")
	ErrSaladUpdating       = fmt.Errorf("internal server error, failed to update a salad")
	ErrSaladDeletion       = fmt.Errorf("internal server error, failed to delete a salad")
)
View Source
var (
	ErrUserAlreadyExists = fmt.Errorf("user with this name already exists")
	ErrUserCreation      = fmt.Errorf("internal server error, failed to create a user")
	ErrUserConfirmation  = fmt.Errorf("internal server error, failed to confirm a user")
	ErrUserNotFound      = fmt.Errorf("user not found")
)
View Source
var (
	ErrLoadingPaymentMetadata = fmt.Errorf("failed to load payments metadata")
)

Functions

func AddToast

func AddToast(w http.ResponseWriter, t Toast)

func GetAWSError

func GetAWSError(authErr error) error

Types

type Toast

type Toast struct {
	Message    string `json:"message"`
	StatusCode int    `json:"statusCode"`
}

func ErrorFailedRender

func ErrorFailedRender() Toast

func ErrorInternalServerError

func ErrorInternalServerError(err error) Toast

func ErrorNotFound

func ErrorNotFound(err error) Toast

func ErrorStatusForbidden

func ErrorStatusForbidden(err error) Toast

func ErrorStatusUnauthorized

func ErrorStatusUnauthorized(err error) Toast

func (Toast) Error

func (t Toast) Error() string

Jump to

Keyboard shortcuts

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