utils

package
v0.0.0-...-73c3907 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const I18nUtilsKey i18n.ModuleKey = "I18nUtilsKey"

Variables

View Source
var Messages_en_US = &Messages{
	OK:     "OK",
	Cancel: "Cancel",
}
View Source
var Messages_ja_JP = &Messages{
	OK:     "OK",
	Cancel: "キャンセル",
}
View Source
var Messages_zh_CN = &Messages{
	OK:     "确定",
	Cancel: "取消",
}

Functions

func Configure

func Configure(b *presets.Builder)

func ConfirmDialog

func ConfirmDialog(msg string, okAction string, msgr *Messages) h.HTMLComponent

func Contains

func Contains(a interface{}, b interface{}) bool

func GetPrimaryKeys

func GetPrimaryKeys(obj interface{}, db *gorm.DB) (result []string, err error)

func GetStruct

func GetStruct(t reflect.Type) interface{}

func ParseTagOption

func ParseTagOption(str string) map[string]string

ParseTagOption parse tag options to hash

func PrimarySluggerWhere

func PrimarySluggerWhere(db *gorm.DB, obj interface{}, id string, withoutKeys ...string) *gorm.DB

func SetPrimaryKeys

func SetPrimaryKeys(from, to interface{}, db *gorm.DB, paramId string) (err error)

func Transact

func Transact(db *gorm.DB, f func(tx *gorm.DB) error) (err error)

Types

type Messages

type Messages struct {
	OK     string
	Cancel string
}

Jump to

Keyboard shortcuts

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