core

package
v0.0.0-...-e3494e8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 10 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 Err

func Err(c *fiber.Ctx, 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 *fiber.Ctx, key string, defaultValue ...string) int32

func I64

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

func IP

func IP(c *fiber.Ctx) string

IP get remote IP

func Int

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

func Lang

func Lang() string

func Msg

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

Msg push common response

func Now

func Now() time.Time

func Ok

func Ok(c *fiber.Ctx, data interface{}) error

Ok 正常响应

func ParseDate

func ParseDate(date string) time.Time

func Push

func Push(c *fiber.Ctx, code int) error

Push 推送响应

func PushError

func PushError(err string)

func PushMessages

func PushMessages(msg string)

func RegisterAdminCheckRouter

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

func RegisterCheckRouter

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

func RegisterDatabase

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

func RegisterNoCheckRouter

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

func Render

func Render(c *fiber.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 *fiber.Ctx, key string, defaultValue ...string) string

func U32

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

func U64

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

func Uint

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

func Validate

func Validate(i interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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