core

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(dbs []*gorm.DB)

func CheckPassword

func CheckPassword(password, plain string) bool

func DateFormat

func DateFormat(t time.Time, layout string) string

func Error added in v0.2.0

func Error(c *Ctx, statusCode int, err error) error

func GetErrors

func GetErrors() []string

func GetMessages

func GetMessages() []string

func HTMXRedirectTo

func HTMXRedirectTo(HXURL string, HXGETURL string, c *fiber.Ctx) error

func HashPassword

func HashPassword(password string) string

func I32

func I32(c *Ctx, key string, defaultValue ...string) int32

func I64

func I64(c *Ctx, key string, defaultValue ...string) int64

func IP

func IP(c *Ctx) string

IP get remote IP

func Int

func Int(c *Ctx, key string, defaultValue ...string) int

func Lang

func Lang() string

func Msg

func Msg(c *Ctx, code int, msg string) error

Msg push common response

func Now

func Now() time.Time

func ParseDate

func ParseDate(date string) time.Time

func PushError

func PushError(err string)

func PushMessages

func PushMessages(msg string)

func RegisterAPICheckRouter added in v0.2.0

func RegisterAPICheckRouter(routerType string, f func(fiber.Router))

func RegisterAdminCheckRouter

func RegisterAdminCheckRouter(routerType string, f func(fiber.Router))

func RegisterDatabase

func RegisterDatabase(dbType string, f func([]*gorm.DB))

func RegisterRootNoCheckRouter added in v0.2.0

func RegisterRootNoCheckRouter(routerType string, f func(fiber.Router))

func Render

func Render(c *Ctx, name string, bind interface{}, layouts ...string) error

func SetLang

func SetLang(l string)

func SetZoneOffset

func SetZoneOffset(offset int)

func SetupDatabase

func SetupDatabase(dbs []*gorm.DB)

func SetupRouter

func SetupRouter(app *fiber.App)

func Str

func Str(c *Ctx, key string, defaultValue ...string) string

func U32

func U32(c *Ctx, key string, defaultValue ...string) uint32

func U64

func U64(c *Ctx, key string, defaultValue ...string) uint64

func Uint

func Uint(c *Ctx, key string, defaultValue ...string) uint

func Validate

func Validate(i interface{}) error

Types

type Ctx

type Ctx = fiber.Ctx

Jump to

Keyboard shortcuts

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