gocore

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

context

context

message_source 用来处理国际化资源

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReFormatToPlain

func ReFormatToPlain(path string)

解析gotext extract产生的json文件,包装成自己项目中的json格式 ERR开头的错误文件放前面

Types

type GlobalizationMessage

type GlobalizationMessage struct {
	Code string `json:"code"`
	En   string `json:"en_US"`
	Cn   string `json:"zh_CN"`
}

自己定义的国际化资源

type GoContext

type GoContext struct {
	// contains filtered or unexported fields
}

func NewGoContext

func NewGoContext() *GoContext

func (*GoContext) Bind

func (ctx *GoContext) Bind(v interface{}) error

func (*GoContext) Invoke

func (ctx *GoContext) Invoke(fn interface{}) ([]reflect.Value, error)

func (*GoContext) InvokeSpecific

func (ctx *GoContext) InvokeSpecific(fn interface{}, names ...string) ([]reflect.Value, error)

func (*GoContext) Register

func (ctx *GoContext) Register(v interface{})

注册一个

func (*GoContext) RegisterAs

func (ctx *GoContext) RegisterAs(v interface{}, interfacePtr interface{})

用接口注册

func (*GoContext) With

func (ctx *GoContext) With(fn interface{}) ([]reflect.Value, error)

func (*GoContext) WithSpecific

func (ctx *GoContext) WithSpecific(fn interface{}, names ...string) ([]reflect.Value, error)

type GoNamer

type GoNamer interface {
	GetGoName() string
}

唯一标识获取接口

type MessageSource

type MessageSource struct {
	// contains filtered or unexported fields
}

func NewMessageSource

func NewMessageSource() *MessageSource

func (*MessageSource) GetLocalized

func (ms *MessageSource) GetLocalized(code string, lang language.Tag, a ...interface{}) string

func (*MessageSource) Load

func (ms *MessageSource) Load(paths ...string)

Directories

Path Synopsis
eventbus eventhub
eventbus eventhub
frastructure
i18n
message_source 用来处理国际化资源
message_source 用来处理国际化资源
logfactory
logger_factory zaplogger
logger_factory zaplogger
context
context
userctx, 用户上下文
userctx, 用户上下文

Jump to

Keyboard shortcuts

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