base

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package base server 的基础环境

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StackError added in v0.60.0

func StackError(err error) error

StackError 为 err 带上调用信息

位置从调用 StackError 开始。 如果 err 为 nil,则返回 nil,如果 err 本身就为 StackError 返回的类型,则原样返回。

如果需要输出调用堆栈信息,需要指定 %+v 标记。

Types

type Base

type Base struct {
	Location *time.Location
	Catalog  *catalog.Builder
	Tag      language.Tag
	Printer  *message.Printer
	Logs     *logs.Logs
}

func New

func New(logs *logs.Logs, loc *time.Location, tag language.Tag) *Base

func (*Base) LoadLocaleFiles

func (l *Base) LoadLocaleFiles(fsys fs.FS, glob string, f *serialization.FS) error

func (*Base) NewPrinter

func (l *Base) NewPrinter(tag language.Tag) *message.Printer

Jump to

Keyboard shortcuts

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