i18nerr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string
const (
	InvalidParameter  Code = "InvalidParameter"
	OperationDenied   Code = "OperationDenied"
	PermissionDenied  Code = "PermissionDenied"
	AlreadyExist      Code = "AlreadyExist"
	NotFound          Code = "NotFound"
	OperationConflict Code = "OperationConflict"
	LimitExceeded     Code = "LimitExceeded"
	TokenExpired      Code = "TokenExpired"
	LoginRequired     Code = "LoginRequired"
	InternalError     Code = "InternalError"
	Unknown           Code = "Unknown"
)

type Error

type Error struct {
	// Code represent the error code in string
	Code Code `json:"Code" query:"Code"`
	// chinese
	Zh string `json:"Zh" query:"Zh"`
	// chinese in taiwan
	Tw string `json:"Tw" query:"Tw"`
	// english
	En string `json:"En" query:"En"`
	// japanese
	Ja string `json:"Ja" query:"Ja"`
	// korean
	Ko string `json:"Ko" query:"Ko"`
	// french
	Fr string `json:"Fr" query:"Fr"`
	// russian
	Ru string `json:"Ru" query:"Ru"`
	// arguments used for format string
	Args []any `json:"Args,omitempty" query:"Args"`
}

func (Error) Error

func (d Error) Error() string

func (Error) ErrorIn

func (d Error) ErrorIn(lang string) string

func (Error) New

func (d Error) New(args ...any) Error

Jump to

Keyboard shortcuts

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