Documentation
¶
Overview ¶
Package serialize 提供对 message 包的序列化操作
Index ¶
- func LoadFS(fsys fs.FS, name string, u UnmarshalFunc) (*message.Language, error)
- func LoadFSGlob(fsys fs.FS, glob string, u UnmarshalFunc) ([]*message.Language, error)
- func LoadFile(path string, u UnmarshalFunc) (*message.Language, error)
- func LoadGlob(glob string, u UnmarshalFunc) ([]*message.Language, error)
- func Marshal(l *message.Language, f MarshalFunc) ([]byte, error)
- func SaveFile(l *message.Language, path string, f MarshalFunc, mode fs.FileMode) error
- func SaveFiles(langs []*message.Language, dir, ext string, f MarshalFunc, mode fs.FileMode) error
- func Unmarshal(data []byte, u UnmarshalFunc) (*message.Language, error)
- type MarshalFunc
- type UnmarshalFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadGlob ¶
func LoadGlob(glob string, u UnmarshalFunc) ([]*message.Language, error)
LoadGlob 批量加载文件
相同语言 ID 的项会合并。
func Marshal ¶
func Marshal(l *message.Language, f MarshalFunc) ([]byte, error)
Marshal 将 l 转换为 []byte
Types ¶
type MarshalFunc ¶
type UnmarshalFunc ¶
Click to show internal directories.
Click to hide internal directories.