cores

package
v0.0.0-...-04cd26f Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

Functions

func CloseDB

func CloseDB()

func Config

func Config() *config.ConfigRegistry

func ConnectDB

func ConnectDB()

func NewLogger

func NewLogger()

func RespBadReq

func RespBadReq(c fiber.Ctx, message string, err any) error

func RespCreated

func RespCreated(c fiber.Ctx, message string, data any) error

func RespInternalError

func RespInternalError(c fiber.Ctx, message string, err error) error

func RespNotFound

func RespNotFound(c fiber.Ctx, message string) error

func RespSuccess

func RespSuccess(c fiber.Ctx, message string, data any) error

func RespUnauthorized

func RespUnauthorized(c fiber.Ctx, message string) error

func SetDatabaseContract

func SetDatabaseContract(fn func(*pgxpool.Pool))

Types

type AppContracts

type AppContracts struct {
	App *fiber.App
	// contains filtered or unexported fields
}

func CreateContract

func CreateContract() *AppContracts

func (*AppContracts) CreateApp

func (app *AppContracts) CreateApp(ctx context.Context, config ...fiber.Config) *AppContracts

func (*AppContracts) Initialize

func (app *AppContracts) Initialize() *AppContracts

func (*AppContracts) RegisterAfter

func (app *AppContracts) RegisterAfter(hook HookFunc)

func (*AppContracts) RegisterBefore

func (app *AppContracts) RegisterBefore(hook HookFunc)

func (*AppContracts) RegisterRoute

func (app *AppContracts) RegisterRoute(route RouteFunc)

func (*AppContracts) Shutdown

func (app *AppContracts) Shutdown(ctx context.Context) error

func (*AppContracts) Start

func (app *AppContracts) Start() error

type BaseResponse

type BaseResponse struct {
	Success bool   `json:"success" msgpack:"success"`
	Message string `json:"message" msgpack:"message"`
	Data    any    `json:"data,omitempty" msgpack:"data,omitempty"`
	Error   any    `json:"error,omitempty" msgpack:"error,omitempty"`
}

type HookFunc

type HookFunc func(ctx context.Context, app *AppContracts) error

type RouteFunc

type RouteFunc func(app *AppContracts) error

Jump to

Keyboard shortcuts

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