Documentation
¶
Overview ¶
Package panics provides checks to help avoid nil pointer panics caused by missing arguments provided to some funcs.
Index ¶
- Variables
- func BoilExec(exec boil.ContextExecutor) bool
- func BoilExecCrash(exec boil.ContextExecutor)
- func ContextB(ctx context.Context, exec boil.ContextExecutor) error
- func ContextBS(ctx context.Context, exec boil.ContextExecutor, sl *slog.Logger) error
- func ContextD(ctx context.Context, db *sql.DB) error
- func ContextDS(ctx context.Context, db *sql.DB, sl *slog.Logger) error
- func ContextDTS(ctx context.Context, db *sql.DB, tx *sql.Tx, sl *slog.Logger) error
- func ContextS(ctx context.Context, sl *slog.Logger) error
- func ContextT(ctx context.Context, tx *sql.Tx) error
- func DS(db *sql.DB, sl *slog.Logger) error
- func EchoContextD(c echo.Context, db *sql.DB) error
- func EchoContextDS(c echo.Context, db *sql.DB, sl *slog.Logger) error
- func EchoContextS(c echo.Context, sl *slog.Logger) error
- func EchoDS(e *echo.Echo, db *sql.DB, sl *slog.Logger) error
- func EchoDSP(e *echo.Echo, db *sql.DB, sl *slog.Logger, public embed.FS) error
- func EchoP(e *echo.Echo, public embed.FS) error
- func EchoS(e *echo.Echo, sl *slog.Logger) error
- func GroupD(g *echo.Group, db *sql.DB) error
- func GroupDS(g *echo.Group, db *sql.DB, sl *slog.Logger) error
Constants ¶
This section is empty.
Variables ¶
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 ContextDTS ¶
func EchoContextD ¶
func EchoContextS ¶
func EchoDS ¶
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 ¶
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 ¶
EchoP checks the arguments for handler package. If an error is returned, the calling method or func should abort and return the error.
Types ¶
This section is empty.