i18nPackKit

package
v3.0.19 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotSetupError = errorKit.New("Haven’t been set up correctly")
)

Functions

func MustSetUp

func MustSetUp(defaultLanguage language.Tag, messageFilePaths []string, maker BeanMaker)

func Pack

func Pack(langs []string, code string, data interface{}, msgArgs ...interface{}) interface{}

func PackFully

func PackFully(langs []string, code, msg string, data interface{}, msgArgs ...interface{}) interface{}

func Seal

func Seal(langs []string, code string, data interface{}, msgArgs ...interface{}) (string, error)

func SealFully

func SealFully(langs []string, code, msg string, data interface{}, msgArgs ...interface{}) (string, error)

func SetUp

func SetUp(defaultLanguage language.Tag, messageFilePaths []string, maker BeanMaker) (err error)

Types

type BeanMaker

type BeanMaker func(code, msg string, data interface{}) interface{}

BeanMaker

@return (1) 返回值是一个结构体实例指针
		(2) 结构体建议加上json tag

Jump to

Keyboard shortcuts

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