message

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LOGGER = logging.MustGetLogger("errorMessageconfig")

Functions

func LoadErrorConfig

func LoadErrorConfig(fileName string) error

Each service will Need to load error config and init and pass to WWError function each time

func LoadMessage

func LoadMessage(locale, errorCode string) model.WorldWireError

func Translate

func Translate(r *http.Request, errorCode string, err error) model.WorldWireError

Types

type ErrorMessageConfig

type ErrorMessageConfig struct {
	WWError map[string]WWErrorMessage `toml:"WW_ERROR"`
}
var (
	ERROR_MESSAGE_CONFIG ErrorMessageConfig
)

type WWErrorMessage

type WWErrorMessage struct {
	ShortMessage string `toml:"SHORT_MESSAGE"`
	Details      string `toml:"DETAILS"`
}

Jump to

Keyboard shortcuts

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