panics

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package panics provides checks to help avoid nil pointer panics caused by missing arguments provided to some funcs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoArtM    = errors.New("art models file is nil")
	ErrNoBoil    = errors.New("exec boil context executor is nil or invalid")
	ErrNoBuffer  = errors.New("bytes buffer pointer is nil")
	ErrNoContext = errors.New("ctx context is nil")
	ErrNoDB      = errors.New("db database pointer is nil")
	ErrNoEchoE   = errors.New("e echo pointer is nil")
	ErrNoEchoC   = errors.New("c echo context pointer is nil")
	ErrNoEmbed   = errors.New("embed file system instance is empty")
	ErrNoGroup   = errors.New("g echo group pointer is nil")
	ErrNoSlog    = errors.New("sl slog logger pointer is nil")
	ErrNoTx      = errors.New("tx transaction pointer is nil")
)

Functions

func BoilExec

func BoilExec(exec boil.ContextExecutor) bool

BoilExec returns true if the database context executor is invalid such as nil.

func BoilExecCrash

func BoilExecCrash(exec boil.ContextExecutor)

BoilExecCrash panics if the exec boil context extractor is invalid. This is a fallback function intended for the model packages to reduce programmign boilerplate by requiring only the function without conditional statements.

func ContextB

func ContextB(ctx context.Context, exec boil.ContextExecutor) error

func ContextBS

func ContextBS(ctx context.Context, exec boil.ContextExecutor, sl *slog.Logger) error

func ContextD

func ContextD(ctx context.Context, db *sql.DB) error

func ContextDS

func ContextDS(ctx context.Context, db *sql.DB, sl *slog.Logger) error

func ContextDTS

func ContextDTS(ctx context.Context, db *sql.DB, tx *sql.Tx, sl *slog.Logger) error

func ContextS

func ContextS(ctx context.Context, sl *slog.Logger) error

func ContextT

func ContextT(ctx context.Context, tx *sql.Tx) error

func DS

func DS(db *sql.DB, sl *slog.Logger) error

func EchoContextD

func EchoContextD(c echo.Context, db *sql.DB) error

func EchoContextDS

func EchoContextDS(c echo.Context, db *sql.DB, sl *slog.Logger) error

func EchoContextS

func EchoContextS(c echo.Context, sl *slog.Logger) error

func EchoDS

func EchoDS(e *echo.Echo, db *sql.DB, sl *slog.Logger) error

EchoDS checks the arguments for handler package. If an error is returned, the calling method or func should abort and return the error.

func EchoDSP

func EchoDSP(e *echo.Echo, db *sql.DB, sl *slog.Logger, public embed.FS) error

EchoDSP checks the arguments for handler package. If an error is returned, the calling method or func should abort and return the error.

func EchoP

func EchoP(e *echo.Echo, public embed.FS) error

EchoP checks the arguments for handler package. If an error is returned, the calling method or func should abort and return the error.

func EchoS

func EchoS(e *echo.Echo, sl *slog.Logger) error

EchoS checks the arguments for handler package. If an error is returned, the calling method or func should abort and return the error.

func GroupD

func GroupD(g *echo.Group, db *sql.DB) error

func GroupDS

func GroupDS(g *echo.Group, db *sql.DB, sl *slog.Logger) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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