Documentation ¶
Index ¶
- Constants
- type Messages
- func (mes *Messages) AddError(name string, msg string) error
- func (mes *Messages) AddErrorT(name string, id string) error
- func (mes *Messages) AddErrorTf(name string, id string, args ...interface{}) error
- func (mes *Messages) AddErrorf(name string, msg string, args ...interface{}) error
- func (mes *Messages) AddInfo(name string, msg string)
- func (mes *Messages) AddInfoT(name string, id string)
- func (mes *Messages) AddInfoTf(name string, id string, args ...interface{})
- func (mes *Messages) AddInfof(name string, msg string, args ...interface{})
- func (mes *Messages) ClearAllErrors()
- func (mes *Messages) ClearAllInfos()
- func (mes *Messages) ClearErrors(name string)
- func (mes *Messages) ClearInfos(name string)
- func (mes *Messages) Error(err error) error
- func (mes *Messages) ErrorT(err error) error
- func (mes *Messages) ErrorTf(err error, args ...interface{}) error
- func (mes *Messages) GetAllErrors() map[string][]string
- func (mes *Messages) GetAllInfos() map[string][]string
- func (mes *Messages) GetErrors(name string) []string
- func (mes *Messages) GetInfos(name string) []string
- func (mes *Messages) HasErrors() bool
- func (mes *Messages) HasInfos() bool
- func (mes *Messages) ImportFromError(name string, err error) error
- func (mes *Messages) ImportFromErrorT(name string, err error) error
- func (mes *Messages) ImportFromErrorTf(name string, err error, args ...interface{}) error
Constants ¶
const MessagesKey = "nyaapantsu.messages"
MessagesKey : use for context
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Messages ¶
type Messages struct { Errors map[string][]string Infos map[string][]string T i18n.TranslateFunc // contains filtered or unexported fields }
Messages struct
func GetMessages ¶
GetMessages : Initialize or return the messages object from context
func (*Messages) AddErrorTf ¶
AddErrorTf : Add an error in category name with translation string id formatted with args
func (*Messages) AddErrorf ¶
AddErrorf : Add an error in category name with message msg formatted with args
func (*Messages) AddInfoTf ¶
AddInfoTf : Add an info in category name with translation string id formatted with args
func (*Messages) AddInfof ¶
AddInfof : Add an info in category name with message msg formatted with args
func (*Messages) ClearAllErrors ¶
func (mes *Messages) ClearAllErrors()
ClearAllErrors : Erase all errors in messages
func (*Messages) ClearAllInfos ¶
func (mes *Messages) ClearAllInfos()
ClearAllInfos : Erase all infos in messages
func (*Messages) ClearErrors ¶
ClearErrors : Erase all errors in messages
func (*Messages) ClearInfos ¶
ClearInfos : Erase all infos in messages
func (*Messages) Error ¶
ImportFromError : Aliases to import directly an error in "errors" map index
func (*Messages) ErrorT ¶
ErrorT : Aliases to import directly an error in "errors" map index and translate the error
func (*Messages) ErrorTf ¶
ErrorTf : Aliases to import directly an error in "errors" map index and translate the error with args
func (*Messages) GetAllErrors ¶
GetAllErrors : Get all errors
func (*Messages) GetAllInfos ¶
GetAllInfos : Get all infos
func (*Messages) ImportFromError ¶
ImportFromError : Add an error in category name with message msg imported from type error
func (*Messages) ImportFromErrorT ¶
ImportFromErrorT : Add an error in category name with message msg imported from type error